@@ -932,19 +932,12 @@ void MethodHandles::expand_MemberName(Handle mname, int suppress, TRAPS) {
932932void MethodHandles::add_dependent_nmethod (oop call_site, nmethod* nm) {
933933 assert_locked_or_safepoint (CodeCache_lock);
934934
935- oop context = java_lang_invoke_CallSite::context_no_keepalive (call_site);
936- DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies (context);
937- // Try to purge stale entries on updates.
938- // Since GC doesn't clean dependency contexts rooted at CallSiteContext objects,
939- // in order to avoid memory leak, stale entries are purged whenever a dependency list
940- // is changed (both on addition and removal). Though memory reclamation is delayed,
941- // it avoids indefinite memory usage growth.
935+ DependencyContext deps = java_lang_invoke_CallSite::vmdependencies (call_site);
942936 deps.add_dependent_nmethod (nm);
943937}
944938
945939void MethodHandles::clean_dependency_context (oop call_site) {
946- oop context = java_lang_invoke_CallSite::context_no_keepalive (call_site);
947- DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies (context);
940+ DependencyContext deps = java_lang_invoke_CallSite::vmdependencies (call_site);
948941 deps.clean_unloading_dependents ();
949942}
950943
@@ -956,8 +949,7 @@ void MethodHandles::mark_dependent_nmethods(DeoptimizationScope* deopt_scope, Ha
956949 NoSafepointVerifier nsv;
957950 MutexLocker ml (CodeCache_lock, Mutex::_no_safepoint_check_flag);
958951
959- oop context = java_lang_invoke_CallSite::context_no_keepalive (call_site ());
960- DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies (context);
952+ DependencyContext deps = java_lang_invoke_CallSite::vmdependencies (call_site ());
961953 deps.mark_dependent_nmethods (deopt_scope, changes);
962954 }
963955}
@@ -1322,23 +1314,6 @@ JVM_ENTRY(void, MHN_copyOutBootstrapArguments(JNIEnv* env, jobject igcls,
13221314}
13231315JVM_END
13241316
1325- // It is called by a Cleaner object which ensures that dropped CallSites properly
1326- // deallocate their dependency information.
1327- JVM_ENTRY (void , MHN_clearCallSiteContext(JNIEnv* env, jobject igcls, jobject context_jh)) {
1328- Handle context (THREAD, JNIHandles::resolve_non_null (context_jh));
1329- DeoptimizationScope deopt_scope;
1330- {
1331- NoSafepointVerifier nsv;
1332- MutexLocker ml (THREAD, CodeCache_lock, Mutex::_no_safepoint_check_flag);
1333- DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies (context ());
1334- deps.remove_and_mark_for_deoptimization_all_dependents (&deopt_scope);
1335- // This is assumed to be an 'atomic' operation by verification.
1336- // So keep it under lock for now.
1337- deopt_scope.deoptimize_marked ();
1338- }
1339- }
1340- JVM_END
1341-
13421317/* *
13431318 * Throws a java/lang/UnsupportedOperationException unconditionally.
13441319 * This is required by the specification of MethodHandle.invoke if
@@ -1385,7 +1360,6 @@ JVM_END
13851360#define MT JLINV " MethodType;"
13861361#define MH JLINV " MethodHandle;"
13871362#define MEM JLINV " MemberName;"
1388- #define CTX JLINV " MethodHandleNatives$CallSiteContext;"
13891363
13901364#define CC (char *) /* cast a literal from (const char*)*/
13911365#define FN_PTR (f ) CAST_FROM_FN_PTR(void *, &f)
@@ -1401,7 +1375,6 @@ static JNINativeMethod MHN_methods[] = {
14011375 {CC " setCallSiteTargetNormal" , CC " (" CS " " MH " )V" , FN_PTR (MHN_setCallSiteTargetNormal)},
14021376 {CC " setCallSiteTargetVolatile" , CC " (" CS " " MH " )V" , FN_PTR (MHN_setCallSiteTargetVolatile)},
14031377 {CC " copyOutBootstrapArguments" , CC " (" CLS " [III[" OBJ " IZ" OBJ " )V" , FN_PTR (MHN_copyOutBootstrapArguments)},
1404- {CC " clearCallSiteContext" , CC " (" CTX " )V" , FN_PTR (MHN_clearCallSiteContext)},
14051378 {CC " staticFieldOffset" , CC " (" MEM " )J" , FN_PTR (MHN_staticFieldOffset)},
14061379 {CC " staticFieldBase" , CC " (" MEM " )" OBJ, FN_PTR (MHN_staticFieldBase)},
14071380 {CC " getMemberVMInfo" , CC " (" MEM " )" OBJ, FN_PTR (MHN_getMemberVMInfo)}
0 commit comments