Print this page


Split Close
Expand all
Collapse all
          --- old/src/cpu/x86/vm/methodHandles_x86.cpp
          +++ new/src/cpu/x86/vm/methodHandles_x86.cpp
↓ open down ↓ 382 lines elided ↑ open up ↑
 383  383           //|(1<<sun_dyn_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG!
 384  384           );
 385  385    // FIXME: MethodHandlesTest gets a crash if we enable OP_SPREAD_ARGS.
 386  386  }
 387  387  
 388  388  //------------------------------------------------------------------------------
 389  389  // MethodHandles::generate_method_handle_stub
 390  390  //
 391  391  // Generate an "entry" field for a method handle.
 392  392  // This determines how the method handle will respond to calls.
 393      -void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek, TRAPS) {
      393 +void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek) {
 394  394    // Here is the register state during an interpreted call,
 395  395    // as set up by generate_method_handle_interpreter_entry():
 396  396    // - rbx: garbage temp (was MethodHandle.invoke methodOop, unused)
 397  397    // - rcx: receiver method handle
 398  398    // - rax: method handle type (only used by the check_mtype entry point)
 399  399    // - rsi/r13: sender SP (must preserve; see prepare_to_jump_from_interpreted)
 400  400    // - rdx: garbage temp, can blow away
 401  401  
 402  402    const Register rcx_recv    = rcx;
 403  403    const Register rax_argslot = rax;
↓ open down ↓ 40 lines elided ↑ open up ↑
 444  444  
 445  445    BLOCK_COMMENT(entry_name(ek));
 446  446  
 447  447    switch ((int) ek) {
 448  448    case _raise_exception:
 449  449      {
 450  450        // Not a real MH entry, but rather shared code for raising an
 451  451        // exception.  Since we use a C2I adapter to set up the
 452  452        // interpreter state, arguments are expected in compiler
 453  453        // argument registers.
 454      -      methodHandle mh(raise_exception_method());
 455      -      address c2i_entry = methodOopDesc::make_adapters(mh, CHECK);
      454 +      assert(raise_exception_method(), "must be set");
      455 +      address c2i_entry = raise_exception_method()->get_c2i_entry();
      456 +      assert(c2i_entry, "method must be linked");
 456  457  
 457  458        const Register rdi_pc = rax;
 458  459        __ pop(rdi_pc);  // caller PC
 459  460        __ mov(rsp, saved_last_sp);  // cut the stack back to where the caller started
 460  461  
 461  462        Register rbx_method = rbx_temp;
 462  463        Label L_no_method;
 463  464        // FIXME: fill in _raise_exception_method with a suitable sun.dyn method
 464  465        __ movptr(rbx_method, ExternalAddress((address) &_raise_exception_method));
 465  466        __ testptr(rbx_method, rbx_method);
↓ open down ↓ 764 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX