hotspot/src/share/vm/prims/methodHandles.cpp
changeset 4429 d7eb4e2099aa
parent 4094 1f424b2b2171
child 4567 7fc02fbe5c7a
equal deleted inserted replaced
4428:d1617f46285d 4429:d7eb4e2099aa
  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