Print this page
rev 1071 : 6829192: JSR 292 needs to support 64-bit x86
Summary: changes for method handles and invokedynamic
Reviewed-by: ?, ?
rev 1072 : [mq]: meth.walker.patch

Split Close
Expand all
Collapse all
          --- old/src/cpu/x86/vm/methodHandles_x86.cpp
          +++ new/src/cpu/x86/vm/methodHandles_x86.cpp
↓ open down ↓ 260 lines elided ↑ open up ↑
 261  261      __ jcc(Assembler::greaterEqual, loop);
 262  262    }
 263  263  
 264  264    // Now move the argslot up, to point to the just-copied block.
 265  265    __ lea(rsp, Address(rsp, arg_slots, Address::times_ptr));
 266  266    // And adjust the argslot address to point at the deletion point.
 267  267    __ lea(rax_argslot, Address(rax_argslot, arg_slots, Address::times_ptr));
 268  268  }
 269  269  
 270  270  #ifndef PRODUCT
      271 +extern "C" void print_method_handle(oopDesc* mh);
 271  272  void trace_method_handle_stub(const char* adaptername,
 272  273                                oopDesc* mh,
 273  274                                intptr_t* entry_sp,
 274  275                                intptr_t* saved_sp,
 275  276                                intptr_t* saved_bp) {
 276  277    // called as a leaf from native code: do not block the JVM!
 277  278    intptr_t* last_sp = (intptr_t*) saved_bp[frame::interpreter_frame_last_sp_offset];
 278  279    intptr_t* base_sp = (intptr_t*) saved_bp[frame::interpreter_frame_monitor_block_top_offset];
 279  280    printf("MH %s mh="INTPTR_FORMAT" sp=("INTPTR_FORMAT"+"INTX_FORMAT") stack_size="INTX_FORMAT" bp="INTPTR_FORMAT"\n",
 280  281           adaptername, (intptr_t)mh, (intptr_t)entry_sp, (intptr_t)(saved_sp - entry_sp), (intptr_t)(base_sp - last_sp), (intptr_t)saved_bp);
 281  282    if (last_sp != saved_sp)
 282  283      printf("*** last_sp="INTPTR_FORMAT"\n", (intptr_t)last_sp);
      284 +  if (Verbose)  print_method_handle(mh);
 283  285  }
 284  286  #endif //PRODUCT
 285  287  
 286  288  // Generate an "entry" field for a method handle.
 287  289  // This determines how the method handle will respond to calls.
 288  290  void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek) {
 289  291    // Here is the register state during an interpreted call,
 290  292    // as set up by generate_method_handle_interpreter_entry():
 291  293    // - rbx: garbage temp (was MethodHandle.invoke methodOop, unused)
 292  294    // - rcx: receiver method handle
↓ open down ↓ 885 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX