src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/graphKit.cpp	Thu Jul 16 16:02:36 2009
--- new/src/share/vm/opto/graphKit.cpp	Thu Jul 16 16:02:36 2009

*** 618,627 **** --- 618,637 ---- BuildCutout::~BuildCutout() { GraphKit* kit = _kit; assert(kit->stopped(), "cutout code must stop, throw, return, etc."); } + //---------------------------PreserveReexecuteAndSP---------------------------- + PreserveReexecuteAndSP::PreserveReexecuteAndSP(GraphKit* kit) { + _kit = kit; + _sp = kit->sp(); + _reexecute = kit->jvms()->should_reexecute(); + } + PreserveReexecuteAndSP::~PreserveReexecuteAndSP() { + _kit->jvms()->set_reexecute(_reexecute); + _kit->set_sp(_sp); + } //------------------------------clone_map-------------------------------------- // Implementation of PreserveJVMState // // Only clone_map(...) here. If this function is only used in the
*** 736,745 **** --- 746,767 ---- return true; } #endif //ASSERT + // Helper function for enforcing certain bytecodes to reexecute if + // deoptimization happens + static bool should_reexecute_implied_by_bytecodes(JVMState *jvms) { + ciMethod* cur_method = jvms->method(); + int cur_bci = jvms->bci(); + if (cur_method != NULL && cur_bci != InvocationEntryBci) { + Bytecodes::Code code = cur_method->java_code_at_bci(cur_bci); + return Interpreter::bytecodes_to_reexecute(code); + } else + return false; + } + // Helper function for adding JVMState and debug information to node void GraphKit::add_safepoint_edges(SafePointNode* call, bool must_throw) { // Add the safepoint edges to the call (or other safepoint). // Make sure dead locals are set to top. This
*** 779,788 **** --- 801,815 ---- // do not scribble on the input jvms JVMState* out_jvms = youngest_jvms->clone_deep(C); call->set_jvms(out_jvms); // Start jvms list for call node + // For a known set of bytecodes, the interpreter must reexecute them if + // deoptimization happens. We set the reexecute bit for them here + if(should_reexecute_implied_by_bytecodes(out_jvms)) + out_jvms->set_reexecute(true); + // Presize the call: debug_only(uint non_debug_edges = call->req()); call->add_req_batch(top(), youngest_jvms->debug_depth()); assert(call->req() == non_debug_edges + youngest_jvms->debug_depth(), "");

src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File