Print this page


Split Close
Expand all
Collapse all
          --- old/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
          +++ new/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
↓ open down ↓ 143 lines elided ↑ open up ↑
 144  144    address entry = __ pc();
 145  145    // expression stack must be empty before entering the VM if an exception happened
 146  146    __ empty_expression_stack();
 147  147    __ call_VM(Oexception, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_StackOverflowError));
 148  148    __ should_not_reach_here();
 149  149    return entry;
 150  150  }
 151  151  
 152  152  
 153  153  address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) {
 154      -  address compiled_entry = __ pc();
      154 +  TosState incoming_state = state;
      155 +
 155  156    Label cont;
      157 +  address compiled_entry = __ pc();
 156  158  
 157  159    address entry = __ pc();
 158  160  #if !defined(_LP64) && defined(COMPILER2)
 159  161    // All return values are where we want them, except for Longs.  C2 returns
 160  162    // longs in G1 in the 32-bit build whereas the interpreter wants them in O0/O1.
 161  163    // Since the interpreter will return longs in G1 and O0/O1 in the 32bit
 162  164    // build even if we are returning from interpreted we just do a little
 163  165    // stupid shuffing.
 164  166    // Note: I tried to make c2 return longs in O0/O1 and G1 so we wouldn't have to
 165  167    // do this here. Unfortunately if we did a rethrow we'd see an machepilog node
 166  168    // first which would move g1 -> O0/O1 and destroy the exception we were throwing.
 167  169  
 168      -  if( state == ltos ) {
 169      -    __ srl (G1, 0,O1);
 170      -    __ srlx(G1,32,O0);
      170 +  if (incoming_state == ltos) {
      171 +    __ srl (G1,  0, O1);
      172 +    __ srlx(G1, 32, O0);
 171  173    }
 172      -#endif /* !_LP64 && COMPILER2 */
 173      -
      174 +#endif // !_LP64 && COMPILER2
 174  175  
 175  176    __ bind(cont);
 176  177  
 177  178    // The callee returns with the stack possibly adjusted by adapter transition
 178  179    // We remove that possible adjustment here.
 179  180    // All interpreter local registers are untouched. Any result is passed back
 180  181    // in the O0/O1 or float registers. Before continuing, the arguments must be
 181  182    // popped from the java expression stack; i.e., Lesp must be adjusted.
 182  183  
 183  184    __ mov(Llast_SP, SP);   // Remove any adapter added stack space.
 184  185  
 185      -
      186 +  Label L_got_cache, L_giant_index;
 186  187    const Register cache = G3_scratch;
 187  188    const Register size  = G1_scratch;
      189 +  if (EnableInvokeDynamic) {
      190 +    __ ldub(Address(Lbcp, 0), G1_scratch);  // Load current bytecode.
      191 +    __ cmp(G1_scratch, Bytecodes::_invokedynamic);
      192 +    __ br(Assembler::equal, false, Assembler::pn, L_giant_index);
      193 +    __ delayed()->nop();
      194 +  }
 188  195    __ get_cache_and_index_at_bcp(cache, G1_scratch, 1);
      196 +  __ bind(L_got_cache);
 189  197    __ ld_ptr(cache, constantPoolCacheOopDesc::base_offset() +
 190  198                     ConstantPoolCacheEntry::flags_offset(), size);
 191  199    __ and3(size, 0xFF, size);                   // argument size in words
 192  200    __ sll(size, Interpreter::logStackElementSize(), size); // each argument size in bytes
 193  201    __ add(Lesp, size, Lesp);                    // pop arguments
 194  202    __ dispatch_next(state, step);
 195  203  
      204 +  // out of the main line of code...
      205 +  if (EnableInvokeDynamic) {
      206 +    __ bind(L_giant_index);
      207 +    __ get_cache_and_index_at_bcp(cache, G1_scratch, 1, true);
      208 +    __ ba(false, L_got_cache);
      209 +    __ delayed()->nop();
      210 +  }
      211 +
 196  212    return entry;
 197  213  }
 198  214  
 199  215  
 200  216  address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, int step) {
 201  217    address entry = __ pc();
 202  218    __ get_constant_pool_cache(LcpoolCache); // load LcpoolCache
 203  219    { Label L;
 204  220      Address exception_addr(G2_thread, Thread::pending_exception_offset());
 205  221      __ ld_ptr(exception_addr, Gtemp);  // Load pending exception.
↓ open down ↓ 1765 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX