@@ -934,19 +934,12 @@ void MethodHandles::expand_MemberName(Handle mname, int suppress, TRAPS) {
934934void MethodHandles::add_dependent_nmethod (oop call_site, nmethod* nm) {
935935 assert_locked_or_safepoint (CodeCache_lock);
936936
937- oop context = java_lang_invoke_CallSite::context_no_keepalive (call_site);
938- DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies (context);
939- // Try to purge stale entries on updates.
940- // Since GC doesn't clean dependency contexts rooted at CallSiteContext objects,
941- // in order to avoid memory leak, stale entries are purged whenever a dependency list
942- // is changed (both on addition and removal). Though memory reclamation is delayed,
943- // it avoids indefinite memory usage growth.
937+ DependencyContext deps = java_lang_invoke_CallSite::vmdependencies (call_site);
944938 deps.add_dependent_nmethod (nm);
945939}
946940
947941void MethodHandles::clean_dependency_context (oop call_site) {
948- oop context = java_lang_invoke_CallSite::context_no_keepalive (call_site);
949- DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies (context);
942+ DependencyContext deps = java_lang_invoke_CallSite::vmdependencies (call_site);
950943 deps.clean_unloading_dependents ();
951944}
952945
@@ -958,8 +951,7 @@ void MethodHandles::mark_dependent_nmethods(DeoptimizationScope* deopt_scope, Ha
958951 NoSafepointVerifier nsv;
959952 MutexLocker ml (CodeCache_lock, Mutex::_no_safepoint_check_flag);
960953
961- oop context = java_lang_invoke_CallSite::context_no_keepalive (call_site ());
962- DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies (context);
954+ DependencyContext deps = java_lang_invoke_CallSite::vmdependencies (call_site ());
963955 deps.mark_dependent_nmethods (deopt_scope, changes);
964956 }
965957}
@@ -1323,23 +1315,6 @@ JVM_ENTRY(void, MHN_copyOutBootstrapArguments(JNIEnv* env, jobject igcls,
13231315}
13241316JVM_END
13251317
1326- // It is called by a Cleaner object which ensures that dropped CallSites properly
1327- // deallocate their dependency information.
1328- JVM_ENTRY (void , MHN_clearCallSiteContext(JNIEnv* env, jobject igcls, jobject context_jh)) {
1329- Handle context (THREAD, JNIHandles::resolve_non_null (context_jh));
1330- DeoptimizationScope deopt_scope;
1331- {
1332- NoSafepointVerifier nsv;
1333- MutexLocker ml (THREAD, CodeCache_lock, Mutex::_no_safepoint_check_flag);
1334- DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies (context ());
1335- deps.remove_and_mark_for_deoptimization_all_dependents (&deopt_scope);
1336- // This is assumed to be an 'atomic' operation by verification.
1337- // So keep it under lock for now.
1338- deopt_scope.deoptimize_marked ();
1339- }
1340- }
1341- JVM_END
1342-
13431318/* *
13441319 * Throws a java/lang/UnsupportedOperationException unconditionally.
13451320 * This is required by the specification of MethodHandle.invoke if
@@ -1374,7 +1349,6 @@ JVM_END
13741349#define MT JLINV " MethodType;"
13751350#define MH JLINV " MethodHandle;"
13761351#define MEM JLINV " MemberName;"
1377- #define CTX JLINV " MethodHandleNatives$CallSiteContext;"
13781352
13791353#define CC (char *) /* cast a literal from (const char*)*/
13801354#define FN_PTR (f ) CAST_FROM_FN_PTR(void *, &f)
@@ -1390,7 +1364,6 @@ static JNINativeMethod MHN_methods[] = {
13901364 {CC " setCallSiteTargetNormal" , CC " (" CS " " MH " )V" , FN_PTR (MHN_setCallSiteTargetNormal)},
13911365 {CC " setCallSiteTargetVolatile" , CC " (" CS " " MH " )V" , FN_PTR (MHN_setCallSiteTargetVolatile)},
13921366 {CC " copyOutBootstrapArguments" , CC " (" CLS " [III[" OBJ " IZ" OBJ " )V" , FN_PTR (MHN_copyOutBootstrapArguments)},
1393- {CC " clearCallSiteContext" , CC " (" CTX " )V" , FN_PTR (MHN_clearCallSiteContext)},
13941367 {CC " staticFieldOffset" , CC " (" MEM " )J" , FN_PTR (MHN_staticFieldOffset)},
13951368 {CC " staticFieldBase" , CC " (" MEM " )" OBJ, FN_PTR (MHN_staticFieldBase)},
13961369 {CC " getMemberVMInfo" , CC " (" MEM " )" OBJ, FN_PTR (MHN_getMemberVMInfo)}
0 commit comments