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 ↓ 409 lines elided ↑ open up ↑
 410  410  
 411  411    // Argument registers for _raise_exception.
 412  412    const Register O0_code     = O0;
 413  413    const Register O1_actual   = O1;
 414  414    const Register O2_required = O2;
 415  415  
 416  416    guarantee(java_dyn_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets");
 417  417  
 418  418    // Some handy addresses:
 419  419    Address G5_method_fie(    G5_method,        in_bytes(methodOopDesc::from_interpreted_offset()));
      420 +  Address G5_method_fce(    G5_method,        in_bytes(methodOopDesc::from_compiled_offset()));
 420  421  
 421  422    Address G3_mh_vmtarget(   G3_method_handle, java_dyn_MethodHandle::vmtarget_offset_in_bytes());
 422  423  
 423  424    Address G3_dmh_vmindex(   G3_method_handle, sun_dyn_DirectMethodHandle::vmindex_offset_in_bytes());
 424  425  
 425  426    Address G3_bmh_vmargslot( G3_method_handle, sun_dyn_BoundMethodHandle::vmargslot_offset_in_bytes());
 426  427    Address G3_bmh_argument(  G3_method_handle, sun_dyn_BoundMethodHandle::argument_offset_in_bytes());
 427  428  
 428  429    Address G3_amh_vmargslot( G3_method_handle, sun_dyn_AdapterMethodHandle::vmargslot_offset_in_bytes());
 429  430    Address G3_amh_argument ( G3_method_handle, sun_dyn_AdapterMethodHandle::argument_offset_in_bytes());
↓ open down ↓ 7 lines elided ↑ open up ↑
 437  438    }
 438  439  
 439  440    address interp_entry = __ pc();
 440  441  
 441  442    trace_method_handle(_masm, entry_name(ek));
 442  443  
 443  444    switch ((int) ek) {
 444  445    case _raise_exception:
 445  446      {
 446  447        // Not a real MH entry, but rather shared code for raising an
 447      -      // exception.  Since we use a C2I adapter to set up the
 448      -      // interpreter state, arguments are expected in compiler
 449      -      // argument registers.
      448 +      // exception.  Since we use the compiled entry, arguments are
      449 +      // expected in compiler argument registers.
 450  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");
      451 +      assert(raise_exception_method()->from_compiled_entry(), "method must be linked");
 453  452  
 454  453        __ mov(O5_savedSP, SP);  // Cut the stack back to where the caller started.
 455  454  
 456  455        Label L_no_method;
 457  456        // FIXME: fill in _raise_exception_method with a suitable sun.dyn method
 458  457        __ set(AddressLiteral((address) &_raise_exception_method), G5_method);
 459  458        __ ld_ptr(Address(G5_method, 0), G5_method);
 460  459        __ tst(G5_method);
 461  460        __ brx(Assembler::zero, false, Assembler::pn, L_no_method);
 462  461        __ delayed()->nop();
 463  462  
 464  463        const int jobject_oop_offset = 0;
 465  464        __ ld_ptr(Address(G5_method, jobject_oop_offset), G5_method);
 466  465        __ tst(G5_method);
 467  466        __ brx(Assembler::zero, false, Assembler::pn, L_no_method);
 468  467        __ delayed()->nop();
 469  468  
 470  469        __ verify_oop(G5_method);
 471      -      __ jump_to(AddressLiteral(c2i_entry), O3_scratch);
      470 +      __ jump_indirect_to(G5_method_fce, O3_scratch);  // jump to compiled entry
 472  471        __ delayed()->nop();
 473  472  
 474      -      // If we get here, the Java runtime did not do its job of creating the exception.
 475  473        // Do something that is at least causes a valid throw from the interpreter.
 476  474        __ bind(L_no_method);
 477  475        __ unimplemented("call throw_WrongMethodType_entry");
 478  476      }
 479  477      break;
 480  478  
 481  479    case _invokestatic_mh:
 482  480    case _invokespecial_mh:
 483  481      {
 484  482        __ load_heap_oop(G3_mh_vmtarget, G5_method);  // target is a methodOop
↓ open down ↓ 544 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX