Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/vframeArray.cpp @ 900:9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
Summary: developed a reexecute logic for the interpreter to reexecute the bytecode when deopt happens
Reviewed-by: kvn, never, jrose, twisti
author | cfang |
---|---|
date | Fri, 31 Jul 2009 17:12:33 -0700 |
parents | b109e761e927 |
children | 15bbd3f505c0 |
comparison
equal
deleted
inserted
replaced
899:55cb84cd1247 | 900:9987d9d5eb0e |
---|---|
42 // Copy the information from the compiled vframe to the | 42 // Copy the information from the compiled vframe to the |
43 // interpreter frame we will be creating to replace vf | 43 // interpreter frame we will be creating to replace vf |
44 | 44 |
45 _method = vf->method(); | 45 _method = vf->method(); |
46 _bci = vf->raw_bci(); | 46 _bci = vf->raw_bci(); |
47 _reexecute = vf->should_reexecute(); | |
47 | 48 |
48 int index; | 49 int index; |
49 | 50 |
50 // Get the monitors off-stack | 51 // Get the monitors off-stack |
51 | 52 |
146 // Look at bci and decide on bcp and continuation pc | 147 // Look at bci and decide on bcp and continuation pc |
147 address bcp; | 148 address bcp; |
148 // C++ interpreter doesn't need a pc since it will figure out what to do when it | 149 // C++ interpreter doesn't need a pc since it will figure out what to do when it |
149 // begins execution | 150 // begins execution |
150 address pc; | 151 address pc; |
151 bool use_next_mdp; // true if we should use the mdp associated with the next bci | 152 bool use_next_mdp = false; // true if we should use the mdp associated with the next bci |
152 // rather than the one associated with bcp | 153 // rather than the one associated with bcp |
153 if (raw_bci() == SynchronizationEntryBCI) { | 154 if (raw_bci() == SynchronizationEntryBCI) { |
154 // We are deoptimizing while hanging in prologue code for synchronized method | 155 // We are deoptimizing while hanging in prologue code for synchronized method |
155 bcp = method()->bcp_from(0); // first byte code | 156 bcp = method()->bcp_from(0); // first byte code |
156 pc = Interpreter::deopt_entry(vtos, 0); // step = 0 since we don't skip current bytecode | 157 pc = Interpreter::deopt_entry(vtos, 0); // step = 0 since we don't skip current bytecode |
157 use_next_mdp = false; | 158 } else if (should_reexecute()) { //reexecute this bytecode |
159 assert(is_top_frame, "reexecute allowed only for the top frame"); | |
160 bcp = method()->bcp_from(bci()); | |
161 pc = Interpreter::deopt_reexecute_entry(method(), bcp); | |
158 } else { | 162 } else { |
159 bcp = method()->bcp_from(bci()); | 163 bcp = method()->bcp_from(bci()); |
160 pc = Interpreter::continuation_for(method(), bcp, callee_parameters, is_top_frame, use_next_mdp); | 164 pc = Interpreter::deopt_continue_after_entry(method(), bcp, callee_parameters, is_top_frame); |
165 use_next_mdp = true; | |
161 } | 166 } |
162 assert(Bytecodes::is_defined(*bcp), "must be a valid bytecode"); | 167 assert(Bytecodes::is_defined(*bcp), "must be a valid bytecode"); |
163 | 168 |
164 // Monitorenter and pending exceptions: | 169 // Monitorenter and pending exceptions: |
165 // | 170 // |