comparison src/cpu/ppc/vm/templateInterpreter_ppc.cpp @ 20710:c5e86c5cd22e

8066964: ppc64: argument and return type profiling, fix problem with popframe Reviewed-by: roland, kvn
author goetz
date Fri, 12 Dec 2014 08:48:56 +0100
parents b384ba33c9a0
children 7848fc12602b 47cd96b2510f
comparison
equal deleted inserted replaced
20709:28f116adb50c 20710:c5e86c5cd22e
88 // exception happened. 88 // exception happened.
89 __ empty_expression_stack(); 89 __ empty_expression_stack();
90 90
91 // Thread will be loaded to R3_ARG1. 91 // Thread will be loaded to R3_ARG1.
92 // Target class oop is in register R5_ARG3 by convention! 92 // Target class oop is in register R5_ARG3 by convention!
93 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ClassCastException_verbose, R17_tos, R5_ARG3)); 93 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ClassCastException_verbose), R17_tos, R5_ARG3);
94 // Above call must not return here since exception pending. 94 // Above call must not return here since exception pending.
95 DEBUG_ONLY(__ should_not_reach_here();) 95 DEBUG_ONLY(__ should_not_reach_here();)
96 return entry; 96 return entry;
97 } 97 }
98 #endif 98 #endif
168 __ ld(R12_scratch2, _ijava_state_neg(top_frame_sp), R11_scratch1); 168 __ ld(R12_scratch2, _ijava_state_neg(top_frame_sp), R11_scratch1);
169 __ resize_frame_absolute(R12_scratch2, R11_scratch1, R0); 169 __ resize_frame_absolute(R12_scratch2, R11_scratch1, R0);
170 170
171 // Compiled code destroys templateTableBase, reload. 171 // Compiled code destroys templateTableBase, reload.
172 __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R12_scratch2); 172 __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R12_scratch2);
173
174 if (state == atos) {
175 __ profile_return_type(R3_RET, R11_scratch1, R12_scratch2);
176 }
173 177
174 const Register cache = R11_scratch1; 178 const Register cache = R11_scratch1;
175 const Register size = R12_scratch2; 179 const Register size = R12_scratch2;
176 __ get_cache_and_index_at_bcp(cache, 1, index_size); 180 __ get_cache_and_index_at_bcp(cache, 1, index_size);
177 181
1228 // This flag has two effects, one is to force an unwind in the topmost 1232 // This flag has two effects, one is to force an unwind in the topmost
1229 // interpreter frame and not perform an unlock while doing so. 1233 // interpreter frame and not perform an unlock while doing so.
1230 __ li(R0, 1); 1234 __ li(R0, 1);
1231 __ stb(R0, in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()), R16_thread); 1235 __ stb(R0, in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()), R16_thread);
1232 } 1236 }
1237
1238 // Argument and return type profiling.
1239 __ profile_parameters_type(R3_ARG1, R4_ARG2, R5_ARG3, R6_ARG4);
1240
1233 // Increment invocation counter and check for overflow. 1241 // Increment invocation counter and check for overflow.
1234 if (inc_counter) { 1242 if (inc_counter) {
1235 generate_counter_incr(&invocation_counter_overflow, &profile_method, &profile_method_continue); 1243 generate_counter_incr(&invocation_counter_overflow, &profile_method, &profile_method_continue);
1236 } 1244 }
1237 1245
1547 __ restore_interpreter_state(R11_scratch1); 1555 __ restore_interpreter_state(R11_scratch1);
1548 __ ld(R12_scratch2, _ijava_state_neg(top_frame_sp), R11_scratch1); 1556 __ ld(R12_scratch2, _ijava_state_neg(top_frame_sp), R11_scratch1);
1549 __ resize_frame_absolute(R12_scratch2, R11_scratch1, R0); 1557 __ resize_frame_absolute(R12_scratch2, R11_scratch1, R0);
1550 if (ProfileInterpreter) { 1558 if (ProfileInterpreter) {
1551 __ set_method_data_pointer_for_bcp(); 1559 __ set_method_data_pointer_for_bcp();
1560 __ ld(R11_scratch1, 0, R1_SP);
1561 __ std(R28_mdx, _ijava_state_neg(mdx), R11_scratch1);
1552 } 1562 }
1553 #if INCLUDE_JVMTI 1563 #if INCLUDE_JVMTI
1554 Label L_done; 1564 Label L_done;
1555 1565
1556 __ lbz(R11_scratch1, 0, R14_bcp); 1566 __ lbz(R11_scratch1, 0, R14_bcp);
1558 __ bne(CCR0, L_done); 1568 __ bne(CCR0, L_done);
1559 1569
1560 // The member name argument must be restored if _invokestatic is re-executed after a PopFrame call. 1570 // The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
1561 // Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL. 1571 // Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
1562 __ ld(R4_ARG2, 0, R18_locals); 1572 __ ld(R4_ARG2, 0, R18_locals);
1563 __ call_VM(R11_scratch1, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), 1573 __ MacroAssembler::call_VM(R4_ARG2, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), R4_ARG2, R19_method, R14_bcp, false);
1564 R4_ARG2, R19_method, R14_bcp); 1574 __ restore_interpreter_state(R11_scratch1, /*bcp_and_mdx_only*/ true);
1565 1575 __ cmpdi(CCR0, R4_ARG2, 0);
1566 __ cmpdi(CCR0, R11_scratch1, 0);
1567 __ beq(CCR0, L_done); 1576 __ beq(CCR0, L_done);
1568 1577 __ std(R4_ARG2, wordSize, R15_esp);
1569 __ std(R11_scratch1, wordSize, R15_esp);
1570 __ bind(L_done); 1578 __ bind(L_done);
1571 #endif // INCLUDE_JVMTI 1579 #endif // INCLUDE_JVMTI
1572 __ dispatch_next(vtos); 1580 __ dispatch_next(vtos);
1573 } 1581 }
1574 // end of JVMTI PopFrame support 1582 // end of JVMTI PopFrame support