Print this page


Split Close
Expand all
Collapse all
          --- old/src/cpu/sparc/vm/methodHandles_sparc.cpp
          +++ new/src/cpu/sparc/vm/methodHandles_sparc.cpp
↓ open down ↓ 387 lines elided ↑ open up ↑
 388  388           //|(1<<sun_dyn_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG!
 389  389           );
 390  390    // FIXME: MethodHandlesTest gets a crash if we enable OP_SPREAD_ARGS.
 391  391  }
 392  392  
 393  393  //------------------------------------------------------------------------------
 394  394  // MethodHandles::generate_method_handle_stub
 395  395  //
 396  396  // Generate an "entry" field for a method handle.
 397  397  // This determines how the method handle will respond to calls.
 398      -void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek, TRAPS) {
      398 +void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek) {
 399  399    // Here is the register state during an interpreted call,
 400  400    // as set up by generate_method_handle_interpreter_entry():
 401  401    // - G5: garbage temp (was MethodHandle.invoke methodOop, unused)
 402  402    // - G3: receiver method handle
 403  403    // - O5_savedSP: sender SP (must preserve)
 404  404  
 405  405    const Register O0_argslot = O0;
 406  406    const Register O1_scratch = O1;
 407  407    const Register O2_scratch = O2;
 408  408    const Register O3_scratch = O3;
↓ open down ↓ 31 lines elided ↑ open up ↑
 440  440  
 441  441    trace_method_handle(_masm, entry_name(ek));
 442  442  
 443  443    switch ((int) ek) {
 444  444    case _raise_exception:
 445  445      {
 446  446        // Not a real MH entry, but rather shared code for raising an
 447  447        // exception.  Since we use a C2I adapter to set up the
 448  448        // interpreter state, arguments are expected in compiler
 449  449        // argument registers.
 450      -      methodHandle mh(raise_exception_method());
 451      -      address c2i_entry = methodOopDesc::make_adapters(mh, CATCH);
      450 +      assert(raise_exception_method(), "must be set");
      451 +      address c2i_entry = raise_exception_method()->get_c2i_entry();
      452 +      assert(c2i_entry, "method must be linked");
 452  453  
 453  454        __ mov(O5_savedSP, SP);  // Cut the stack back to where the caller started.
 454  455  
 455  456        Label L_no_method;
 456  457        // FIXME: fill in _raise_exception_method with a suitable sun.dyn method
 457  458        __ set(AddressLiteral((address) &_raise_exception_method), G5_method);
 458  459        __ ld_ptr(Address(G5_method, 0), G5_method);
 459  460        __ tst(G5_method);
 460  461        __ brx(Assembler::zero, false, Assembler::pn, L_no_method);
 461  462        __ delayed()->nop();
↓ open down ↓ 575 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX