Mon, 18 Sep 2017 15:15:14 +0800
[Interpreter] Refine the template of ldc.
src/cpu/mips/vm/templateTable_mips_64.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/mips/vm/templateTable_mips_64.cpp Mon Sep 18 14:54:20 2017 +0800 1.2 +++ b/src/cpu/mips/vm/templateTable_mips_64.cpp Mon Sep 18 15:15:14 2017 +0800 1.3 @@ -259,8 +259,7 @@ 1.4 Label call_ldc, notFloat, notClass, Done; 1.5 // get index in cpool 1.6 if (wide) { 1.7 - __ get_2_byte_integer_at_bcp(T2, AT, 1); 1.8 - __ huswap(T2); 1.9 + __ get_unsigned_2_byte_index_at_bcp(T2, 1); 1.10 } else { 1.11 __ lbu(T2, at_bcp(1)); 1.12 } 1.13 @@ -271,8 +270,12 @@ 1.14 const int tags_offset = Array<u1>::base_offset_in_bytes(); 1.15 1.16 // get type 1.17 - __ dadd(AT, T1, T2); 1.18 - __ lb(T1, AT, tags_offset); 1.19 + if (UseLoongsonISA && Assembler::is_simm(sizeof(tags_offset), 8)) { 1.20 + __ gslbx(T1, T1, T2, tags_offset); 1.21 + } else { 1.22 + __ dadd(AT, T1, T2); 1.23 + __ lb(T1, AT, tags_offset); 1.24 + } 1.25 //now T1 is the tag 1.26 1.27 // unresolved class - get the resolved class 1.28 @@ -292,23 +295,29 @@ 1.29 __ delayed()->dsll(T2, T2, Address::times_8); 1.30 1.31 __ bind(call_ldc); 1.32 - 1.33 __ move(A1, wide); 1.34 call_VM(FSR, CAST_FROM_FN_PTR(address, InterpreterRuntime::ldc), A1); 1.35 - __ push(atos); 1.36 + //__ push(atos); 1.37 + __ sd(FSR, SP, - Interpreter::stackElementSize); 1.38 __ b(Done); 1.39 - __ delayed()->nop(); 1.40 + __ delayed()->daddiu(SP, SP, - Interpreter::stackElementSize); 1.41 + __ nop(); // added for performance issue 1.42 + 1.43 __ bind(notClass); 1.44 - 1.45 __ daddiu(AT, T1, -JVM_CONSTANT_Float); 1.46 __ bne(AT, R0, notFloat); 1.47 __ delayed()->nop(); 1.48 // ftos 1.49 - __ dadd(AT, T3, T2); 1.50 - __ lwc1(FSF, AT, base_offset); 1.51 - __ push_f(); 1.52 + if (UseLoongsonISA && Assembler::is_simm(sizeof(base_offset), 8)) { 1.53 + __ gslwxc1(FSF, T3, T2, base_offset); 1.54 + } else { 1.55 + __ dadd(AT, T3, T2); 1.56 + __ lwc1(FSF, AT, base_offset); 1.57 + } 1.58 + //__ push_f(); 1.59 + __ swc1(FSF, SP, - Interpreter::stackElementSize); 1.60 __ b(Done); 1.61 - __ delayed()->nop(); 1.62 + __ delayed()->daddiu(SP, SP, - Interpreter::stackElementSize); 1.63 1.64 __ bind(notFloat); 1.65 #ifdef ASSERT 1.66 @@ -321,18 +330,14 @@ 1.67 __ bind(L); 1.68 } 1.69 #endif 1.70 - // atos and itos 1.71 - __ dadd(T0, T3, T2); 1.72 - __ lw(FSR, T0, base_offset); 1.73 + // itos JVM_CONSTANT_Integer only 1.74 + if (UseLoongsonISA && Assembler::is_simm(sizeof(base_offset), 8)) { 1.75 + __ gslwx(FSR, T3, T2, base_offset); 1.76 + } else { 1.77 + __ dadd(T0, T3, T2); 1.78 + __ lw(FSR, T0, base_offset); 1.79 + } 1.80 __ push(itos); 1.81 - __ b(Done); 1.82 - __ delayed()->nop(); 1.83 - 1.84 - 1.85 - if (VerifyOops) { 1.86 - __ verify_oop(FSR); 1.87 - } 1.88 - 1.89 __ bind(Done); 1.90 } 1.91