methodHandles_x86.cpp (1976:8d0b933dda2d) | methodHandles_x86.cpp (2001:d810e9a3fc33) |
---|---|
1/* | 1/* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or --- 374 unchanged lines hidden (view full) --- 385 // FIXME: MethodHandlesTest gets a crash if we enable OP_SPREAD_ARGS. 386} 387 388//------------------------------------------------------------------------------ 389// MethodHandles::generate_method_handle_stub 390// 391// Generate an "entry" field for a method handle. 392// This determines how the method handle will respond to calls. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or --- 374 unchanged lines hidden (view full) --- 385 // FIXME: MethodHandlesTest gets a crash if we enable OP_SPREAD_ARGS. 386} 387 388//------------------------------------------------------------------------------ 389// MethodHandles::generate_method_handle_stub 390// 391// Generate an "entry" field for a method handle. 392// This determines how the method handle will respond to calls. |
393void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek, TRAPS) { | 393void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek) { |
394 // Here is the register state during an interpreted call, 395 // as set up by generate_method_handle_interpreter_entry(): 396 // - rbx: garbage temp (was MethodHandle.invoke methodOop, unused) 397 // - rcx: receiver method handle 398 // - rax: method handle type (only used by the check_mtype entry point) 399 // - rsi/r13: sender SP (must preserve; see prepare_to_jump_from_interpreted) 400 // - rdx: garbage temp, can blow away 401 --- 44 unchanged lines hidden (view full) --- 446 447 switch ((int) ek) { 448 case _raise_exception: 449 { 450 // Not a real MH entry, but rather shared code for raising an 451 // exception. Since we use a C2I adapter to set up the 452 // interpreter state, arguments are expected in compiler 453 // argument registers. | 394 // Here is the register state during an interpreted call, 395 // as set up by generate_method_handle_interpreter_entry(): 396 // - rbx: garbage temp (was MethodHandle.invoke methodOop, unused) 397 // - rcx: receiver method handle 398 // - rax: method handle type (only used by the check_mtype entry point) 399 // - rsi/r13: sender SP (must preserve; see prepare_to_jump_from_interpreted) 400 // - rdx: garbage temp, can blow away 401 --- 44 unchanged lines hidden (view full) --- 446 447 switch ((int) ek) { 448 case _raise_exception: 449 { 450 // Not a real MH entry, but rather shared code for raising an 451 // exception. Since we use a C2I adapter to set up the 452 // interpreter state, arguments are expected in compiler 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 const Register rdi_pc = rax; 458 __ pop(rdi_pc); // caller PC 459 __ mov(rsp, saved_last_sp); // cut the stack back to where the caller started 460 461 Register rbx_method = rbx_temp; 462 Label L_no_method; 463 // FIXME: fill in _raise_exception_method with a suitable sun.dyn method --- 766 unchanged lines hidden --- | 457 458 const Register rdi_pc = rax; 459 __ pop(rdi_pc); // caller PC 460 __ mov(rsp, saved_last_sp); // cut the stack back to where the caller started 461 462 Register rbx_method = rbx_temp; 463 Label L_no_method; 464 // FIXME: fill in _raise_exception_method with a suitable sun.dyn method --- 766 unchanged lines hidden --- |