Sat, 18 Mar 2017 07:08:36 +0800
[C2] Use general_jal for java runtime calls.
src/cpu/mips/vm/mips_64.ad | file | annotate | diff | comparison | revisions | |
src/cpu/mips/vm/nativeInst_mips.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/mips/vm/mips_64.ad Fri Mar 17 22:15:27 2017 +0800 1.2 +++ b/src/cpu/mips/vm/mips_64.ad Sat Mar 18 07:08:36 2017 +0800 1.3 @@ -849,38 +849,6 @@ 1.4 return false; 1.5 } 1.6 1.7 -// The address of the call instruction needs to be 16-byte aligned to 1.8 -// ensure that it does not span a cache line so that it can be patched. 1.9 - 1.10 -int CallStaticJavaDirectNode::compute_padding(int current_offset) const { 1.11 - //lui 1.12 - //ori 1.13 - //dsll 1.14 - //ori 1.15 - 1.16 - //jalr 1.17 - //nop 1.18 - 1.19 - return round_to(current_offset, alignment_required()) - current_offset; 1.20 -} 1.21 - 1.22 -// The address of the call instruction needs to be 16-byte aligned to 1.23 -// ensure that it does not span a cache line so that it can be patched. 1.24 -int CallDynamicJavaDirectNode::compute_padding(int current_offset) const { 1.25 - //loadIC <--- skip 1.26 - 1.27 - //lui 1.28 - //ori 1.29 - //nop 1.30 - //nop 1.31 - 1.32 - //jalr 1.33 - //nop 1.34 - 1.35 - current_offset += 4 * 4; 1.36 - return round_to(current_offset, alignment_required()) - current_offset; 1.37 -} 1.38 - 1.39 int CallLeafNoFPDirectNode::compute_padding(int current_offset) const { 1.40 //lui 1.41 //ori 1.42 @@ -3376,9 +3344,7 @@ 1.43 cbuf.set_insts_mark(); 1.44 __ relocate(relocInfo::runtime_call_type); 1.45 1.46 - __ patchable_set48(T9, (long)$meth$$method); 1.47 - __ jalr(T9); 1.48 - __ nop(); 1.49 + __ general_jal((address)$meth$$method); 1.50 %} 1.51 1.52 enc_class Java_Static_Call (method meth) %{ // JAVA STATIC CALL 1.53 @@ -12144,7 +12110,6 @@ 1.54 ins_encode( Java_Static_Call( meth ) ); 1.55 ins_pipe( pipe_slow ); 1.56 ins_pc_relative(1); 1.57 - ins_alignment(16); 1.58 %} 1.59 1.60 // Call Java Dynamic Instruction 1.61 @@ -12160,7 +12125,6 @@ 1.62 ins_encode( Java_Dynamic_Call( meth ) ); 1.63 ins_pipe( pipe_slow ); 1.64 ins_pc_relative(1); 1.65 - ins_alignment(16); 1.66 %} 1.67 1.68 instruct CallLeafNoFPDirect(method meth) %{
2.1 --- a/src/cpu/mips/vm/nativeInst_mips.cpp Fri Mar 17 22:15:27 2017 +0800 2.2 +++ b/src/cpu/mips/vm/nativeInst_mips.cpp Sat Mar 18 07:08:36 2017 +0800 2.3 @@ -435,23 +435,22 @@ 2.4 set_int_at(16, jal_inst); 2.5 ICache::invalidate_range(addr_at(16), 4); 2.6 } else { 2.7 - patch_set48_gs(dst); 2.8 - ICache::invalidate_range(addr_at(0), 16); 2.9 - guarantee(false, "Not implement yet !"); 2.10 + ShouldNotReachHere(); 2.11 } 2.12 } 2.13 2.14 void NativeCall::patch_on_jal(address dst) { 2.15 - guarantee(false, "Not implement yet !"); 2.16 + patch_on_jal_gs(dst); 2.17 } 2.18 2.19 void NativeCall::patch_on_jalr_gs(address dst) { 2.20 - patch_set48_gs(dst); 2.21 - ICache::invalidate_range(addr_at(0), 16); 2.22 + patch_set48_gs(dst); 2.23 + ICache::invalidate_range(addr_at(0), 16); 2.24 } 2.25 2.26 void NativeCall::patch_on_jalr(address dst) { 2.27 - guarantee(false, "Not implement yet !"); 2.28 + patch_set48(dst); 2.29 + ICache::invalidate_range(addr_at(0), 16); 2.30 } 2.31 2.32 void NativeCall::patch_set48_gs(address dest) { 2.33 @@ -676,7 +675,6 @@ 2.34 ICache::invalidate_range(addr_at(0), 24); 2.35 } else if (is_op(int_at(16), Assembler::jal_op)) { 2.36 if (UseLoongsonISA) { 2.37 - guarantee(!os::is_MP() || (((long)addr_at(0) % 16) == 0), "destination must be aligned for GSSD"); 2.38 patch_on_jal_gs(dest); 2.39 } else { 2.40 patch_on_jal(dest);