Mercurial > hg > truffle
diff src/share/vm/runtime/deoptimization.cpp @ 1257:7b4415a18c8a
Merge
author | kvn |
---|---|
date | Fri, 12 Feb 2010 15:27:36 -0800 |
parents | e3a4305c6bc3 |
children | c18cbe5936b8 |
line wrap: on
line diff
--- a/src/share/vm/runtime/deoptimization.cpp Thu Feb 11 10:48:10 2010 -0800 +++ b/src/share/vm/runtime/deoptimization.cpp Fri Feb 12 15:27:36 2010 -0800 @@ -145,6 +145,27 @@ if (EliminateAllocations) { assert (chunk->at(0)->scope() != NULL,"expect only compiled java frames"); GrowableArray<ScopeValue*>* objects = chunk->at(0)->scope()->objects(); + + // The flag return_oop() indicates call sites which return oop + // in compiled code. Such sites include java method calls, + // runtime calls (for example, used to allocate new objects/arrays + // on slow code path) and any other calls generated in compiled code. + // It is not guaranteed that we can get such information here only + // by analyzing bytecode in deoptimized frames. This is why this flag + // is set during method compilation (see Compile::Process_OopMap_Node()). + bool save_oop_result = chunk->at(0)->scope()->return_oop(); + Handle return_value; + if (save_oop_result) { + // Reallocation may trigger GC. If deoptimization happened on return from + // call which returns oop we need to save it since it is not in oopmap. + oop result = deoptee.saved_oop_result(&map); + assert(result == NULL || result->is_oop(), "must be oop"); + return_value = Handle(thread, result); + assert(Universe::heap()->is_in_or_null(result), "must be heap pointer"); + if (TraceDeoptimization) { + tty->print_cr("SAVED OOP RESULT " INTPTR_FORMAT " in thread " INTPTR_FORMAT, result, thread); + } + } bool reallocated = false; if (objects != NULL) { JRT_BLOCK @@ -158,8 +179,12 @@ ttyLocker ttyl; tty->print_cr("REALLOC OBJECTS in thread " INTPTR_FORMAT, thread); print_objects(objects); + } +#endif } -#endif + if (save_oop_result) { + // Restore result. + deoptee.set_saved_oop_result(&map, return_value()); } } if (EliminateLocks) { @@ -913,21 +938,6 @@ if (TraceDeoptimization) { ttyLocker ttyl; tty->print_cr(" Created vframeArray " INTPTR_FORMAT, array); - if (Verbose) { - int count = 0; - // this used to leak deoptimizedVFrame like it was going out of style!!! - for (int index = 0; index < array->frames(); index++ ) { - vframeArrayElement* e = array->element(index); - e->print(tty); - - /* - No printing yet. - array->vframe_at(index)->print_activation(count++); - // better as... - array->print_activation_for(index, count++); - */ - } - } } #endif // PRODUCT