src/cpu/mips/vm/templateInterpreter_mips_64.cpp

changeset 6895
34448c1bea2d
parent 6894
c3f0dbba118a
child 6896
ada5000bdb38
     1.1 --- a/src/cpu/mips/vm/templateInterpreter_mips_64.cpp	Tue Sep 26 11:18:59 2017 +0800
     1.2 +++ b/src/cpu/mips/vm/templateInterpreter_mips_64.cpp	Tue Sep 26 15:22:25 2017 +0800
     1.3 @@ -314,7 +314,7 @@
     1.4          Label* profile_method,
     1.5          Label* profile_method_continue) {
     1.6    Label done;
     1.7 -  const Address invocation_counter(FSR, in_bytes(MethodCounters::invocation_counter_offset())  //Fu:20130814  Wang:Rmethod --> FSR
     1.8 +  const Address invocation_counter(FSR, in_bytes(MethodCounters::invocation_counter_offset())
     1.9        + in_bytes(InvocationCounter::counter_offset()));
    1.10    const Address backedge_counter  (FSR, in_bytes(MethodCounters::backedge_counter_offset())
    1.11        + in_bytes(InvocationCounter::counter_offset()));
    1.12 @@ -339,9 +339,14 @@
    1.13  
    1.14    if (ProfileInterpreter && profile_method != NULL) {
    1.15      // Test to see if we should create a method data oop
    1.16 -    __ li(AT, (long)&InvocationCounter::InterpreterProfileLimit);
    1.17 -    __ lw(AT, AT, 0);
    1.18 -    __ slt(AT, T3, AT);
    1.19 +    if (Assembler::is_simm16(InvocationCounter::InterpreterProfileLimit)) {
    1.20 +      __ slti(AT, T3, InvocationCounter::InterpreterProfileLimit);
    1.21 +    } else {
    1.22 +      __ li(AT, (long)&InvocationCounter::InterpreterProfileLimit);
    1.23 +      __ lw(AT, AT, 0);
    1.24 +      __ slt(AT, T3, AT);
    1.25 +    }
    1.26 +
    1.27      __ bne(AT, R0, *profile_method_continue);
    1.28      __ delayed()->nop();
    1.29  
    1.30 @@ -349,9 +354,15 @@
    1.31      __ test_method_data_pointer(FSR, *profile_method);
    1.32    }
    1.33  
    1.34 -  __ li(AT, (long)&InvocationCounter::InterpreterInvocationLimit);
    1.35 -  __ lw(AT, AT, 0);
    1.36 -  __ slt(AT, T3, AT);
    1.37 +  if (Assembler::is_simm16(CompileThreshold)) {
    1.38 +    __ srl(AT, T3, InvocationCounter::count_shift);
    1.39 +    __ slti(AT, AT, CompileThreshold);
    1.40 +  } else {
    1.41 +    __ li(AT, (long)&InvocationCounter::InterpreterInvocationLimit);
    1.42 +    __ lw(AT, AT, 0);
    1.43 +    __ slt(AT, T3, AT);
    1.44 +  }
    1.45 +
    1.46    __ beq(AT, R0, *overflow);
    1.47    __ delayed()->nop();
    1.48    __ bind(done);
    1.49 @@ -1415,19 +1426,9 @@
    1.50    // Rmethod: Method*
    1.51    // Rsender: sender 's sp
    1.52    address entry_point = __ pc();
    1.53 -  /*
    1.54 -#ifndef CORE
    1.55 -  // check if compiled code exists
    1.56 -  Label run_compiled_code;
    1.57 -  if (!CompileTheWorld) {
    1.58 -  check_for_compiled_code(run_compiled_code);
    1.59 -  }
    1.60 -#endif
    1.61 -   */
    1.62 -#ifndef CORE
    1.63 +
    1.64    const Address invocation_counter(Rmethod,
    1.65        in_bytes(MethodCounters::invocation_counter_offset() + InvocationCounter::counter_offset()));
    1.66 -#endif
    1.67  
    1.68    // get parameter size (always needed)
    1.69    __ ld(T3, Rmethod, in_bytes(Method::const_offset()));  //T3 --> Rmethod._constMethod
    1.70 @@ -1462,18 +1463,18 @@
    1.71      Label exit, loop;
    1.72      __ beq(T2, R0, exit);
    1.73      __ delayed()->nop();
    1.74 +
    1.75      __ bind(loop);
    1.76      __ sd(R0, SP, -1 * wordSize);     // initialize local variables
    1.77      __ daddiu(T2, T2, -1);               // until everything initialized
    1.78      __ bne(T2, R0, loop);
    1.79      __ delayed();
    1.80 +
    1.81      __ daddiu(SP, SP, (-1) * wordSize); //fill delay slot
    1.82 +
    1.83      __ bind(exit);
    1.84    }
    1.85  
    1.86 -#ifndef CORE
    1.87 -  if (inc_counter) __ lw(T3, invocation_counter);  // (pre-)fetch invocation count
    1.88 -#endif
    1.89    //
    1.90    // [ local var m-1  ] <--- sp
    1.91    //   ...
    1.92 @@ -1633,7 +1634,6 @@
    1.93  
    1.94    __ dispatch_next(vtos);
    1.95  
    1.96 -#ifndef CORE
    1.97    // invocation counter overflow
    1.98    if (inc_counter) {
    1.99      if (ProfileInterpreter) {
   1.100 @@ -1651,7 +1651,6 @@
   1.101      generate_counter_overflow(&continue_after_compile);
   1.102    }
   1.103  
   1.104 -#endif
   1.105    return entry_point;
   1.106  }
   1.107  

mercurial