Mercurial > hg > graal-jvmci-8
diff src/cpu/x86/vm/methodHandles_x86.cpp @ 1513:df736661d0c8
Merge
author | jrose |
---|---|
date | Tue, 11 May 2010 15:19:19 -0700 |
parents | cd5dbf694d45 |
children | c18cbe5936b8 |
line wrap: on
line diff
--- a/src/cpu/x86/vm/methodHandles_x86.cpp Mon May 10 14:58:38 2010 -0700 +++ b/src/cpu/x86/vm/methodHandles_x86.cpp Tue May 11 15:19:19 2010 -0700 @@ -127,7 +127,8 @@ RegisterOrConstant arg_slots, int arg_mask, Register rax_argslot, - Register rbx_temp, Register rdx_temp) { + Register rbx_temp, Register rdx_temp, Register temp3_reg) { + assert(temp3_reg == noreg, "temp3 not required"); assert_different_registers(rax_argslot, rbx_temp, rdx_temp, (!arg_slots.is_register() ? rsp : arg_slots.as_register())); @@ -185,7 +186,8 @@ void MethodHandles::remove_arg_slots(MacroAssembler* _masm, RegisterOrConstant arg_slots, Register rax_argslot, - Register rbx_temp, Register rdx_temp) { + Register rbx_temp, Register rdx_temp, Register temp3_reg) { + assert(temp3_reg == noreg, "temp3 not required"); assert_different_registers(rax_argslot, rbx_temp, rdx_temp, (!arg_slots.is_register() ? rsp : arg_slots.as_register())); @@ -260,6 +262,22 @@ } #endif //PRODUCT +// which conversion op types are implemented here? +int MethodHandles::adapter_conversion_ops_supported_mask() { + return ((1<<sun_dyn_AdapterMethodHandle::OP_RETYPE_ONLY) + |(1<<sun_dyn_AdapterMethodHandle::OP_RETYPE_RAW) + |(1<<sun_dyn_AdapterMethodHandle::OP_CHECK_CAST) + |(1<<sun_dyn_AdapterMethodHandle::OP_PRIM_TO_PRIM) + |(1<<sun_dyn_AdapterMethodHandle::OP_REF_TO_PRIM) + |(1<<sun_dyn_AdapterMethodHandle::OP_SWAP_ARGS) + |(1<<sun_dyn_AdapterMethodHandle::OP_ROT_ARGS) + |(1<<sun_dyn_AdapterMethodHandle::OP_DUP_ARGS) + |(1<<sun_dyn_AdapterMethodHandle::OP_DROP_ARGS) + //|(1<<sun_dyn_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG! + ); + // FIXME: MethodHandlesTest gets a crash if we enable OP_SPREAD_ARGS. +} + // Generate an "entry" field for a method handle. // This determines how the method handle will respond to calls. void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek) { @@ -498,7 +516,7 @@ #ifndef _LP64 if (arg_slots == 2) { __ movl(rdx_temp, prim_value_addr.plus_disp(wordSize)); - __ movl(Address(rax_argslot, Interpreter::stackElementSize()), rdx_temp); + __ movl(Address(rax_argslot, Interpreter::stackElementSize), rdx_temp); } #endif //_LP64 } @@ -594,7 +612,7 @@ __ lea(rax_argslot, __ argument_address(rax_argslot, 1)); remove_arg_slots(_masm, -stack_move_unit(), rax_argslot, rbx_temp, rdx_temp); - vmarg = Address(rax_argslot, -Interpreter::stackElementSize()); + vmarg = Address(rax_argslot, -Interpreter::stackElementSize); __ movl(rdx_temp, vmarg); } break; @@ -663,8 +681,8 @@ __ lea(rax_argslot, __ argument_address(rax_argslot, 1)); insert_arg_slots(_masm, stack_move_unit(), _INSERT_INT_MASK, rax_argslot, rbx_temp, rdx_temp); - Address vmarg1(rax_argslot, -Interpreter::stackElementSize()); - Address vmarg2 = vmarg1.plus_disp(Interpreter::stackElementSize()); + Address vmarg1(rax_argslot, -Interpreter::stackElementSize); + Address vmarg2 = vmarg1.plus_disp(Interpreter::stackElementSize); switch (ek) { case _adapter_opt_i2l: @@ -716,7 +734,7 @@ insert_arg_slots(_masm, stack_move_unit(), _INSERT_INT_MASK, rax_argslot, rbx_temp, rdx_temp); } - Address vmarg(rax_argslot, -Interpreter::stackElementSize()); + Address vmarg(rax_argslot, -Interpreter::stackElementSize); #ifdef _LP64 if (ek == _adapter_opt_f2d) { @@ -1014,7 +1032,7 @@ // Array length checks out. Now insert any required stack slots. if (length_constant == -1) { // Form a pointer to the end of the affected region. - __ lea(rdx_argslot_limit, Address(rax_argslot, Interpreter::stackElementSize())); + __ lea(rdx_argslot_limit, Address(rax_argslot, Interpreter::stackElementSize)); // 'stack_move' is negative number of words to insert Register rdi_stack_move = rdi; __ movl2ptr(rdi_stack_move, rcx_amh_conversion); @@ -1052,7 +1070,7 @@ __ movptr(rbx_temp, Address(rsi_source, 0)); __ movptr(Address(rax_argslot, 0), rbx_temp); __ addptr(rsi_source, type2aelembytes(elem_type)); - __ addptr(rax_argslot, Interpreter::stackElementSize()); + __ addptr(rax_argslot, Interpreter::stackElementSize); __ cmpptr(rax_argslot, rdx_argslot_limit); __ jccb(Assembler::less, loop); } else if (length_constant == 0) { @@ -1065,7 +1083,7 @@ __ movptr(rbx_temp, Address(rsi_array, elem_offset)); __ movptr(Address(rax_argslot, slot_offset), rbx_temp); elem_offset += type2aelembytes(elem_type); - slot_offset += Interpreter::stackElementSize(); + slot_offset += Interpreter::stackElementSize; } }