Mon, 13 Mar 2017 01:52:16 -0400
[C2] For the reason of deopt, the size of call-instructions must be the same.
src/cpu/mips/vm/mips_64.ad | file | annotate | diff | comparison | revisions | |
src/cpu/mips/vm/sharedRuntime_mips_64.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/mips/vm/mips_64.ad Wed Mar 08 08:57:26 2017 -0500 1.2 +++ b/src/cpu/mips/vm/mips_64.ad Mon Mar 13 01:52:16 2017 -0400 1.3 @@ -682,7 +682,7 @@ 1.4 1.5 // relocation entries for call stub, compiled java to interpreter 1.6 uint reloc_java_to_interp() { 1.7 - return 12; // in emit_java_to_interp + in Java_Static_Call 1.8 + return 16; // in emit_java_to_interp + in Java_Static_Call 1.9 } 1.10 1.11 bool Matcher::is_short_branch_offset(int rule, int br_size, int offset) { 1.12 @@ -871,8 +871,8 @@ 1.13 1.14 //lui 1.15 //ori 1.16 - //dsll 1.17 - //ori 1.18 + //nop 1.19 + //nop 1.20 1.21 //jalr 1.22 //nop 1.23 @@ -953,25 +953,26 @@ 1.24 int MachCallStaticJavaNode::ret_addr_offset() { 1.25 //lui 1.26 //ori 1.27 + //nop 1.28 + //nop 1.29 //jalr 1.30 //nop 1.31 - return 16; 1.32 + return 24; 1.33 } 1.34 1.35 int MachCallDynamicJavaNode::ret_addr_offset() { 1.36 - assert(NativeCall::instruction_size == 24, "in MachCallDynamicJavaNode::ret_addr_offset"); 1.37 - //The value ought to be 4 + 16 bytes. 1.38 //lui IC_Klass, 1.39 //ori IC_Klass, 1.40 //dsll IC_Klass 1.41 //ori IC_Klass 1.42 + 1.43 //lui T9 1.44 //ori T9 1.45 - //dsll T9 1.46 - //ori T9 1.47 + //nop 1.48 + //nop 1.49 //jalr T9 1.50 //nop 1.51 - return 4 * 4 + NativeCall::instruction_size; 1.52 + return 4 * 4 + 4 * 6; 1.53 } 1.54 1.55 //============================================================================= 1.56 @@ -3394,7 +3395,7 @@ 1.57 __ relocate(relocInfo::static_call_type); 1.58 } 1.59 1.60 - __ patchable_call32(T9, $meth$$method); 1.61 + __ patchable_set48(T9, $meth$$method); 1.62 __ jalr(T9); 1.63 __ nop(); 1.64 if( _method ) { // Emit stub for static call 1.65 @@ -12063,7 +12064,7 @@ 1.66 ins_encode( Java_Static_Call( meth ) ); 1.67 ins_pipe( pipe_slow ); 1.68 ins_pc_relative(1); 1.69 - ins_alignment(8); 1.70 + ins_alignment(16); 1.71 %} 1.72 1.73 // Call Java Dynamic Instruction 1.74 @@ -12074,7 +12075,7 @@ 1.75 effect(USE meth); 1.76 1.77 ins_cost(300); 1.78 - format %{"MOV IC_Klass, (oop)-1 @ CallDynamicJavaDirect\n\t" 1.79 + format %{"MOV IC_Klass, (oop)-1\n\t" 1.80 "CallDynamic @ CallDynamicJavaDirect" %} 1.81 ins_encode( Java_Dynamic_Call( meth ) ); 1.82 ins_pipe( pipe_slow );
2.1 --- a/src/cpu/mips/vm/sharedRuntime_mips_64.cpp Wed Mar 08 08:57:26 2017 -0500 2.2 +++ b/src/cpu/mips/vm/sharedRuntime_mips_64.cpp Mon Mar 13 01:52:16 2017 -0400 2.3 @@ -3714,7 +3714,7 @@ 2.4 // Prolog for non exception case! 2.5 // Correct the return address we were given. 2.6 //FIXME, return address is on the tos or Ra? 2.7 - __ addi(RA, RA, - (NativeCall::return_address_offset_short)); 2.8 + __ addi(RA, RA, - (NativeCall::return_address_offset_long)); 2.9 // Save everything in sight. 2.10 map = RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words); 2.11 // Normal deoptimization 2.12 @@ -3758,7 +3758,7 @@ 2.13 // available now because loading it from memory would destroy registers. 2.14 // Save everything in sight. 2.15 // No need to update map as each call to save_live_registers will produce identical oopmap 2.16 - __ addi(RA, RA, - (NativeCall::return_address_offset_short)); 2.17 + __ addi(RA, RA, - (NativeCall::return_address_offset_long)); 2.18 (void) RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words); 2.19 2.20 // Now it is safe to overwrite any register