Mercurial > hg > graal-compiler
comparison src/share/vm/prims/methodHandles.cpp @ 1059:389049f3f393
6858164: invokedynamic code needs some cleanup (post-6655638)
Summary: Fix several crashers, remove needless paths for boxed-style bootstrap method call, refactor & simplify APIs for rewriter constantPoolOop, remove sun.dyn.CallSiteImpl
Reviewed-by: kvn
author | jrose |
---|---|
date | Fri, 30 Oct 2009 16:22:59 -0700 |
parents | 987e948ebbc8 |
children | dd57230ba8fe |
comparison
equal
deleted
inserted
replaced
1058:73a726751507 | 1059:389049f3f393 |
---|---|
2345 | 2345 |
2346 | 2346 |
2347 JVM_ENTRY(void, MH_linkCallSite(JNIEnv *env, jobject igcls, jobject site_jh, jobject target_jh)) { | 2347 JVM_ENTRY(void, MH_linkCallSite(JNIEnv *env, jobject igcls, jobject site_jh, jobject target_jh)) { |
2348 // No special action required, yet. | 2348 // No special action required, yet. |
2349 oop site_oop = JNIHandles::resolve(site_jh); | 2349 oop site_oop = JNIHandles::resolve(site_jh); |
2350 if (site_oop == NULL || site_oop->klass() != SystemDictionary::CallSiteImpl_klass()) | 2350 if (site_oop == NULL || site_oop->klass() != SystemDictionary::CallSite_klass()) |
2351 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "call site"); | 2351 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "call site"); |
2352 sun_dyn_CallSiteImpl::set_target(site_oop, JNIHandles::resolve(target_jh)); | 2352 java_dyn_CallSite::set_target(site_oop, JNIHandles::resolve(target_jh)); |
2353 } | 2353 } |
2354 JVM_END | 2354 JVM_END |
2355 | 2355 |
2356 | 2356 |
2357 /// JVM_RegisterMethodHandleMethods | 2357 /// JVM_RegisterMethodHandleMethods |
2363 #define IDYN "Lsun/dyn/" | 2363 #define IDYN "Lsun/dyn/" |
2364 | 2364 |
2365 #define OBJ LANG"Object;" | 2365 #define OBJ LANG"Object;" |
2366 #define CLS LANG"Class;" | 2366 #define CLS LANG"Class;" |
2367 #define STRG LANG"String;" | 2367 #define STRG LANG"String;" |
2368 #define CST JDYN"CallSite;" | |
2368 #define MT JDYN"MethodType;" | 2369 #define MT JDYN"MethodType;" |
2369 #define MH JDYN"MethodHandle;" | 2370 #define MH JDYN"MethodHandle;" |
2370 #define MHI IDYN"MethodHandleImpl;" | 2371 #define MHI IDYN"MethodHandleImpl;" |
2371 #define MEM IDYN"MemberName;" | 2372 #define MEM IDYN"MemberName;" |
2372 #define AMH IDYN"AdapterMethodHandle;" | 2373 #define AMH IDYN"AdapterMethodHandle;" |
2373 #define BMH IDYN"BoundMethodHandle;" | 2374 #define BMH IDYN"BoundMethodHandle;" |
2374 #define DMH IDYN"DirectMethodHandle;" | 2375 #define DMH IDYN"DirectMethodHandle;" |
2375 #define CSTI IDYN"CallSiteImpl;" | |
2376 | 2376 |
2377 #define CC (char*) /*cast a literal from (const char*)*/ | 2377 #define CC (char*) /*cast a literal from (const char*)*/ |
2378 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f) | 2378 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f) |
2379 | 2379 |
2380 // These are the native methods on sun.dyn.MethodHandleNatives. | 2380 // These are the native methods on sun.dyn.MethodHandleNatives. |
2396 {CC"getMembers", CC"("CLS""STRG""STRG"I"CLS"I["MEM")I", FN_PTR(MHI_getMembers)} | 2396 {CC"getMembers", CC"("CLS""STRG""STRG"I"CLS"I["MEM")I", FN_PTR(MHI_getMembers)} |
2397 }; | 2397 }; |
2398 | 2398 |
2399 // More entry points specifically for EnableInvokeDynamic. | 2399 // More entry points specifically for EnableInvokeDynamic. |
2400 static JNINativeMethod methods2[] = { | 2400 static JNINativeMethod methods2[] = { |
2401 {CC"linkCallSite", CC"("CSTI MH")V", FN_PTR(MH_linkCallSite)} | 2401 {CC"linkCallSite", CC"("CST MH")V", FN_PTR(MH_linkCallSite)} |
2402 }; | 2402 }; |
2403 | 2403 |
2404 | 2404 |
2405 // This one function is exported, used by NativeLookup. | 2405 // This one function is exported, used by NativeLookup. |
2406 | 2406 |