src/share/vm/ci/ciInstanceKlass.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
valhalla-experimental Cdiff src/share/vm/ci/ciInstanceKlass.cpp
src/share/vm/ci/ciInstanceKlass.cpp
Print this page
*** 57,67 ****
_init_state = ik->init_state();
_nonstatic_field_size = ik->nonstatic_field_size();
_has_nonstatic_fields = ik->has_nonstatic_fields();
_has_default_methods = ik->has_default_methods();
_is_anonymous = ik->is_anonymous();
! _nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields:
_has_injected_fields = -1;
_implementor = NULL; // we will fill these lazily
Thread *thread = Thread::current();
if (ciObjectFactory::is_initialized()) {
--- 57,68 ----
_init_state = ik->init_state();
_nonstatic_field_size = ik->nonstatic_field_size();
_has_nonstatic_fields = ik->has_nonstatic_fields();
_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;
_implementor = NULL; // we will fill these lazily
Thread *thread = Thread::current();
if (ciObjectFactory::is_initialized()) {
*** 98,108 ****
{
assert(name->byte_at(0) != '[', "not an instance klass");
_init_state = (InstanceKlass::ClassState)0;
_nonstatic_field_size = -1;
_has_nonstatic_fields = false;
! _nonstatic_fields = NULL;
_has_injected_fields = -1;
_is_anonymous = false;
_loader = loader;
_protection_domain = protection_domain;
_is_shared = false;
--- 99,110 ----
{
assert(name->byte_at(0) != '[', "not an instance klass");
_init_state = (InstanceKlass::ClassState)0;
_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;
_is_anonymous = false;
_loader = loader;
_protection_domain = protection_domain;
_is_shared = false;
*** 448,457 ****
--- 450,460 ----
return _nonstatic_fields->length();
if (!has_nonstatic_fields()) {
Arena* arena = CURRENT_ENV->arena();
_nonstatic_fields = new (arena) GrowableArray<ciField*>(arena, 0, 0, NULL);
+ _nof_declared_nonstatic_fields = 0;
return 0;
}
assert(!is_java_lang_Object(), "bootstrap OK");
// Size in bytes of my fields, including inherited fields.
*** 465,474 ****
--- 468,478 ----
super_fields = super->_nonstatic_fields;
assert(super_flen == 0 || super_fields != NULL, "first get nof_fields");
// See if I am no larger than my super; if so, I can use his fields.
if (fsize == super_fsize) {
_nonstatic_fields = super_fields;
+ _nof_declared_nonstatic_fields = super->nof_declared_nonstatic_fields();
return super_fields->length();
}
}
GrowableArray<ciField*>* fields = NULL;
*** 478,489 ****
--- 482,495 ----
if (fields == NULL) {
// This can happen if this class (java.lang.Class) has invisible fields.
if (super_fields != NULL) {
_nonstatic_fields = super_fields;
+ _nof_declared_nonstatic_fields = super->nof_declared_nonstatic_fields();
return super_fields->length();
} else {
+ _nof_declared_nonstatic_fields = 0;
return 0;
}
}
int flen = fields->length();
*** 508,522 ****
--- 514,532 ----
flen += 1;
}
// allocate the array:
if (flen == 0) {
+ _nof_declared_nonstatic_fields = flen;
return NULL; // return nothing if none are locally declared
}
+
if (super_fields != NULL) {
flen += super_fields->length();
}
+ _nof_declared_nonstatic_fields = flen;
+
fields = new (arena) GrowableArray<ciField*>(arena, flen, 0, NULL);
if (super_fields != NULL) {
fields->appendAll(super_fields);
}
src/share/vm/ci/ciInstanceKlass.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File