Mercurial > hg > truffle
diff src/share/vm/prims/methodHandles.hpp @ 1304:76c1d7d13ec5
6932091: JSR 292 x86 code cleanup
Summary: Some code cleanups found during the JSR 292 SPARC port.
Reviewed-by: kvn, never
author | twisti |
---|---|
date | Thu, 18 Mar 2010 09:56:51 +0100 |
parents | 9eba43136cb5 |
children | c640000b7cc1 |
line wrap: on
line diff
--- a/src/share/vm/prims/methodHandles.hpp Wed Mar 17 16:40:25 2010 -0700 +++ b/src/share/vm/prims/methodHandles.hpp Thu Mar 18 09:56:51 2010 +0100 @@ -1,5 +1,5 @@ /* - * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2008-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -137,6 +137,43 @@ _entries[ek] = me; } + // Some adapter helper functions. + static void get_ek_bound_mh_info(EntryKind ek, BasicType& arg_type, int& arg_mask, int& arg_slots) { + switch (ek) { + case _bound_int_mh : // fall-thru + case _bound_int_direct_mh : arg_type = T_INT; arg_mask = _INSERT_INT_MASK; break; + case _bound_long_mh : // fall-thru + case _bound_long_direct_mh: arg_type = T_LONG; arg_mask = _INSERT_LONG_MASK; break; + case _bound_ref_mh : // fall-thru + case _bound_ref_direct_mh : arg_type = T_OBJECT; arg_mask = _INSERT_REF_MASK; break; + default: ShouldNotReachHere(); + } + arg_slots = type2size[arg_type]; + } + + static void get_ek_adapter_opt_swap_rot_info(EntryKind ek, int& swap_bytes, int& rotate) { + int swap_slots = 0; + switch (ek) { + case _adapter_opt_swap_1: swap_slots = 1; rotate = 0; break; + case _adapter_opt_swap_2: swap_slots = 2; rotate = 0; break; + case _adapter_opt_rot_1_up: swap_slots = 1; rotate = 1; break; + case _adapter_opt_rot_1_down: swap_slots = 1; rotate = -1; break; + case _adapter_opt_rot_2_up: swap_slots = 2; rotate = 1; break; + case _adapter_opt_rot_2_down: swap_slots = 2; rotate = -1; break; + default: ShouldNotReachHere(); + } + // Return the size of the stack slots to move in bytes. + swap_bytes = swap_slots * Interpreter::stackElementSize(); + } + + static int get_ek_adapter_opt_spread_info(EntryKind ek) { + switch (ek) { + case _adapter_opt_spread_0: return 0; + case _adapter_opt_spread_1: return 1; + default : return -1; + } + } + static methodOop raise_exception_method() { oop rem = JNIHandles::resolve(_raise_exception_method); assert(rem == NULL || rem->is_method(), ""); @@ -392,13 +429,13 @@ static void insert_arg_slots(MacroAssembler* _masm, RegisterOrConstant arg_slots, int arg_mask, - Register rax_argslot, - Register rbx_temp, Register rdx_temp); + Register argslot_reg, + Register temp_reg, Register temp2_reg); static void remove_arg_slots(MacroAssembler* _masm, RegisterOrConstant arg_slots, - Register rax_argslot, - Register rbx_temp, Register rdx_temp); + Register argslot_reg, + Register temp_reg, Register temp2_reg); };