# HG changeset patch # User Christian Haeubl # Date 1329963611 28800 # Node ID e1c0533242103006cba241e8a986f34e565ccab4 # Parent 8021e46f4a99ecc251e89298e8eee3346dd048ff changed TraceDeoptimization output diff -r 8021e46f4a99 -r e1c053324210 src/share/vm/runtime/deoptimization.cpp --- a/src/share/vm/runtime/deoptimization.cpp Wed Feb 22 16:53:23 2012 -0800 +++ b/src/share/vm/runtime/deoptimization.cpp Wed Feb 22 18:20:11 2012 -0800 @@ -162,8 +162,10 @@ // handler. Note this fact before we start generating temporary frames // that can confuse an asynchronous stack walker. This counter is // decremented at the end of unpack_frames(). + if (TraceDeoptimization) { + tty->print("Deoptimization "); + } thread->inc_in_deopt_handler(); - return fetch_unroll_info_helper(thread); JRT_END @@ -176,10 +178,6 @@ // the vframeArray is created. // - if (PrintDeoptimizationDetails) { - tty->print_cr("fetching unroll info"); - } - // Allocate our special deoptimization ResourceMark DeoptResourceMark* dmark = new DeoptResourceMark(thread); assert(thread->deopt_mark() == NULL, "Pending deopt!"); @@ -212,11 +210,13 @@ chunk->push(compiledVFrame::cast(vf)); // TODO(tw): Fix this hack after introducing GRAAL macro. -//#ifdef COMPILER2 +#if defined(COMPILER2) || defined(GRAAL) // Reallocate the non-escaping objects and restore their fields. Then // relock objects if synchronization on them was eliminated. -// if (DoEscapeAnalysis) { -// if (EliminateAllocations) { +#ifdef COMPILER2 + if (DoEscapeAnalysis) { + if (EliminateAllocations) { +#endif // COMPILER2 assert (chunk->at(0)->scope() != NULL,"expect only compiled java frames"); GrowableArray* objects = chunk->at(0)->scope()->objects(); @@ -254,14 +254,16 @@ tty->print_cr("REALLOC OBJECTS in thread " INTPTR_FORMAT, thread); print_objects(objects); } -#endif +#endif // !PRODUCT } if (save_oop_result) { // Restore result. deoptee.set_saved_oop_result(&map, return_value()); } -// } -// if (EliminateLocks) { +#ifdef COMPILER2 + } + if (EliminateLocks) { +#endif // COMPILER2 #ifndef PRODUCT bool first = true; #endif @@ -285,12 +287,15 @@ } } } -#endif +#endif // !PRODUCT } } -// } -// } -//#endif // COMPILER2 +#ifdef COMPILER2 + } + } +#endif // COMPILER2 +#endif // COMPILER2 || GRAAL + // Ensure that no safepoint is taken after pointers have been stored // in fields of rematerialized objects. If a safepoint occurs from here on // out the java state residing in the vframeArray will be missed. @@ -1264,7 +1269,7 @@ ScopeDesc* trap_scope = cvf->scope(); if (TraceDeoptimization) { - tty->print_cr("Deoptimization: bci=%d pc=%d, relative_pc=%d, method=%s", trap_scope->bci(), fr.pc(), fr.pc() - nm->code_begin(), trap_scope->method()->name()->as_C_string()); + tty->print_cr(" bci=%d pc=%d, relative_pc=%d, method=%s", trap_scope->bci(), fr.pc(), fr.pc() - nm->code_begin(), trap_scope->method()->name()->as_C_string()); if (thread->graal_deopt_info() != NULL) { oop deopt_info = thread->graal_deopt_info(); if (java_lang_String::is_instance(deopt_info)) { @@ -1698,7 +1703,9 @@ } Deoptimization::UnrollBlock* Deoptimization::uncommon_trap(JavaThread* thread, jint trap_request) { - + if (TraceDeoptimization) { + tty->print("Uncommon trap "); + } // Still in Java no safepoints { // This enters VM and may safepoint