< prev index next >

src/hotspot/share/oops/instanceKlass.hpp

Print this page

        

*** 27,36 **** --- 27,37 ---- #include "classfile/classLoader.hpp" #include "classfile/classLoaderData.hpp" #include "classfile/moduleEntry.hpp" #include "classfile/packageEntry.hpp" + #include "code/vmreg.hpp" #include "gc/shared/specialized_oop_closures.hpp" #include "memory/referenceType.hpp" #include "oops/annotations.hpp" #include "oops/constMethod.hpp" #include "oops/fieldInfo.hpp"
*** 52,61 **** --- 53,63 ---- // The embedded nonstatic oop-map blocks are short pairs (offset, length) // indicating where oops are located in instances of this klass. // [EMBEDDED implementor of the interface] only exist for interface // [EMBEDDED host klass ] only exist for an anonymous class (JSR 292 enabled) // [EMBEDDED fingerprint ] only if should_store_fingerprint()==true + // [EMBEDDED ValueKlassFixedBlock] only if is a ValueKlass instance // forward declaration for class -- see below for definition #if INCLUDE_JVMTI class BreakpointInfo;
*** 127,136 **** --- 129,150 ---- uint _count; }; struct JvmtiCachedClassFileData; + class SigEntry; + + class ValueKlassFixedBlock VALUE_OBJ_CLASS_SPEC { + Array<SigEntry>** _extended_sig; + Array<VMRegPair>** _return_regs; + address* _pack_handler; + address* _unpack_handler; + int* _default_value_offset; + + friend class ValueKlass; + }; + class InstanceKlass: public Klass { friend class VMStructs; friend class JVMCIVMStructs; friend class ClassFileParser; friend class CompileReplay;
*** 213,225 **** public: enum { _extra_is_being_redefined = 1 << 0, // used for locking redefinition _extra_has_resolved_methods = 1 << 1, // resolved methods table entries added for this class _extra_has_value_fields = 1 << 2, // has value fields and related embedded section is not empty ! _extra_is_bufferable = 1 << 3, // value can be buffered out side of the Java heap ! _extra_has_vcc_klass = 1 << 4, // has a pointer to its Value Capable Class (MVT) ! _extra_has_vcc_annotation = 1 << 5 }; protected: u1 _extra_flags; --- 227,237 ---- public: enum { _extra_is_being_redefined = 1 << 0, // used for locking redefinition _extra_has_resolved_methods = 1 << 1, // resolved methods table entries added for this class _extra_has_value_fields = 1 << 2, // has value fields and related embedded section is not empty ! _extra_is_bufferable = 1 << 3 // value can be buffered out side of the Java heap }; protected: u1 _extra_flags;
*** 337,346 **** --- 349,360 ---- // named, or a previously loaded anonymous class. A non-anonymous class // or an anonymous class loaded through normal classloading does not // have this embedded field. // + ValueKlassFixedBlock* _adr_valueklass_fixed_block; + friend class SystemDictionary; public: u2 loader_type() { return _misc_flags & loader_type_bits();
*** 389,413 **** } void set_has_value_fields() { _extra_flags |= _extra_has_value_fields; } - bool has_vcc_klass() const { - return (_extra_flags & _extra_has_vcc_klass) != 0; - } - void set_has_vcc_klass() { - _extra_flags |= _extra_has_vcc_klass; - } - - bool has_vcc_annotation() const { - return (_extra_flags &_extra_has_vcc_annotation) != 0; - } - - void set_has_vcc_annotation() { - _extra_flags |= _extra_has_vcc_annotation; - } - // field sizes int nonstatic_field_size() const { return _nonstatic_field_size; } void set_nonstatic_field_size(int size) { _nonstatic_field_size = size; } int static_field_size() const { return _static_field_size; } --- 403,412 ----
*** 1115,1135 **** static int size(int vtable_length, int itable_length, int nonstatic_oop_map_size, bool is_interface, bool is_anonymous, bool has_stored_fingerprint, int java_fields, bool is_value_type) { return align_metadata_size(header_size() + - (is_value_type ? (int)sizeof(address) : 0) + - (is_value_type ? (int)sizeof(address) : 0) + vtable_length + itable_length + nonstatic_oop_map_size + (is_interface ? (int)sizeof(Klass*)/wordSize : 0) + (is_anonymous ? (int)sizeof(Klass*)/wordSize : 0) + (has_stored_fingerprint ? (int)sizeof(uint64_t*)/wordSize : 0) + (java_fields * (int)sizeof(Klass*)/wordSize) + ! (is_value_type ? (int)sizeof(Klass*) : 0) + ! (is_value_type ? (int)sizeof(intptr_t)*3 : 0)); } int size() const { return size(vtable_length(), itable_length(), nonstatic_oop_map_size(), is_interface(), --- 1114,1131 ---- static int size(int vtable_length, int itable_length, int nonstatic_oop_map_size, bool is_interface, bool is_anonymous, bool has_stored_fingerprint, int java_fields, bool is_value_type) { return align_metadata_size(header_size() + vtable_length + itable_length + nonstatic_oop_map_size + (is_interface ? (int)sizeof(Klass*)/wordSize : 0) + (is_anonymous ? (int)sizeof(Klass*)/wordSize : 0) + (has_stored_fingerprint ? (int)sizeof(uint64_t*)/wordSize : 0) + (java_fields * (int)sizeof(Klass*)/wordSize) + ! (is_value_type ? (int)sizeof(struct ValueKlassFixedBlock) : 0)); } int size() const { return size(vtable_length(), itable_length(), nonstatic_oop_map_size(), is_interface(),
*** 1140,1150 **** } #if INCLUDE_SERVICES virtual void collect_statistics(KlassSizeStats *sz) const; #endif ! intptr_t* start_of_itable() const { return (intptr_t*)start_of_vtable() + (is_value() ? 3 : 0 ) + vtable_length(); } intptr_t* end_of_itable() const { return start_of_itable() + itable_length(); } int itable_offset_in_words() const { return start_of_itable() - (intptr_t*)this; } address static_field_addr(int offset); --- 1136,1146 ---- } #if INCLUDE_SERVICES virtual void collect_statistics(KlassSizeStats *sz) const; #endif ! intptr_t* start_of_itable() const { return (intptr_t*)start_of_vtable() + vtable_length(); } intptr_t* end_of_itable() const { return start_of_itable() + itable_length(); } int itable_offset_in_words() const { return start_of_itable() - (intptr_t*)this; } address static_field_addr(int offset);
*** 1220,1257 **** } else { return NULL; } } - address adr_vcc_klass() const { - if (has_vcc_klass()) { - address adr_jf = adr_value_fields_klasses(); - if (adr_jf != NULL) { - return adr_jf + this->java_fields_count() * sizeof(Klass*); - } - - address adr_fing = adr_fingerprint(); - if (adr_fing != NULL) { - return adr_fingerprint() + sizeof(u8); - } - - InstanceKlass** adr_host = adr_host_klass(); - if (adr_host != NULL) { - return (address)(adr_host + 1); - } - - Klass** adr_impl = adr_implementor(); - if (adr_impl != NULL) { - return (address)(adr_impl + 1); - } - - return (address)end_of_nonstatic_oop_maps(); - } else { - return NULL; - } - } - Klass* get_value_field_klass(int idx) const { assert(has_value_fields(), "Sanity checking"); Klass* k = ((Klass**)adr_value_fields_klasses())[idx]; assert(k != NULL, "Should always be set before being read"); assert(k->is_value(), "Must be a value type"); --- 1216,1225 ----
*** 1270,1294 **** assert(k != NULL, "Should not be set to NULL"); assert(((Klass**)adr_value_fields_klasses())[idx] == NULL, "Should not be set twice"); ((Klass**)adr_value_fields_klasses())[idx] = k; } - Klass* get_vcc_klass() const { - if (has_vcc_klass()) { - Klass* k = *(Klass**)adr_vcc_klass(); - assert(k == NULL || !k->is_value(), "Must not be a value type"); - return k; - } - return NULL; - } - - void set_vcc_klass(Klass* k) { - assert(has_vcc_klass(), "Sanity checking"); - assert(k == NULL || !k->is_value(), "Must not be a value type"); - *(Klass**)adr_vcc_klass()= k; - } - // Use this to return the size of an instance in heap words: virtual int size_helper() const { return layout_helper_to_size_helper(layout_helper()); } --- 1238,1247 ----
*** 1513,1525 **** virtual void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS); // jvm support jint compute_modifier_flags(TRAPS) const; - //Valhalla prototype ValueCapableClass - void create_value_capable_class(Handle class_loader, Handle protection_domain, TRAPS); - public: // JVMTI support jint jvmti_class_status() const; virtual void metaspace_pointers_do(MetaspaceClosure* iter); --- 1466,1475 ----
< prev index next >