Wed, 19 Sep 2018 18:00:50 +0800
#7557 removed redundant get_thread to save interpreter code size
src/cpu/mips/vm/interp_masm_mips_64.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/mips/vm/interp_masm_mips_64.cpp Wed Sep 19 17:44:09 2018 +0800 1.2 +++ b/src/cpu/mips/vm/interp_masm_mips_64.cpp Wed Sep 19 18:00:50 2018 +0800 1.3 @@ -182,31 +182,36 @@ 1.4 // don't want to reenter. 1.5 // This method is only called just after the call into the vm in 1.6 // call_VM_base, so the arg registers are available. 1.7 - Register pop_cond = java_thread; 1.8 - // Not clear if any other register is available... 1.9 - lw(pop_cond, java_thread, in_bytes(JavaThread::popframe_condition_offset())); 1.10 - andi(AT, pop_cond, JavaThread::popframe_pending_bit); 1.11 + // Not clear if any other register is available, so load AT twice 1.12 + assert(AT != java_thread, "check"); 1.13 + lw(AT, java_thread, in_bytes(JavaThread::popframe_condition_offset())); 1.14 + andi(AT, AT, JavaThread::popframe_pending_bit); 1.15 beq(AT, R0, L); 1.16 - delayed()->andi(AT, pop_cond, JavaThread::popframe_processing_bit); 1.17 + delayed()->nop(); 1.18 + 1.19 + lw(AT, java_thread, in_bytes(JavaThread::popframe_condition_offset())); 1.20 + andi(AT, AT, JavaThread::popframe_processing_bit); 1.21 bne(AT, R0, L); 1.22 delayed()->nop(); 1.23 - get_thread(java_thread); 1.24 call_VM_leaf(CAST_FROM_FN_PTR(address, Interpreter::remove_activation_preserving_args_entry)); 1.25 jr(V0); 1.26 delayed()->nop(); 1.27 bind(L); 1.28 - get_thread(java_thread); 1.29 } 1.30 } 1.31 1.32 1.33 void InterpreterMacroAssembler::load_earlyret_value(TosState state) { 1.34 - //T8, thread 1.35 - get_thread(T8); 1.36 - ld_ptr(T8, T8,in_bytes(JavaThread::jvmti_thread_state_offset())); 1.37 - const Address tos_addr (T8, in_bytes(JvmtiThreadState::earlyret_tos_offset())); 1.38 - const Address oop_addr (T8, in_bytes(JvmtiThreadState::earlyret_oop_offset())); 1.39 - const Address val_addr (T8, in_bytes(JvmtiThreadState::earlyret_value_offset())); 1.40 + Register thread = T8; 1.41 +#ifndef OPT_THREAD 1.42 + get_thread(thread); 1.43 +#else 1.44 + move(T8, TREG); 1.45 +#endif 1.46 + ld_ptr(thread, thread, in_bytes(JavaThread::jvmti_thread_state_offset())); 1.47 + const Address tos_addr (thread, in_bytes(JvmtiThreadState::earlyret_tos_offset())); 1.48 + const Address oop_addr (thread, in_bytes(JvmtiThreadState::earlyret_oop_offset())); 1.49 + const Address val_addr (thread, in_bytes(JvmtiThreadState::earlyret_value_offset())); 1.50 //V0, oop_addr,V1,val_addr 1.51 switch (state) { 1.52 case atos: 1.53 @@ -225,10 +230,10 @@ 1.54 lw(V0, val_addr); 1.55 break; 1.56 case ftos: 1.57 - lwc1(F0,T8, in_bytes(JvmtiThreadState::earlyret_value_offset())); 1.58 + lwc1(F0, thread, in_bytes(JvmtiThreadState::earlyret_value_offset())); 1.59 break; 1.60 case dtos: 1.61 - ldc1(F0,T8, in_bytes(JvmtiThreadState::earlyret_value_offset())); 1.62 + ldc1(F0, thread, in_bytes(JvmtiThreadState::earlyret_value_offset())); 1.63 break; 1.64 case vtos: /* nothing to do */ break; 1.65 default : ShouldNotReachHere(); 1.66 @@ -236,7 +241,7 @@ 1.67 // Clean up tos value in the thread object 1.68 move(AT, (int)ilgl); 1.69 sw(AT, tos_addr); 1.70 - sw(R0,T8, in_bytes(JvmtiThreadState::earlyret_value_offset())); 1.71 + sw(R0, thread, in_bytes(JvmtiThreadState::earlyret_value_offset())); 1.72 } 1.73 1.74 1.75 @@ -245,8 +250,10 @@ 1.76 Label L; 1.77 Register tmp = T9; 1.78 1.79 - ld_ptr(AT,java_thread, in_bytes(JavaThread::jvmti_thread_state_offset())); 1.80 - beq(AT,R0,L); 1.81 + assert(java_thread != AT, "check"); 1.82 + assert(java_thread != tmp, "check"); 1.83 + ld_ptr(AT, java_thread, in_bytes(JavaThread::jvmti_thread_state_offset())); 1.84 + beq(AT, R0, L); 1.85 delayed()->nop(); 1.86 1.87 // Initiate earlyret handling only if it is not already being processed. 1.88 @@ -256,18 +263,16 @@ 1.89 move(tmp, JvmtiThreadState::earlyret_pending); 1.90 bne(tmp, AT, L); 1.91 delayed()->nop(); 1.92 - get_thread(java_thread); 1.93 1.94 // Call Interpreter::remove_activation_early_entry() to get the address of the 1.95 // same-named entrypoint in the generated interpreter code. 1.96 - ld_ptr(tmp,java_thread, in_bytes(JavaThread::jvmti_thread_state_offset())); 1.97 - lw(AT,tmp, in_bytes(JvmtiThreadState::earlyret_tos_offset())); 1.98 + ld_ptr(tmp, java_thread, in_bytes(JavaThread::jvmti_thread_state_offset())); 1.99 + lw(AT, tmp, in_bytes(JvmtiThreadState::earlyret_tos_offset())); 1.100 move(A0, AT); 1.101 call_VM_leaf(CAST_FROM_FN_PTR(address, Interpreter::remove_activation_early_entry), A0); 1.102 jr(V0); 1.103 delayed()->nop(); 1.104 bind(L); 1.105 - get_thread(java_thread); 1.106 } 1.107 } 1.108 1.109 @@ -2045,7 +2050,11 @@ 1.110 Register tempreg = T0; 1.111 if (JvmtiExport::can_post_interpreter_events()) { 1.112 Label L; 1.113 +#ifndef OPT_THREAD 1.114 get_thread(AT); 1.115 +#else 1.116 + move(AT, TREG); 1.117 +#endif 1.118 lw(tempreg, AT, in_bytes(JavaThread::interp_only_mode_offset())); 1.119 beq(tempreg, R0, L); 1.120 delayed()->nop(); 1.121 @@ -2074,8 +2083,11 @@ 1.122 Register tempreg = T0; 1.123 if (mode == NotifyJVMTI && JvmtiExport::can_post_interpreter_events()) { 1.124 Label skip; 1.125 - //lw(tempreg, in_bytes(JavaThread::interp_only_mode_offset()), Rthread); 1.126 +#ifndef OPT_THREAD 1.127 get_thread(AT); 1.128 +#else 1.129 + move(AT, TREG); 1.130 +#endif 1.131 lw(tempreg, AT, in_bytes(JavaThread::interp_only_mode_offset())); 1.132 beq(tempreg, R0, skip); 1.133 delayed()->nop();