mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8209647: constantPoolHandle::constantPoolHandle(ConstantPool*) when precompiled header is disabled
Added fieldDescriptor.inline.hpp Reviewed-by: coleenp, shade
This commit is contained in:
parent
846e25f099
commit
bc62b3a40e
29 changed files with 124 additions and 47 deletions
|
@ -55,8 +55,9 @@
|
|||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/biasedLocking.hpp"
|
||||
#include "runtime/compilationPolicy.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/javaCalls.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/threadCritical.hpp"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include "interpreter/linkResolver.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/fieldDescriptor.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
|
||||
// ciField
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/fieldStreams.hpp"
|
||||
#include "runtime/fieldDescriptor.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/jniHandles.inline.hpp"
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/method.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "utilities/copy.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
#include "oops/symbol.hpp"
|
||||
#include "oops/typeArrayOop.inline.hpp"
|
||||
#include "prims/resolvedMethodTable.hpp"
|
||||
#include "runtime/fieldDescriptor.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include "runtime/biasedLocking.hpp"
|
||||
#include "runtime/compilationPolicy.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
#include "runtime/fieldDescriptor.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/icache.hpp"
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include "prims/methodHandles.hpp"
|
||||
#include "prims/nativeLookup.hpp"
|
||||
#include "runtime/compilationPolicy.hpp"
|
||||
#include "runtime/fieldDescriptor.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/reflection.hpp"
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/generateOopMap.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
|
||||
// Computes a CPC map (new_index -> original_index) for constant pool entries
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "oops/objArrayKlass.hpp"
|
||||
#include "oops/objArrayOop.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/fieldDescriptor.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/java.hpp"
|
||||
#include "runtime/jniHandles.inline.hpp"
|
||||
#include "runtime/synchronizer.hpp"
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "jfr/leakprofiler/checkpoint/objectSampleDescription.hpp"
|
||||
#include "jfr/recorder/checkpoint/jfrCheckpointWriter.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
#include "utilities/ostream.hpp"
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "jfr/writers/jfrJavaEventWriter.hpp"
|
||||
#include "oops/instanceKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/fieldDescriptor.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/handles.hpp"
|
||||
#include "runtime/jniHandles.inline.hpp"
|
||||
#include "runtime/thread.inline.hpp"
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "jvmci/jvmciCompilerToVM.hpp"
|
||||
#include "jvmci/jvmciCodeInstaller.hpp"
|
||||
#include "jvmci/jvmciRuntime.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/flags/jvmFlag.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "oops/objArrayKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "prims/jvmtiExport.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/init.hpp"
|
||||
#include "runtime/reflection.hpp"
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/jniHandles.inline.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
|
||||
|
||||
// This macro expands for non-inline functions, in class declarations.
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/compressedOops.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/fieldDescriptor.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
|
||||
#if INCLUDE_CDS_JAVA_HEAP
|
||||
KlassSubGraphInfo* HeapShared::_subgraph_info_list = NULL;
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
#include "prims/jvmtiThreadState.hpp"
|
||||
#include "prims/methodComparator.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/fieldDescriptor.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/javaCalls.hpp"
|
||||
#include "runtime/mutexLocker.hpp"
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
#include "prims/jvmtiThreadState.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/compilationPolicy.hpp"
|
||||
#include "runtime/fieldDescriptor.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/java.hpp"
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include "oops/symbol.hpp"
|
||||
#include "prims/jniCheck.hpp"
|
||||
#include "prims/jvm_misc.hpp"
|
||||
#include "runtime/fieldDescriptor.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/jfieldIDWorkaround.hpp"
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
# include "prims/jvmtiEnter.inline.hpp"
|
||||
# include "prims/jvmtiRawMonitor.hpp"
|
||||
# include "prims/jvmtiUtil.hpp"
|
||||
# include "runtime/fieldDescriptor.inline.hpp"
|
||||
# include "runtime/threadSMR.hpp"
|
||||
|
||||
</xsl:text>
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#include "prims/jvmtiUtil.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/javaCalls.hpp"
|
||||
#include "runtime/jfieldIDWorkaround.hpp"
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "prims/jvmtiTagMap.hpp"
|
||||
#include "prims/jvmtiThreadState.inline.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/handles.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/javaCalls.hpp"
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "oops/typeArrayOop.inline.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/compilationPolicy.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/javaCalls.hpp"
|
||||
#include "runtime/jniHandles.inline.hpp"
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/compilationPolicy.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/flags/jvmFlag.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/handshake.hpp"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include "oops/instanceKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/fieldStreams.hpp"
|
||||
#include "runtime/fieldDescriptor.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/signature.hpp"
|
||||
|
||||
|
|
|
@ -44,15 +44,9 @@ class fieldDescriptor {
|
|||
constantPoolHandle _cp;
|
||||
|
||||
// update the access_flags for the field in the klass
|
||||
void update_klass_field_access_flag() {
|
||||
InstanceKlass* ik = field_holder();
|
||||
ik->field(index())->set_access_flags(_access_flags.as_short());
|
||||
}
|
||||
inline void update_klass_field_access_flag();
|
||||
|
||||
FieldInfo* field() const {
|
||||
InstanceKlass* ik = field_holder();
|
||||
return ik->field(_index);
|
||||
}
|
||||
inline FieldInfo* field() const;
|
||||
|
||||
public:
|
||||
fieldDescriptor() {
|
||||
|
@ -62,26 +56,23 @@ class fieldDescriptor {
|
|||
DEBUG_ONLY(_index = badInt);
|
||||
reinitialize(ik, index);
|
||||
}
|
||||
Symbol* name() const {
|
||||
return field()->name(_cp());
|
||||
}
|
||||
Symbol* signature() const {
|
||||
return field()->signature(_cp());
|
||||
}
|
||||
InstanceKlass* field_holder() const { return _cp->pool_holder(); }
|
||||
ConstantPool* constants() const { return _cp(); }
|
||||
inline Symbol* name() const;
|
||||
inline Symbol* signature() const;
|
||||
inline InstanceKlass* field_holder() const;
|
||||
inline ConstantPool* constants() const;
|
||||
|
||||
AccessFlags access_flags() const { return _access_flags; }
|
||||
oop loader() const;
|
||||
// Offset (in words) of field from start of instanceOop / Klass*
|
||||
int offset() const { return field()->offset(); }
|
||||
inline int offset() const;
|
||||
Symbol* generic_signature() const;
|
||||
int index() const { return _index; }
|
||||
AnnotationArray* annotations() const;
|
||||
AnnotationArray* type_annotations() const;
|
||||
|
||||
// Initial field value
|
||||
bool has_initial_value() const { return field()->initval_index() != 0; }
|
||||
int initial_value_index() const { return field()->initval_index(); }
|
||||
inline bool has_initial_value() const;
|
||||
inline int initial_value_index() const;
|
||||
constantTag initial_value_tag() const; // The tag will return true on one of is_int(), is_long(), is_single(), is_double()
|
||||
jint int_initial_value() const;
|
||||
jlong long_initial_value() const;
|
||||
|
@ -90,7 +81,7 @@ class fieldDescriptor {
|
|||
oop string_initial_value(TRAPS) const;
|
||||
|
||||
// Field signature type
|
||||
BasicType field_type() const { return FieldType::basic_type(signature()); }
|
||||
inline BasicType field_type() const;
|
||||
|
||||
// Access flags
|
||||
bool is_public() const { return access_flags().is_public(); }
|
||||
|
@ -111,20 +102,9 @@ class fieldDescriptor {
|
|||
bool has_initialized_final_update() const { return access_flags().has_field_initialized_final_update(); }
|
||||
bool has_generic_signature() const { return access_flags().field_has_generic_signature(); }
|
||||
|
||||
void set_is_field_access_watched(const bool value) {
|
||||
_access_flags.set_is_field_access_watched(value);
|
||||
update_klass_field_access_flag();
|
||||
}
|
||||
|
||||
void set_is_field_modification_watched(const bool value) {
|
||||
_access_flags.set_is_field_modification_watched(value);
|
||||
update_klass_field_access_flag();
|
||||
}
|
||||
|
||||
void set_has_initialized_final_update(const bool value) {
|
||||
_access_flags.set_has_field_initialized_final_update(value);
|
||||
update_klass_field_access_flag();
|
||||
}
|
||||
inline void set_is_field_access_watched(const bool value);
|
||||
inline void set_is_field_modification_watched(const bool value);
|
||||
inline void set_has_initialized_final_update(const bool value);
|
||||
|
||||
// Initialization
|
||||
void reinitialize(InstanceKlass* ik, int index);
|
||||
|
|
82
src/hotspot/share/runtime/fieldDescriptor.inline.hpp
Normal file
82
src/hotspot/share/runtime/fieldDescriptor.inline.hpp
Normal file
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SHARE_VM_RUNTIME_FIELDDESCRIPTOR_INLINE_HPP
|
||||
#define SHARE_VM_RUNTIME_FIELDDESCRIPTOR_INLINE_HPP
|
||||
|
||||
#include "runtime/handles.inline.hpp"
|
||||
|
||||
// All fieldDescriptor inline functions that (directly or indirectly) use "_cp()" or "_cp->"
|
||||
// must be put in this file, as they require runtime/handles.inline.hpp.
|
||||
|
||||
inline Symbol* fieldDescriptor::name() const {
|
||||
return field()->name(_cp());
|
||||
}
|
||||
|
||||
inline Symbol* fieldDescriptor::signature() const {
|
||||
return field()->signature(_cp());
|
||||
}
|
||||
|
||||
inline InstanceKlass* fieldDescriptor::field_holder() const {
|
||||
return _cp->pool_holder();
|
||||
}
|
||||
|
||||
inline ConstantPool* fieldDescriptor::constants() const {
|
||||
return _cp();
|
||||
}
|
||||
|
||||
inline FieldInfo* fieldDescriptor::field() const {
|
||||
InstanceKlass* ik = field_holder();
|
||||
return ik->field(_index);
|
||||
}
|
||||
|
||||
inline int fieldDescriptor::offset() const { return field()->offset(); }
|
||||
inline bool fieldDescriptor::has_initial_value() const { return field()->initval_index() != 0; }
|
||||
inline int fieldDescriptor::initial_value_index() const { return field()->initval_index(); }
|
||||
|
||||
inline void fieldDescriptor::update_klass_field_access_flag() {
|
||||
InstanceKlass* ik = field_holder();
|
||||
ik->field(index())->set_access_flags(_access_flags.as_short());
|
||||
}
|
||||
|
||||
inline void fieldDescriptor::set_is_field_access_watched(const bool value) {
|
||||
_access_flags.set_is_field_access_watched(value);
|
||||
update_klass_field_access_flag();
|
||||
}
|
||||
|
||||
inline void fieldDescriptor::set_is_field_modification_watched(const bool value) {
|
||||
_access_flags.set_is_field_modification_watched(value);
|
||||
update_klass_field_access_flag();
|
||||
}
|
||||
|
||||
inline void fieldDescriptor::set_has_initialized_final_update(const bool value) {
|
||||
_access_flags.set_has_field_initialized_final_update(value);
|
||||
update_klass_field_access_flag();
|
||||
}
|
||||
|
||||
inline BasicType fieldDescriptor::field_type() const {
|
||||
return FieldType::basic_type(signature());
|
||||
}
|
||||
|
||||
#endif // SHARE_VM_RUNTIME_FIELDDESCRIPTOR_INLINE_HPP
|
|
@ -43,6 +43,7 @@
|
|||
#include "oops/typeArrayOop.inline.hpp"
|
||||
#include "prims/jvmtiExport.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/javaCalls.hpp"
|
||||
#include "runtime/reflection.hpp"
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/biasedLocking.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/flags/jvmFlagConstraintList.hpp"
|
||||
#include "runtime/flags/jvmFlagRangeList.hpp"
|
||||
#include "runtime/flags/jvmFlagWriteableList.hpp"
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "oops/objArrayOop.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/typeArrayOop.inline.hpp"
|
||||
#include "runtime/fieldDescriptor.inline.hpp"
|
||||
#include "runtime/flags/jvmFlag.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/javaCalls.hpp"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue