src/share/vm/ci/ciInstanceKlass.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/ci/ciInstanceKlass.cpp Mon Apr 3 11:13:29 2017
--- new/src/share/vm/ci/ciInstanceKlass.cpp Mon Apr 3 11:13:29 2017
*** 62,71 ****
--- 62,73 ----
_has_default_methods = ik->has_default_methods();
_is_anonymous = ik->is_anonymous();
_nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields
_nof_declared_nonstatic_fields = -1; // initialized lazily by compute_nonstatic_fields
_has_injected_fields = -1;
+ _has_derive_value_type = ik->is_derive_value_type() ? true : false;
+ _derive_value_type = NULL;
_implementor = NULL; // we will fill these lazily
Thread *thread = Thread::current();
if (ciObjectFactory::is_initialized()) {
_loader = JNIHandles::make_local(thread, ik->class_loader());
*** 104,113 ****
--- 106,120 ----
_nonstatic_field_size = -1;
_has_nonstatic_fields = false;
_nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields
_nof_declared_nonstatic_fields = -1; // initialized lazily by compute_nonstatic_fields
_has_injected_fields = -1;
+ _has_derive_value_type = false; // When the class is loaded, the system checks if the loaded class
+ // has a derived value type (and sets the flag accordingly).
+ // TODO: Check if updating flag works properly (e.g., also in
+ // scenarios with concurrent accesses).
+ _derive_value_type = NULL;
_is_anonymous = false;
_loader = loader;
_protection_domain = protection_domain;
_is_shared = false;
_super = NULL;
*** 121,130 ****
--- 128,142 ----
// ciInstanceKlass::compute_shared_is_initialized
void ciInstanceKlass::compute_shared_init_state() {
GUARDED_VM_ENTRY(
InstanceKlass* ik = get_instanceKlass();
_init_state = ik->init_state();
+ if (ik->is_derive_value_type()) {
+ // When the class is loaded, the system checks if the loaded class
+ // has a derived value type (and sets the flag accordingly).
+ _has_derive_value_type = true;
+ }
)
}
// ------------------------------------------------------------------
// ciInstanceKlass::compute_shared_has_subklass
*** 646,655 ****
--- 658,682 ----
}
}
return impl;
}
+ ciInstanceKlass* ciInstanceKlass::derive_value_type() {
+ if (_has_derive_value_type) {
+ // The _had_derive_value_type flag is updated when the class is loaded. Then,
+ // the derived value type is also linked.
+ if (_derive_value_type == NULL) {
+ VM_ENTRY_MARK;
+ InstanceKlass* k = get_instanceKlass()->derive_value_type_klass();
+ _derive_value_type = CURRENT_THREAD_ENV->get_instance_klass(k);
+ }
+ return _derive_value_type;
+ } else {
+ return NULL;
+ }
+ }
+
// Utility class for printing of the contents of the static fields for
// use by compilation replay. It only prints out the information that
// could be consumed by the compiler, so for primitive types it prints
// out the actual value. For Strings it's the actual string value.
// For array types it it's first level array size since that's the
src/share/vm/ci/ciInstanceKlass.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File