1.1 --- a/src/share/vm/opto/graphKit.cpp Thu Feb 11 10:48:10 2010 -0800 1.2 +++ b/src/share/vm/opto/graphKit.cpp Fri Feb 12 15:27:36 2010 -0800 1.3 @@ -780,12 +780,20 @@ 1.4 1.5 // Helper function for enforcing certain bytecodes to reexecute if 1.6 // deoptimization happens 1.7 -static bool should_reexecute_implied_by_bytecode(JVMState *jvms) { 1.8 +static bool should_reexecute_implied_by_bytecode(JVMState *jvms, bool is_anewarray) { 1.9 ciMethod* cur_method = jvms->method(); 1.10 int cur_bci = jvms->bci(); 1.11 if (cur_method != NULL && cur_bci != InvocationEntryBci) { 1.12 Bytecodes::Code code = cur_method->java_code_at_bci(cur_bci); 1.13 - return Interpreter::bytecode_should_reexecute(code); 1.14 + return Interpreter::bytecode_should_reexecute(code) || 1.15 + is_anewarray && code == Bytecodes::_multianewarray; 1.16 + // Reexecute _multianewarray bytecode which was replaced with 1.17 + // sequence of [a]newarray. See Parse::do_multianewarray(). 1.18 + // 1.19 + // Note: interpreter should not have it set since this optimization 1.20 + // is limited by dimensions and guarded by flag so in some cases 1.21 + // multianewarray() runtime calls will be generated and 1.22 + // the bytecode should not be reexecutes (stack will not be reset). 1.23 } else 1.24 return false; 1.25 } 1.26 @@ -836,7 +844,7 @@ 1.27 // For a known set of bytecodes, the interpreter should reexecute them if 1.28 // deoptimization happens. We set the reexecute state for them here 1.29 if (out_jvms->is_reexecute_undefined() && //don't change if already specified 1.30 - should_reexecute_implied_by_bytecode(out_jvms)) { 1.31 + should_reexecute_implied_by_bytecode(out_jvms, call->is_AllocateArray())) { 1.32 out_jvms->set_should_reexecute(true); //NOTE: youngest_jvms not changed 1.33 } 1.34