src/cpu/sparc/vm/templateTable_sparc.cpp

changeset 1957
136b78722a08
parent 1934
e9ff18c4ace7
child 2036
126ea7725993
     1.1 --- a/src/cpu/sparc/vm/templateTable_sparc.cpp	Mon Jun 07 14:17:01 2010 -0700
     1.2 +++ b/src/cpu/sparc/vm/templateTable_sparc.cpp	Wed Jun 09 18:50:45 2010 -0700
     1.3 @@ -318,6 +318,31 @@
     1.4    __ bind(exit);
     1.5  }
     1.6  
     1.7 +// Fast path for caching oop constants.
     1.8 +// %%% We should use this to handle Class and String constants also.
     1.9 +// %%% It will simplify the ldc/primitive path considerably.
    1.10 +void TemplateTable::fast_aldc(bool wide) {
    1.11 +  transition(vtos, atos);
    1.12 +
    1.13 +  if (!EnableMethodHandles) {
    1.14 +    // We should not encounter this bytecode if !EnableMethodHandles.
    1.15 +    // The verifier will stop it.  However, if we get past the verifier,
    1.16 +    // this will stop the thread in a reasonable way, without crashing the JVM.
    1.17 +    __ call_VM(noreg, CAST_FROM_FN_PTR(address,
    1.18 +                     InterpreterRuntime::throw_IncompatibleClassChangeError));
    1.19 +    // the call_VM checks for exception, so we should never return here.
    1.20 +    __ should_not_reach_here();
    1.21 +    return;
    1.22 +  }
    1.23 +
    1.24 +  Register Rcache = G3_scratch;
    1.25 +  Register Rscratch = G4_scratch;
    1.26 +
    1.27 +  resolve_cache_and_index(f1_oop, Otos_i, Rcache, Rscratch, wide ? sizeof(u2) : sizeof(u1));
    1.28 +
    1.29 +  __ verify_oop(Otos_i);
    1.30 +}
    1.31 +
    1.32  void TemplateTable::ldc2_w() {
    1.33    transition(vtos, vtos);
    1.34    Label retry, resolved, Long, exit;
    1.35 @@ -1994,6 +2019,8 @@
    1.36      case Bytecodes::_invokestatic   : // fall through
    1.37      case Bytecodes::_invokeinterface: entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke);  break;
    1.38      case Bytecodes::_invokedynamic  : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic);  break;
    1.39 +    case Bytecodes::_fast_aldc      : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc);     break;
    1.40 +    case Bytecodes::_fast_aldc_w    : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc);     break;
    1.41      default                         : ShouldNotReachHere();                                 break;
    1.42    }
    1.43    // first time invocation - must resolve first

mercurial