Mercurial > hg > truffle
comparison src/share/vm/classfile/systemDictionary.hpp @ 6266:1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
6984705: JSR 292 method handle creation should not go through JNI
Summary: remove assembly code for JDK 7 chained method handles
Reviewed-by: jrose, twisti, kvn, mhaupt
Contributed-by: John Rose <john.r.rose@oracle.com>, Christian Thalinger <christian.thalinger@oracle.com>, Michael Haupt <michael.haupt@oracle.com>
author | twisti |
---|---|
date | Tue, 24 Jul 2012 10:51:00 -0700 |
parents | d2a62e0f25eb |
children | 957c266d8bc5 da91efe96a93 |
comparison
equal
deleted
inserted
replaced
6241:aba91a731143 | 6266:1d7922586cf6 |
---|---|
146 \ | 146 \ |
147 /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \ | 147 /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \ |
148 template(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre_JSR292) \ | 148 template(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre_JSR292) \ |
149 template(MemberName_klass, java_lang_invoke_MemberName, Pre_JSR292) \ | 149 template(MemberName_klass, java_lang_invoke_MemberName, Pre_JSR292) \ |
150 template(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre_JSR292) \ | 150 template(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre_JSR292) \ |
151 template(AdapterMethodHandle_klass, java_lang_invoke_AdapterMethodHandle, Pre_JSR292) \ | 151 template(LambdaForm_klass, java_lang_invoke_LambdaForm, Opt) \ |
152 template(BoundMethodHandle_klass, java_lang_invoke_BoundMethodHandle, Pre_JSR292) \ | |
153 template(DirectMethodHandle_klass, java_lang_invoke_DirectMethodHandle, Pre_JSR292) \ | |
154 template(MethodType_klass, java_lang_invoke_MethodType, Pre_JSR292) \ | 152 template(MethodType_klass, java_lang_invoke_MethodType, Pre_JSR292) \ |
155 template(MethodTypeForm_klass, java_lang_invoke_MethodTypeForm, Pre_JSR292) \ | |
156 template(BootstrapMethodError_klass, java_lang_BootstrapMethodError, Pre_JSR292) \ | 153 template(BootstrapMethodError_klass, java_lang_BootstrapMethodError, Pre_JSR292) \ |
157 template(WrongMethodTypeException_klass, java_lang_invoke_WrongMethodTypeException, Pre_JSR292) \ | |
158 template(CallSite_klass, java_lang_invoke_CallSite, Pre_JSR292) \ | 154 template(CallSite_klass, java_lang_invoke_CallSite, Pre_JSR292) \ |
159 template(CountingMethodHandle_klass, java_lang_invoke_CountingMethodHandle, Opt) \ | |
160 template(ConstantCallSite_klass, java_lang_invoke_ConstantCallSite, Pre_JSR292) \ | 155 template(ConstantCallSite_klass, java_lang_invoke_ConstantCallSite, Pre_JSR292) \ |
161 template(MutableCallSite_klass, java_lang_invoke_MutableCallSite, Pre_JSR292) \ | 156 template(MutableCallSite_klass, java_lang_invoke_MutableCallSite, Pre_JSR292) \ |
162 template(VolatileCallSite_klass, java_lang_invoke_VolatileCallSite, Pre_JSR292) \ | 157 template(VolatileCallSite_klass, java_lang_invoke_VolatileCallSite, Pre_JSR292) \ |
163 /* Note: MethodHandle must be first, and VolatileCallSite last in group */ \ | 158 /* Note: MethodHandle must be first, and VolatileCallSite last in group */ \ |
164 \ | 159 \ |
483 Handle loader2, TRAPS); | 478 Handle loader2, TRAPS); |
484 static char* check_signature_loaders(Symbol* signature, Handle loader1, | 479 static char* check_signature_loaders(Symbol* signature, Handle loader1, |
485 Handle loader2, bool is_method, TRAPS); | 480 Handle loader2, bool is_method, TRAPS); |
486 | 481 |
487 // JSR 292 | 482 // JSR 292 |
488 // find the java.lang.invoke.MethodHandles::invoke method for a given signature | 483 // find a java.lang.invoke.MethodHandle.invoke* method for a given signature |
489 static methodOop find_method_handle_invoke(Symbol* name, | 484 // (asks Java to compute it if necessary, except in a compiler thread) |
490 Symbol* signature, | 485 static methodHandle find_method_handle_invoker(Symbol* name, |
491 KlassHandle accessing_klass, | 486 Symbol* signature, |
492 TRAPS); | 487 KlassHandle accessing_klass, |
493 // ask Java to compute a java.lang.invoke.MethodType object for a given signature | 488 Handle *appendix_result, |
489 TRAPS); | |
490 // for a given signature, find the internal MethodHandle method (linkTo* or invokeBasic) | |
491 // (does not ask Java, since this is a low-level intrinsic defined by the JVM) | |
492 static methodHandle find_method_handle_intrinsic(vmIntrinsics::ID iid, | |
493 Symbol* signature, | |
494 TRAPS); | |
495 // find a java.lang.invoke.MethodType object for a given signature | |
496 // (asks Java to compute it if necessary, except in a compiler thread) | |
494 static Handle find_method_handle_type(Symbol* signature, | 497 static Handle find_method_handle_type(Symbol* signature, |
495 KlassHandle accessing_klass, | 498 KlassHandle accessing_klass, |
496 bool for_invokeGeneric, | |
497 bool& return_bcp_flag, | |
498 TRAPS); | 499 TRAPS); |
500 | |
499 // ask Java to compute a java.lang.invoke.MethodHandle object for a given CP entry | 501 // ask Java to compute a java.lang.invoke.MethodHandle object for a given CP entry |
500 static Handle link_method_handle_constant(KlassHandle caller, | 502 static Handle link_method_handle_constant(KlassHandle caller, |
501 int ref_kind, //e.g., JVM_REF_invokeVirtual | 503 int ref_kind, //e.g., JVM_REF_invokeVirtual |
502 KlassHandle callee, | 504 KlassHandle callee, |
503 Symbol* name, | 505 Symbol* name, |
504 Symbol* signature, | 506 Symbol* signature, |
505 TRAPS); | 507 TRAPS); |
508 | |
506 // ask Java to create a dynamic call site, while linking an invokedynamic op | 509 // ask Java to create a dynamic call site, while linking an invokedynamic op |
507 static Handle make_dynamic_call_site(Handle bootstrap_method, | 510 static methodHandle find_dynamic_call_site_invoker(KlassHandle caller, |
508 // Callee information: | 511 Handle bootstrap_method, |
509 Symbol* name, | 512 Symbol* name, |
510 methodHandle signature_invoker, | 513 Symbol* type, |
511 Handle info, | 514 Handle *appendix_result, |
512 // Caller information: | 515 TRAPS); |
513 methodHandle caller_method, | |
514 int caller_bci, | |
515 TRAPS); | |
516 | |
517 // coordinate with Java about bootstrap methods | |
518 static Handle find_bootstrap_method(methodHandle caller_method, | |
519 int caller_bci, // N.B. must be an invokedynamic | |
520 int cache_index, // must be corresponding main_entry | |
521 Handle &argument_info_result, // static BSM arguments, if any | |
522 TRAPS); | |
523 | 516 |
524 // Utility for printing loader "name" as part of tracing constraints | 517 // Utility for printing loader "name" as part of tracing constraints |
525 static const char* loader_name(oop loader) { | 518 static const char* loader_name(oop loader) { |
526 return ((loader) == NULL ? "<bootloader>" : | 519 return ((loader) == NULL ? "<bootloader>" : |
527 instanceKlass::cast((loader)->klass())->name()->as_C_string() ); | 520 instanceKlass::cast((loader)->klass())->name()->as_C_string() ); |