< prev index next >
src/hotspot/share/classfile/javaClasses.cpp
Print this page
*** 48,57 ****
--- 48,58 ----
#include "oops/method.inline.hpp"
#include "oops/objArrayOop.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "oops/typeArrayOop.inline.hpp"
+ #include "prims/jvmtiEnvBase.hpp"
#include "prims/resolvedMethodTable.hpp"
#include "runtime/fieldDescriptor.inline.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/interfaceSupport.inline.hpp"
*** 123,133 ****
bool is_static = false) {
fieldDescriptor fd;
if (ik == NULL) {
ResourceMark rm;
log_error(class)("Mismatch JDK version for field: %s type: %s", name_symbol->as_C_string(), signature_symbol->as_C_string());
! vm_exit_during_initialization("Invalid layout of preloaded class");
}
if (!ik->find_local_field(name_symbol, signature_symbol, &fd) || fd.is_static() != is_static) {
ResourceMark rm;
log_error(class)("Invalid layout of %s field: %s type: %s", ik->external_name(),
--- 124,134 ----
bool is_static = false) {
fieldDescriptor fd;
if (ik == NULL) {
ResourceMark rm;
log_error(class)("Mismatch JDK version for field: %s type: %s", name_symbol->as_C_string(), signature_symbol->as_C_string());
! vm_exit_during_initialization("Invalid layout of well-known class");
}
if (!ik->find_local_field(name_symbol, signature_symbol, &fd) || fd.is_static() != is_static) {
ResourceMark rm;
log_error(class)("Invalid layout of %s field: %s type: %s", ik->external_name(),
*** 136,146 ****
// Prints all fields and offsets
Log(class) lt;
LogStream ls(lt.error());
ik->print_on(&ls);
#endif //PRODUCT
! vm_exit_during_initialization("Invalid layout of preloaded class: use -Xlog:class+load=info to see the origin of the problem class");
}
dest_offset = fd.offset();
}
// Overloading to pass name as a string.
--- 137,147 ----
// Prints all fields and offsets
Log(class) lt;
LogStream ls(lt.error());
ik->print_on(&ls);
#endif //PRODUCT
! vm_exit_during_initialization("Invalid layout of well-known class: use -Xlog:class+load=info to see the origin of the problem class");
}
dest_offset = fd.offset();
}
// Overloading to pass name as a string.
*** 149,159 ****
bool is_static = false) {
TempNewSymbol name = SymbolTable::probe(name_string, (int)strlen(name_string));
if (name == NULL) {
ResourceMark rm;
log_error(class)("Name %s should be in the SymbolTable since its class is loaded", name_string);
! vm_exit_during_initialization("Invalid layout of preloaded class", ik->external_name());
}
compute_offset(dest_offset, ik, name, signature_symbol, is_static);
}
int java_lang_String::value_offset = 0;
--- 150,160 ----
bool is_static = false) {
TempNewSymbol name = SymbolTable::probe(name_string, (int)strlen(name_string));
if (name == NULL) {
ResourceMark rm;
log_error(class)("Name %s should be in the SymbolTable since its class is loaded", name_string);
! vm_exit_during_initialization("Invalid layout of well-known class", ik->external_name());
}
compute_offset(dest_offset, ik, name, signature_symbol, is_static);
}
int java_lang_String::value_offset = 0;
*** 1194,1204 ****
// shared klass' _has_raw_archived_mirror flag is cleared.
bool java_lang_Class::restore_archived_mirror(Klass *k,
Handle class_loader, Handle module,
Handle protection_domain, TRAPS) {
// Postpone restoring archived mirror until java.lang.Class is loaded. Please
! // see more details in SystemDictionary::resolve_preloaded_classes().
if (!SystemDictionary::Class_klass_loaded()) {
assert(fixup_mirror_list() != NULL, "fixup_mirror_list not initialized");
fixup_mirror_list()->push(k);
return true;
}
--- 1195,1205 ----
// shared klass' _has_raw_archived_mirror flag is cleared.
bool java_lang_Class::restore_archived_mirror(Klass *k,
Handle class_loader, Handle module,
Handle protection_domain, TRAPS) {
// Postpone restoring archived mirror until java.lang.Class is loaded. Please
! // see more details in SystemDictionary::resolve_well_known_classes().
if (!SystemDictionary::Class_klass_loaded()) {
assert(fixup_mirror_list() != NULL, "fixup_mirror_list not initialized");
fixup_mirror_list()->push(k);
return true;
}
*** 4248,4263 ****
#define DO_COMPUTE_OFFSETS(k) k::compute_offsets();
// Compute non-hard-coded field offsets of all the classes in this file
void JavaClasses::compute_offsets() {
if (UseSharedSpaces) {
return; // field offsets are loaded from archive
}
// We have already called the compute_offsets() of the
// BASIC_JAVA_CLASSES_DO_PART1 classes (java_lang_String and java_lang_Class)
! // earlier inside SystemDictionary::resolve_preloaded_classes()
BASIC_JAVA_CLASSES_DO_PART2(DO_COMPUTE_OFFSETS);
// generated interpreter code wants to know about the offsets we just computed:
AbstractAssembler::update_delayed_values();
}
--- 4249,4266 ----
#define DO_COMPUTE_OFFSETS(k) k::compute_offsets();
// Compute non-hard-coded field offsets of all the classes in this file
void JavaClasses::compute_offsets() {
if (UseSharedSpaces) {
+ assert(JvmtiEnvBase::get_phase() <= JVMTI_PHASE_PRIMORDIAL,
+ "Field offsets of well-known classes must be computed in JVMTI_PHASE_PRIMORDIAL or before");
return; // field offsets are loaded from archive
}
// We have already called the compute_offsets() of the
// BASIC_JAVA_CLASSES_DO_PART1 classes (java_lang_String and java_lang_Class)
! // earlier inside SystemDictionary::resolve_well_known_classes()
BASIC_JAVA_CLASSES_DO_PART2(DO_COMPUTE_OFFSETS);
// generated interpreter code wants to know about the offsets we just computed:
AbstractAssembler::update_delayed_values();
}
*** 4354,4364 ****
tty->print_cr("all fields:");
for (AllFieldStream fs(ik); !fs.done(); fs.next()) {
tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int());
}
#endif //PRODUCT
! vm_exit_during_initialization("Invalid layout of preloaded class: use -Xlog:class+load=info to see the origin of the problem class");
return -1;
}
void javaClasses_init() {
JavaClasses::compute_offsets();
--- 4357,4367 ----
tty->print_cr("all fields:");
for (AllFieldStream fs(ik); !fs.done(); fs.next()) {
tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int());
}
#endif //PRODUCT
! vm_exit_during_initialization("Invalid layout of well-known class: use -Xlog:class+load=info to see the origin of the problem class");
return -1;
}
void javaClasses_init() {
JavaClasses::compute_offsets();
< prev index next >