< prev index next > src/hotspot/share/ci/ciInstanceKlass.cpp
Print this page
// Loaded instance klass.
ciInstanceKlass::ciInstanceKlass(Klass* k) :
ciKlass(k)
{
assert(get_Klass()->is_instance_klass(), "wrong type");
! assert(get_instanceKlass()->is_loaded(), "must be at least loaded");
InstanceKlass* ik = get_instanceKlass();
AccessFlags access_flags = ik->access_flags();
_flags = ciFlags(access_flags);
_has_finalizer = ik->has_finalizer();
_has_subklass = flags().is_final() ? subklass_false : subklass_unknown;
! _init_state = ik->init_state();
_has_nonstatic_fields = ik->has_nonstatic_fields();
_has_nonstatic_concrete_methods = ik->has_nonstatic_concrete_methods();
_is_hidden = ik->is_hidden();
_is_record = ik->is_record();
_nonstatic_fields = nullptr; // initialized lazily by compute_nonstatic_fields:
// Loaded instance klass.
ciInstanceKlass::ciInstanceKlass(Klass* k) :
ciKlass(k)
{
assert(get_Klass()->is_instance_klass(), "wrong type");
!
InstanceKlass* ik = get_instanceKlass();
+ #ifdef ASSERT
+ if (!ik->is_loaded()) {
+ ResourceMark rm;
+ ik->print_on(tty);
+ assert(false, "must be at least loaded: %s", ik->name()->as_C_string());
+ }
+ #endif // ASSERT
+
AccessFlags access_flags = ik->access_flags();
_flags = ciFlags(access_flags);
_has_finalizer = ik->has_finalizer();
_has_subklass = flags().is_final() ? subklass_false : subklass_unknown;
! _init_state = compute_init_state(ik); // _init_state
_has_nonstatic_fields = ik->has_nonstatic_fields();
_has_nonstatic_concrete_methods = ik->has_nonstatic_concrete_methods();
_is_hidden = ik->is_hidden();
_is_record = ik->is_record();
_nonstatic_fields = nullptr; // initialized lazily by compute_nonstatic_fields:
// ------------------------------------------------------------------
// ciInstanceKlass::compute_shared_is_initialized
void ciInstanceKlass::compute_shared_init_state() {
GUARDED_VM_ENTRY(
InstanceKlass* ik = get_instanceKlass();
! _init_state = ik->init_state();
)
}
// ------------------------------------------------------------------
// ciInstanceKlass::compute_shared_has_subklass
bool ciInstanceKlass::compute_shared_has_subklass() {
GUARDED_VM_ENTRY(
InstanceKlass* ik = get_instanceKlass();
// ------------------------------------------------------------------
// ciInstanceKlass::compute_shared_is_initialized
void ciInstanceKlass::compute_shared_init_state() {
GUARDED_VM_ENTRY(
InstanceKlass* ik = get_instanceKlass();
! _init_state = compute_init_state(ik);
)
}
+ InstanceKlass::ClassState ciInstanceKlass::compute_init_state(InstanceKlass* ik) {
+ ASSERT_IN_VM;
+ ciEnv* env = CURRENT_ENV;
+ if (env != nullptr && env->is_precompiled()) {
+ return env->compute_init_state_for_precompiled(ik);
+ } else {
+ return ik->init_state();
+ }
+ }
+
// ------------------------------------------------------------------
// ciInstanceKlass::compute_shared_has_subklass
bool ciInstanceKlass::compute_shared_has_subklass() {
GUARDED_VM_ENTRY(
InstanceKlass* ik = get_instanceKlass();
bool_to_str(is_initialized()),
bool_to_str(has_finalizer()),
bool_to_str(has_subklass()),
layout_helper());
! _flags.print_klass_flags();
if (_super) {
st->print(" super=");
! _super->print_name();
}
if (_java_mirror) {
st->print(" mirror=PRESENT");
}
}
bool_to_str(is_initialized()),
bool_to_str(has_finalizer()),
bool_to_str(has_subklass()),
layout_helper());
! _flags.print_klass_flags(st);
if (_super) {
st->print(" super=");
! _super->print_name_on(st);
}
if (_java_mirror) {
st->print(" mirror=PRESENT");
}
}
< prev index next >