/* * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
int _instructions_size; int _interpreter_invocation_count; int _interpreter_throwout_count; int _invocation_counter; int _backedge_counter;
} ciMethodRecord;
typedefstruct _ciInstanceKlassRecord { const InstanceKlass* _klass;
jobject _java_mirror; // Global handle to java mirror to prevent unloading
} ciInstanceKlassRecord;
char* parse_escaped_string() { char* result = parse_quoted_string(); if (result != NULL) {
unescape_string(result);
} return result;
}
// Look for the tag 'tag' followed by an bool parse_tag_and_count(constchar* tag, int& length) { constchar* t = parse_string(); if (t == NULL) { returnfalse;
}
// Parse a sequence of raw data encoded as bytes and return the // resulting data. char* parse_data(constchar* tag, int& length) { int read_size = 0; if (!parse_tag_and_count(tag, read_size)) { return NULL;
}
int actual_size = sizeof(MethodData::CompilerCounters); char *result = NEW_RESOURCE_ARRAY(char, actual_size); int i = 0; if (read_size != actual_size) {
tty->print_cr("Warning: ciMethodData parsing sees MethodData size %i in file, current is %i", read_size,
actual_size); // Replay serializes the entire MethodData, but the data is at the end. // If the MethodData instance size has changed, we can pad or truncate in the beginning int padding = actual_size - read_size; if (padding > 0) { // pad missing data with zeros
tty->print_cr("- Padding MethodData"); for (; i < padding; i++) {
result[i] = 0;
}
} elseif (padding < 0) { // drop some data
tty->print_cr("- Truncating MethodData"); for (int j = 0; j < -padding; j++) { int val = parse_int("data"); // discard val
}
}
}
assert(i < actual_size, "At least some data must remain to be copied"); for (; i < actual_size; i++) { int val = parse_int("data");
result[i] = val;
}
length = actual_size; return result;
}
// Parse a standard chunk of data emitted as: // 'tag' <length> # # ... // Where each # is an intptr_t item
intptr_t* parse_intptr_data(constchar* tag, int& length) { if (!parse_tag_and_count(tag, length)) { return NULL;
}
intptr_t* result = NEW_RESOURCE_ARRAY(intptr_t, length); for (int i = 0; i < length; i++) {
skip_ws();
intptr_t val = parse_intptr_t("data");
result[i] = val;
} return result;
}
// Parse a possibly quoted version of a symbol into a symbolOop
Symbol* parse_symbol() { constchar* str = parse_escaped_string(); if (str != NULL) {
Symbol* sym = SymbolTable::new_symbol(str); return sym;
} return NULL;
}
// Parse a special hidden klass location syntax // syntax: @bci <klass> <name> <signature> <bci> <location>* ; // syntax: @cpi <klass> <cpi> <location>* ;
Klass* parse_cp_ref(TRAPS) {
JavaThread* thread = THREAD;
oop obj = NULL; char* ref = parse_string(); if (strcmp(ref, "bci") == 0) {
Method* m = parse_method(CHECK_NULL); if (m == NULL) { return NULL;
}
InstanceKlass* ik = m->method_holder(); const constantPoolHandle cp(Thread::current(), ik->constants());
// invokedynamic or invokehandle
methodHandle caller(Thread::current(), m); int bci = parse_int("bci"); if (m->validate_bci(bci) != bci) {
report_error("bad bci"); return NULL;
}
ik->link_class(CHECK_NULL);
Bytecode_invoke bytecode = Bytecode_invoke_check(caller, bci); if (!Bytecodes::is_defined(bytecode.code()) || !bytecode.is_valid()) {
report_error("no invoke found at bci"); return NULL;
}
bytecode.verify(); int index = bytecode.index();
Klass* k = parse_klass(CHECK_NULL); if (k == NULL) { return NULL;
}
InstanceKlass* ik = InstanceKlass::cast(k); const constantPoolHandle cp(Thread::current(), ik->constants());
int cpi = parse_int("cpi");
if (cpi >= cp->length()) {
report_error("bad cpi"); return NULL;
} if (!cp->tag_at(cpi).is_method_handle()) {
report_error("no method handle found at cpi"); return NULL;
}
ik->link_class(CHECK_NULL);
obj = cp->resolve_possibly_cached_constant_at(cpi, CHECK_NULL);
} if (obj == NULL) {
report_error("null cp object found"); return NULL;
}
Klass* k = NULL;
skip_ws(); // loop: read fields char* field = NULL; do {
field = parse_string(); if (field == NULL) {
report_error("no field found"); return NULL;
} if (strcmp(field, ";") == 0) { break;
} // raw Method* if (strcmp(field, "") == 0) {
Method* vmtarget = java_lang_invoke_MemberName::vmtarget(obj);
k = (vmtarget == NULL) ? NULL : vmtarget->method_holder(); if (k == NULL) {
report_error("null vmtarget found"); return NULL;
} if (!parse_terminator()) {
report_error("missing terminator"); return NULL;
} return k;
}
obj = ciReplay::obj_field(obj, field); // array if (obj != NULL && obj->is_objArray()) {
objArrayOop arr = (objArrayOop)obj; int index = parse_int("index"); if (index >= arr->length()) {
report_error("bad array index"); return NULL;
}
obj = arr->obj_at(index);
}
} while (obj != NULL); if (obj == NULL) {
report_error("null field found"); return NULL;
}
k = obj->klass(); return k;
}
// Parse a valid klass name and look it up // syntax: <name> // syntax: <constant pool ref>
Klass* parse_klass(TRAPS) {
skip_ws(); // check for constant pool object reference (for a dynamic/hidden class) bool cp_ref = (*_bufptr == '@'); if (cp_ref) {
++_bufptr;
Klass* k = parse_cp_ref(CHECK_NULL); if (k != NULL && !k->is_hidden()) {
report_error("expected hidden class"); return NULL;
} return k;
} char* str = parse_escaped_string();
Symbol* klass_name = SymbolTable::new_symbol(str); if (klass_name != NULL) {
Klass* k = NULL; if (_iklass != NULL) {
k = (Klass*)_iklass->find_klass(ciSymbol::make(klass_name->as_C_string()))->constant_encoding();
} else {
k = SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, THREAD);
} if (HAS_PENDING_EXCEPTION) {
oop throwable = PENDING_EXCEPTION;
java_lang_Throwable::print(throwable, tty);
tty->cr();
report_error(str); if (ReplayIgnoreInitErrors) {
CLEAR_PENDING_EXCEPTION;
_error_message = NULL;
} return NULL;
} return k;
} return NULL;
}
// Lookup a klass
Klass* resolve_klass(constchar* klass, TRAPS) {
Symbol* klass_name = SymbolTable::new_symbol(klass); return SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, THREAD);
}
// Parse the standard tuple of <klass> <name> <signature>
Method* parse_method(TRAPS) {
InstanceKlass* k = (InstanceKlass*)parse_klass(CHECK_NULL); if (k == NULL) {
report_error("Can't find holder klass"); return NULL;
}
Symbol* method_name = parse_symbol();
Symbol* method_signature = parse_symbol();
Method* m = k->find_method(method_name, method_signature); if (m == NULL) {
report_error("Can't find method");
} return m;
}
int get_line(int c) { int buffer_pos = 0; while(c != EOF) { if (buffer_pos + 1 >= _buffer_length) { int new_length = _buffer_length * 2; // Next call will throw error in case of OOM.
_buffer = REALLOC_RESOURCE_ARRAY(char, _buffer, _buffer_length, new_length);
_buffer_length = new_length;
} if (c == '\n') {
c = getc(_stream); // get next char break;
} elseif (c == '\r') { // skip LF
} else {
_buffer[buffer_pos++] = c;
}
c = getc(_stream);
} // null terminate it, reset the pointer
_buffer[buffer_pos] = '\0'; // NL or EOF
_bufptr = _buffer; return c;
}
// Process each line of the replay file executing each command until // the file ends. void process(TRAPS) { int line_no = 1; int c = getc(_stream); while(c != EOF) {
c = get_line(c);
process_command(THREAD); if (had_error()) { int pos = _bufptr - _buffer + 1;
tty->print_cr("Error while parsing line %d at position %d: %s\n", line_no, pos, _error_message); if (ReplayIgnoreInitErrors) {
CLEAR_PENDING_EXCEPTION;
_error_message = NULL;
} else { return;
}
}
line_no++;
}
reset();
}
// ciMethodData <klass> <name> <signature> <state> <invocation_counter> orig <length> <byte>* data <length> <ptr>* oops <length> (<offset> <klass>)* methods <length> (<offset> <klass> <name> <signature>)* void process_ciMethodData(TRAPS) {
Method* method = parse_method(CHECK); if (had_error()) return; /* just copied from Method, to build interpret data*/
// To be properly initialized, some profiling in the MDO needs the // method to be rewritten (number of arguments at a call for instance)
method->method_holder()->link_class(CHECK);
assert(method->method_data() == NULL, "Should only be initialized once");
ClassLoaderData* loader_data = method->method_holder()->class_loader_data();
MethodData* method_data = MethodData::allocate(loader_data, methodHandle(THREAD, method), CHECK);
method->set_method_data(method_data);
// collect and record all the needed information for later
ciMethodDataRecord* rec = new_ciMethodData(method);
rec->_state = parse_int("state"); if (_version < 1) {
parse_int("current_mileage");
} else {
rec->_invocation_counter = parse_int("invocation_counter");
}
rec->_orig_data = parse_data("orig", rec->_orig_data_length); if (rec->_orig_data == NULL) { return;
}
rec->_data = parse_intptr_data("data", rec->_data_length); if (rec->_data == NULL) { return;
} if (!parse_tag_and_count("oops", rec->_classes_length)) { return;
}
rec->_classes = NEW_RESOURCE_ARRAY(Klass*, rec->_classes_length);
rec->_classes_offsets = NEW_RESOURCE_ARRAY(int, rec->_classes_length); for (int i = 0; i < rec->_classes_length; i++) { int offset = parse_int("offset"); if (had_error()) { return;
}
Klass* k = parse_klass(CHECK);
rec->_classes_offsets[i] = offset;
rec->_classes[i] = k;
}
if (!parse_tag_and_count("methods", rec->_methods_length)) { return;
}
rec->_methods = NEW_RESOURCE_ARRAY(Method*, rec->_methods_length);
rec->_methods_offsets = NEW_RESOURCE_ARRAY(int, rec->_methods_length); for (int i = 0; i < rec->_methods_length; i++) { int offset = parse_int("offset"); if (had_error()) { return;
}
Method* m = parse_method(CHECK);
rec->_methods_offsets[i] = offset;
rec->_methods[i] = m;
}
}
// instanceKlass <name> // instanceKlass <constant pool ref> # <original hidden class name> // // Loads and initializes the klass 'name'. This can be used to // create particular class loading environments void process_instanceKlass(TRAPS) { // just load the referenced class
Klass* k = parse_klass(CHECK);
if (_version >= 1) { if (!_protection_domain_initialized && k != NULL) {
assert(_protection_domain() == NULL, "must be uninitialized"); // The first entry is the holder class of the method for which a replay compilation is requested. // Use the same protection domain to load all subsequent classes in order to resolve all classes // in signatures of inlinees. This ensures that inlining can be done as stated in the replay file.
_protection_domain = Handle(_thread, k->protection_domain());
}
_protection_domain_initialized = true;
}
if (k == NULL) { return;
} constchar* comment = parse_string(); bool is_comment = comment != NULL && strcmp(comment, "#") == 0; if (k->is_hidden() != is_comment) {
report_error("hidden class with comment expected"); return;
} // comment, print or ignore if (is_comment) { if (Verbose) { constchar* hidden = parse_string();
tty->print_cr("Found %s for %s", k->name()->as_quoted_ascii(), hidden);
}
skip_remaining();
}
}
// ciInstanceKlass <name> <is_linked> <is_initialized> <length> tag* // // Load the klass 'name' and link or initialize it. Verify that the // constant pool is the same length as 'length' and make sure the // constant pool tags are in the same state. void process_ciInstanceKlass(TRAPS) {
InstanceKlass* k = (InstanceKlass*)parse_klass(CHECK); if (k == NULL) {
skip_remaining(); return;
} int is_linked = parse_int("is_linked"); int is_initialized = parse_int("is_initialized"); int length = parse_int("length"); if (is_initialized) {
k->initialize(THREAD); if (HAS_PENDING_EXCEPTION) {
oop throwable = PENDING_EXCEPTION;
java_lang_Throwable::print(throwable, tty);
tty->cr(); if (ReplayIgnoreInitErrors) {
CLEAR_PENDING_EXCEPTION;
k->set_init_state(InstanceKlass::fully_initialized);
} else { return;
}
}
} elseif (is_linked) {
k->link_class(CHECK);
}
new_ciInstanceKlass(k);
ConstantPool* cp = k->constants(); if (length != cp->length()) {
report_error("constant pool length mismatch: wrong class files?"); return;
}
int parsed_two_word = 0; for (int i = 1; i < length; i++) { int tag = parse_int("tag"); if (had_error()) { return;
} switch (cp->tag_at(i).value()) { case JVM_CONSTANT_UnresolvedClass: { if (tag == JVM_CONSTANT_Class) {
tty->print_cr("Resolving klass %s at %d", cp->klass_name_at(i)->as_utf8(), i);
Klass* k = cp->klass_at(i, CHECK);
} break;
} case JVM_CONSTANT_Long: case JVM_CONSTANT_Double:
parsed_two_word = i + 1;
case JVM_CONSTANT_ClassIndex: case JVM_CONSTANT_StringIndex: case JVM_CONSTANT_String: case JVM_CONSTANT_UnresolvedClassInError: case JVM_CONSTANT_Fieldref: case JVM_CONSTANT_Methodref: case JVM_CONSTANT_InterfaceMethodref: case JVM_CONSTANT_NameAndType: case JVM_CONSTANT_Utf8: case JVM_CONSTANT_Integer: case JVM_CONSTANT_Float: case JVM_CONSTANT_MethodHandle: case JVM_CONSTANT_MethodType: case JVM_CONSTANT_Dynamic: case JVM_CONSTANT_InvokeDynamic: if (tag != cp->tag_at(i).value()) {
report_error("tag mismatch: wrong class files?"); return;
} break;
case JVM_CONSTANT_Class: if (tag == JVM_CONSTANT_UnresolvedClass) {
Klass* k = cp->klass_at(i, CHECK);
tty->print_cr("Warning: entry was unresolved in the replay data: %s", k->name()->as_utf8());
} elseif (tag != JVM_CONSTANT_Class) {
report_error("Unexpected tag"); return;
} break;
// staticfield <klass> <name> <signature> <value> // // Initialize a class and fill in the value for a static field. // This is useful when the compile was dependent on the value of // static fields but it's impossible to properly rerun the static // initializer. void process_staticfield(TRAPS) {
InstanceKlass* k = (InstanceKlass *)parse_klass(CHECK);
// Create and initialize a record for a ciMethod
ciMethodRecord* new_ciMethod(Method* method) {
ciMethodRecord* rec = NEW_RESOURCE_OBJ(ciMethodRecord);
rec->_klass_name = method->method_holder()->name()->as_utf8();
rec->_method_name = method->name()->as_utf8();
rec->_signature = method->signature()->as_utf8();
_ci_method_records.append(rec); return rec;
}
// Lookup data for a ciMethod
ciMethodRecord* find_ciMethodRecord(Method* method) { constchar* klass_name = method->method_holder()->name()->as_utf8(); constchar* method_name = method->name()->as_utf8(); constchar* signature = method->signature()->as_utf8(); for (int i = 0; i < _ci_method_records.length(); i++) {
ciMethodRecord* rec = _ci_method_records.at(i); if (strcmp(rec->_klass_name, klass_name) == 0 &&
strcmp(rec->_method_name, method_name) == 0 &&
strcmp(rec->_signature, signature) == 0) { return rec;
}
} return NULL;
}
// Create and initialize a record for a ciInstanceKlass which was present at replay dump time. void new_ciInstanceKlass(const InstanceKlass* klass) {
ciInstanceKlassRecord* rec = NEW_RESOURCE_OBJ(ciInstanceKlassRecord);
rec->_klass = klass;
oop java_mirror = klass->java_mirror();
Handle h_java_mirror(_thread, java_mirror);
rec->_java_mirror = JNIHandles::make_global(h_java_mirror);
_ci_instance_klass_records.append(rec);
}
// Check if a ciInstanceKlass was present at replay dump time for a klass.
ciInstanceKlassRecord* find_ciInstanceKlass(const InstanceKlass* klass) { for (int i = 0; i < _ci_instance_klass_records.length(); i++) {
ciInstanceKlassRecord* rec = _ci_instance_klass_records.at(i); if (klass == rec->_klass) { // ciInstanceKlass for this klass was resolved. return rec;
}
} return NULL;
}
// Create and initialize a record for a ciMethodData
ciMethodDataRecord* new_ciMethodData(Method* method) {
ciMethodDataRecord* rec = NEW_RESOURCE_OBJ(ciMethodDataRecord);
rec->_klass_name = method->method_holder()->name()->as_utf8();
rec->_method_name = method->name()->as_utf8();
rec->_signature = method->signature()->as_utf8();
_ci_method_data_records.append(rec); return rec;
}
// Lookup data for a ciMethodData
ciMethodDataRecord* find_ciMethodDataRecord(Method* method) { constchar* klass_name = method->method_holder()->name()->as_utf8(); constchar* method_name = method->name()->as_utf8(); constchar* signature = method->signature()->as_utf8(); for (int i = 0; i < _ci_method_data_records.length(); i++) {
ciMethodDataRecord* rec = _ci_method_data_records.at(i); if (strcmp(rec->_klass_name, klass_name) == 0 &&
strcmp(rec->_method_name, method_name) == 0 &&
strcmp(rec->_signature, signature) == 0) { return rec;
}
} return NULL;
}
// Create and initialize a record for a ciInlineRecord
ciInlineRecord* new_ciInlineRecord(Method* method, int bci, int depth, int inline_late) {
ciInlineRecord* rec = NEW_RESOURCE_OBJ(ciInlineRecord);
rec->_klass_name = method->method_holder()->name()->as_utf8();
rec->_method_name = method->name()->as_utf8();
rec->_signature = method->signature()->as_utf8();
rec->_inline_bci = bci;
rec->_inline_depth = depth;
rec->_inline_late = inline_late;
_ci_inline_records->append(rec); return rec;
}
// Lookup inlining data for a ciMethod
ciInlineRecord* find_ciInlineRecord(Method* method, int bci, int depth) { if (_ci_inline_records != NULL) { return find_ciInlineRecord(_ci_inline_records, method, bci, depth);
} return NULL;
}
void* ciReplay::load_inline_data(ciMethod* method, int entry_bci, int comp_level) { if (FLAG_IS_DEFAULT(InlineDataFile)) {
tty->print_cr("ERROR: no inline replay data file specified (use -XX:InlineDataFile=inline_pid12345.txt)."); return NULL;
}
VM_ENTRY_MARK; // Load and parse the replay data
CompileReplay rp(InlineDataFile, THREAD); if (!rp.can_replay()) {
tty->print_cr("ciReplay: !rp.can_replay()"); return NULL;
} void* data = rp.process_inline(method, method->get_Method(), entry_bci, comp_level, THREAD); if (HAS_PENDING_EXCEPTION) {
Handle throwable(THREAD, PENDING_EXCEPTION);
CLEAR_PENDING_EXCEPTION;
java_lang_Throwable::print_stack_trace(throwable, tty);
tty->cr(); return NULL;
}
if (rp.had_error()) {
tty->print_cr("ciReplay: Failed on %s", rp.error_message()); return NULL;
} return data;
}
int ciReplay::replay_impl(TRAPS) {
HandleMark hm(THREAD);
ResourceMark rm(THREAD);
if (ReplaySuppressInitializers > 2) { // ReplaySuppressInitializers > 2 means that we want to allow // normal VM bootstrap but once we get into the replay itself // don't allow any initializers to be run.
ReplaySuppressInitializers = 1;
}
if (FLAG_IS_DEFAULT(ReplayDataFile)) {
tty->print_cr("ERROR: no compiler replay data file specified (use -XX:ReplayDataFile=replay_pid12345.txt)."); return 1;
}
// Load and parse the replay data
CompileReplay rp(ReplayDataFile, THREAD); int exit_code = 0; if (rp.can_replay()) {
rp.process(THREAD);
} else {
exit_code = 1; return exit_code;
}
if (rp.had_error()) {
tty->print_cr("Failed on %s", rp.error_message());
exit_code = 1;
} return exit_code;
}
void ciReplay::initialize(ciMethodData* m) { if (no_replay_state()) { return;
}
ASSERT_IN_VM;
ResourceMark rm;
Method* method = m->get_MethodData()->method();
ciMethodDataRecord* rec = replay_state->find_ciMethodDataRecord(method); if (rec == NULL) { // This indicates some mismatch with the original environment and // the replay environment though it's not always enough to // interfere with reproducing a bug
tty->print_cr("Warning: requesting ciMethodData record for method with no data: ");
method->print_name(tty);
tty->cr();
} else {
m->_state = rec->_state;
m->_invocation_counter = rec->_invocation_counter; if (rec->_data_length != 0) {
assert(m->_data_size + m->_extra_data_size == rec->_data_length * (int)sizeof(rec->_data[0]) ||
m->_data_size == rec->_data_length * (int)sizeof(rec->_data[0]), "must agree");
// Write the correct ciObjects back into the profile data
ciEnv* env = ciEnv::current(); for (int i = 0; i < rec->_classes_length; i++) {
Klass *k = rec->_classes[i]; // In case this class pointer is is tagged, preserve the tag bits
intptr_t status = 0; if (k != NULL) {
status = ciTypeEntries::with_status(env->get_metadata(k)->as_klass(), rec->_data[rec->_classes_offsets[i]]);
}
rec->_data[rec->_classes_offsets[i]] = status;
} for (int i = 0; i < rec->_methods_length; i++) {
Method *m = rec->_methods[i];
*(ciMetadata**)(rec->_data + rec->_methods_offsets[i]) =
env->get_metadata(m);
} // Copy the updated profile data into place as intptr_ts #ifdef _LP64
Copy::conjoint_jlongs_atomic((jlong *)rec->_data, (jlong *)m->_data, rec->_data_length); #else
Copy::conjoint_jints_atomic((jint *)rec->_data, (jint *)m->_data, rec->_data_length); #endif
}
// copy in the original header
Copy::conjoint_jbytes(rec->_orig_data, (char*)&m->_orig, rec->_orig_data_length);
}
}
bool ciReplay::should_not_inline(ciMethod* method) { if (no_replay_state()) { returnfalse;
}
VM_ENTRY_MARK; // ciMethod without a record shouldn't be inlined. return replay_state->find_ciMethodRecord(method->get_Method()) == NULL;
}
bool ciReplay::should_inline(void* data, ciMethod* method, int bci, int inline_depth, bool& should_delay) { if (data != NULL) {
GrowableArray<ciInlineRecord*>* records = (GrowableArray<ciInlineRecord*>*)data;
VM_ENTRY_MARK; // Inline record are ordered by bci and depth.
ciInlineRecord* record = CompileReplay::find_ciInlineRecord(records, method->get_Method(), bci, inline_depth); if (record == NULL) { returnfalse;
}
should_delay = record->_inline_late; returntrue;
} elseif (replay_state != NULL) {
VM_ENTRY_MARK; // Inline record are ordered by bci and depth.
ciInlineRecord* record = replay_state->find_ciInlineRecord(method->get_Method(), bci, inline_depth); if (record == NULL) { returnfalse;
}
should_delay = record->_inline_late; returntrue;
} returnfalse;
}
bool ciReplay::should_not_inline(void* data, ciMethod* method, int bci, int inline_depth) { if (data != NULL) {
GrowableArray<ciInlineRecord*>* records = (GrowableArray<ciInlineRecord*>*)data;
VM_ENTRY_MARK; // Inline record are ordered by bci and depth. return CompileReplay::find_ciInlineRecord(records, method->get_Method(), bci, inline_depth) == NULL;
} elseif (replay_state != NULL) {
VM_ENTRY_MARK; // Inline record are ordered by bci and depth. return replay_state->find_ciInlineRecord(method->get_Method(), bci, inline_depth) == NULL;
} returnfalse;
}
void ciReplay::initialize(ciMethod* m) { if (no_replay_state()) { return;
}
ASSERT_IN_VM;
ResourceMark rm;
Method* method = m->get_Method();
ciMethodRecord* rec = replay_state->find_ciMethodRecord(method); if (rec == NULL) { // This indicates some mismatch with the original environment and // the replay environment though it's not always enough to // interfere with reproducing a bug
tty->print_cr("Warning: requesting ciMethod record for method with no data: ");
method->print_name(tty);
tty->cr();
} else {
EXCEPTION_CONTEXT; // m->_instructions_size = rec->_instructions_size;
m->_instructions_size = -1;
m->_interpreter_invocation_count = rec->_interpreter_invocation_count;
m->_interpreter_throwout_count = rec->_interpreter_throwout_count;
MethodCounters* mcs = method->get_method_counters(CHECK_AND_CLEAR);
guarantee(mcs != NULL, "method counters allocation failed");
mcs->invocation_counter()->_counter = rec->_invocation_counter;
mcs->backedge_counter()->_counter = rec->_backedge_counter;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.