Mercurial > hg > graal-jvmci-8
comparison src/share/vm/prims/methodHandles.hpp @ 1507:cd5dbf694d45
6939134: JSR 292 adjustments to method handle invocation
Summary: split MethodHandle.invoke into invokeExact and invokeGeneric; also clean up JVM-to-Java interfaces
Reviewed-by: twisti
author | jrose |
---|---|
date | Sat, 01 May 2010 02:42:18 -0700 |
parents | 2338d41fbd81 |
children | c18cbe5936b8 |
comparison
equal
deleted
inserted
replaced
1506:2338d41fbd81 | 1507:cd5dbf694d45 |
---|---|
214 } | 214 } |
215 static int adapter_conversion_vminfo(jint conv) { | 215 static int adapter_conversion_vminfo(jint conv) { |
216 return (conv >> CONV_VMINFO_SHIFT) & CONV_VMINFO_MASK; | 216 return (conv >> CONV_VMINFO_SHIFT) & CONV_VMINFO_MASK; |
217 } | 217 } |
218 | 218 |
219 // Bit mask of conversion_op values. May vary by platform. | |
220 static int adapter_conversion_ops_supported_mask(); | |
221 | |
219 // Offset in words that the interpreter stack pointer moves when an argument is pushed. | 222 // Offset in words that the interpreter stack pointer moves when an argument is pushed. |
220 // The stack_move value must always be a multiple of this. | 223 // The stack_move value must always be a multiple of this. |
221 static int stack_move_unit() { | 224 static int stack_move_unit() { |
222 return frame::interpreter_frame_expression_stack_direction() * Interpreter::stackElementWords; | 225 return frame::interpreter_frame_expression_stack_direction() * Interpreter::stackElementWords; |
223 } | 226 } |
260 | 263 |
261 public: | 264 public: |
262 // working with member names | 265 // working with member names |
263 static void resolve_MemberName(Handle mname, TRAPS); // compute vmtarget/vmindex from name/type | 266 static void resolve_MemberName(Handle mname, TRAPS); // compute vmtarget/vmindex from name/type |
264 static void expand_MemberName(Handle mname, int suppress, TRAPS); // expand defc/name/type if missing | 267 static void expand_MemberName(Handle mname, int suppress, TRAPS); // expand defc/name/type if missing |
268 static Handle new_MemberName(TRAPS); // must be followed by init_MemberName | |
265 static void init_MemberName(oop mname_oop, oop target); // compute vmtarget/vmindex from target | 269 static void init_MemberName(oop mname_oop, oop target); // compute vmtarget/vmindex from target |
266 static void init_MemberName(oop mname_oop, methodOop m, bool do_dispatch); | 270 static void init_MemberName(oop mname_oop, methodOop m, bool do_dispatch = true); |
267 static void init_MemberName(oop mname_oop, klassOop field_holder, AccessFlags mods, int offset); | 271 static void init_MemberName(oop mname_oop, klassOop field_holder, AccessFlags mods, int offset); |
268 static int find_MemberNames(klassOop k, symbolOop name, symbolOop sig, | 272 static int find_MemberNames(klassOop k, symbolOop name, symbolOop sig, |
269 int mflags, klassOop caller, | 273 int mflags, klassOop caller, |
270 int skip, objArrayOop results); | 274 int skip, objArrayOop results); |
271 // bit values for suppress argument to expand_MemberName: | 275 // bit values for suppress argument to expand_MemberName: |
298 static methodOop decode_method(oop x, klassOop& receiver_limit_result, int& decode_flags_result); | 302 static methodOop decode_method(oop x, klassOop& receiver_limit_result, int& decode_flags_result); |
299 enum { | 303 enum { |
300 // format of query to getConstant: | 304 // format of query to getConstant: |
301 GC_JVM_PUSH_LIMIT = 0, | 305 GC_JVM_PUSH_LIMIT = 0, |
302 GC_JVM_STACK_MOVE_UNIT = 1, | 306 GC_JVM_STACK_MOVE_UNIT = 1, |
307 GC_CONV_OP_IMPLEMENTED_MASK = 2, | |
303 | 308 |
304 // format of result from getTarget / encode_target: | 309 // format of result from getTarget / encode_target: |
305 ETF_HANDLE_OR_METHOD_NAME = 0, // all available data (immediate MH or method) | 310 ETF_HANDLE_OR_METHOD_NAME = 0, // all available data (immediate MH or method) |
306 ETF_DIRECT_HANDLE = 1, // ultimate method handle (will be a DMH, may be self) | 311 ETF_DIRECT_HANDLE = 1, // ultimate method handle (will be a DMH, may be self) |
307 ETF_METHOD_NAME = 2, // ultimate method as MemberName | 312 ETF_METHOD_NAME = 2, // ultimate method as MemberName |
308 ETF_REFLECT_METHOD = 3 // ultimate method as java.lang.reflect object (sans refClass) | 313 ETF_REFLECT_METHOD = 3 // ultimate method as java.lang.reflect object (sans refClass) |
309 }; | 314 }; |
310 static int get_named_constant(int which, Handle name_box, TRAPS); | 315 static int get_named_constant(int which, Handle name_box, TRAPS); |
311 static oop encode_target(Handle mh, int format, TRAPS); // report vmtarget (to Java code) | 316 static oop encode_target(Handle mh, int format, TRAPS); // report vmtarget (to Java code) |
312 static bool class_cast_needed(klassOop src, klassOop dst); | 317 static bool class_cast_needed(klassOop src, klassOop dst); |
318 | |
319 static instanceKlassHandle resolve_instance_klass(oop java_mirror_oop, TRAPS); | |
320 static instanceKlassHandle resolve_instance_klass(jclass java_mirror_jh, TRAPS) { | |
321 return resolve_instance_klass(JNIHandles::resolve(java_mirror_jh), THREAD); | |
322 } | |
313 | 323 |
314 private: | 324 private: |
315 // These checkers operate on a pair of whole MethodTypes: | 325 // These checkers operate on a pair of whole MethodTypes: |
316 static const char* check_method_type_change(oop src_mtype, int src_beg, int src_end, | 326 static const char* check_method_type_change(oop src_mtype, int src_beg, int src_end, |
317 int insert_argnum, oop insert_type, | 327 int insert_argnum, oop insert_type, |