src/share/vm/classfile/javaClasses.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/classfile/javaClasses.cpp Tue Mar 8 20:17:54 2011
--- new/src/share/vm/classfile/javaClasses.cpp Tue Mar 8 20:17:54 2011
*** 429,442 ****
--- 429,439 ----
fields->short_at_put(fd->index() + instanceKlass::high_offset, extract_high_short_from_int(real_offset));
}
}
oop java_lang_Class::fixup_mirror(KlassHandle k, TRAPS) {
// Cache the start of the static fields
if (instanceMirrorKlass::offset_of_static_fields() == 0) {
instanceMirrorKlass::set_offset_of_static_fields(instanceMirrorKlass::cast(SystemDictionary::Class_klass())->size_helper() << LogHeapWordSize);
}
+ assert(instanceMirrorKlass::offset_of_static_fields() != 0, "must have been computed already");
if (k->oop_is_instance()) {
// Fixup the offsets
instanceKlass::cast(k())->do_local_static_fields(&fixup_static_field, CHECK_NULL);
}
*** 451,461 ****
--- 448,458 ----
// class is put into the system dictionary.
int computed_modifiers = k->compute_modifier_flags(CHECK_0);
k->set_modifier_flags(computed_modifiers);
if (SystemDictionary::Class_klass_loaded() && (k->oop_is_instance() || k->oop_is_javaArray())) {
// Allocate mirror (java.lang.Class instance)
! Handle mirror = instanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_permanent_instance(k, CHECK_0);
! Handle mirror = instanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_instance(k, CHECK_0);
// Setup indirections
mirror->obj_field_put(klass_offset, k());
k->set_java_mirror(mirror());
instanceMirrorKlass* mk = instanceMirrorKlass::cast(mirror->klass());
*** 496,524 ****
--- 493,525 ----
}
int java_lang_Class::oop_size(oop java_class) {
+ assert(oop_size_offset != 0, "must be set");
return java_class->int_field(oop_size_offset);
}
void java_lang_Class::set_oop_size(oop java_class, int size) {
+ assert(oop_size_offset != 0, "must be set");
java_class->int_field_put(oop_size_offset, size);
}
int java_lang_Class::static_oop_field_size(oop java_class) {
+ assert(static_oop_field_size_offset != 0, "must be set");
return java_class->int_field(static_oop_field_size_offset);
}
void java_lang_Class::set_static_oop_field_size(oop java_class, int size) {
+ assert(static_oop_field_size_offset != 0, "must be set");
java_class->int_field_put(static_oop_field_size_offset, size);
}
oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS) {
// This should be improved by adding a field at the Java level or by
// introducing a new VM klass (see comment in ClassFileParser)
! oop java_class = instanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_permanent_instance((oop)NULL, CHECK_0);
! oop java_class = instanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_instance((oop)NULL, CHECK_0);
if (type != T_VOID) {
klassOop aklass = Universe::typeArrayKlassObj(type);
assert(aklass != NULL, "correct bootstrap");
set_array_klass(java_class, aklass);
}
*** 2905,2918 ****
--- 2906,2928 ----
java_lang_String::value_offset = java_lang_String::hc_value_offset * x + header;
java_lang_String::offset_offset = java_lang_String::hc_offset_offset * x + header;
java_lang_String::count_offset = java_lang_String::offset_offset + sizeof (jint);
java_lang_String::hash_offset = java_lang_String::count_offset + sizeof (jint);
+ {
// Do the Class Class
! java_lang_Class::klass_offset = java_lang_Class::hc_klass_offset * x + header;
! java_lang_Class::array_klass_offset = java_lang_Class::hc_array_klass_offset * x + header;
! java_lang_Class::resolved_constructor_offset = java_lang_Class::hc_resolved_constructor_offset * x + header;
! int offset = header;
! java_lang_Class::oop_size_offset = header;
! offset += BytesPerInt;
+ java_lang_Class::static_oop_field_size_offset = offset;
+ offset = align_size_up(offset + BytesPerInt, x);
+ java_lang_Class::klass_offset = offset;
+ offset += x;
+ java_lang_Class::array_klass_offset = offset;
+ offset += x;
+ java_lang_Class::resolved_constructor_offset = offset;
+ }
// This is NOT an offset
java_lang_Class::number_of_fake_oop_fields = java_lang_Class::hc_number_of_fake_oop_fields;
// Throwable Class
src/share/vm/classfile/javaClasses.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File