1919#include < jni.h>
2020#include < string.h>
2121#include " arch.h"
22- #include " classRefCache.h"
2322#include " context.h"
2423#include " incbin.h"
2524#include " livenessTracker.h"
3231
3332LivenessTracker* const LivenessTracker::_instance = new LivenessTracker();
3433
35- void LivenessTracker::cleanup_table (bool update_class_ref_cache ) {
34+ void LivenessTracker::cleanup_table () {
3635 u64 current = loadAcquire (_last_gc_epoch);
3736 u64 target_gc_epoch = loadAcquire (_gc_epoch);
3837
@@ -52,15 +51,6 @@ void LivenessTracker::cleanup_table(bool update_class_ref_cache) {
5251 std::set<jclass> kept_classes;
5352 for (u32 i = 0 ; i < (sz = _table_size); i++) {
5453 if (!env->IsSameObject (_table[i].ref , NULL )) {
55- if (update_class_ref_cache) {
56- // collect referenced classes
57- jclass klass;
58- for (int f_idx = 0 ; f_idx < _table[i].frames_size ; f_idx++) {
59- if (jvmti->GetMethodDeclaringClass (_table[i].frames [f_idx].method , &klass) == 0 ) {
60- kept_classes.insert (klass);
61- }
62- }
63- }
6454 // it survived one more GarbageCollectionFinish event
6555 _table[i].age += epoch_diff;
6656 _table[newsz++] = _table[i];
@@ -74,10 +64,6 @@ void LivenessTracker::cleanup_table(bool update_class_ref_cache) {
7464
7565 _table_size = newsz;
7666
77- if (update_class_ref_cache) {
78- ClassRefCache::instance ()->keep (env, kept_classes);
79- }
80-
8167 _table_lock.unlock ();
8268 end = OS::nanotime ();
8369 Log::debug (" Liveness tracker cleanup took %.2fms (%.2fus/element)" ,
@@ -94,7 +80,7 @@ void LivenessTracker::flush_table(std::set<int> *tracked_thread_ids) {
9480
9581 // make sure that the tracking table is cleaned up before we start flushing it
9682 // this is to make sure we are including as few false 'live' objects as possible
97- cleanup_table (true );
83+ cleanup_table ();
9884
9985 _table_lock.lockShared ();
10086
@@ -185,7 +171,7 @@ Error LivenessTracker::start(Arguments& args) {
185171}
186172
187173void LivenessTracker::stop () {
188- cleanup_table (false );
174+ cleanup_table ();
189175 flush_table (NULL );
190176
191177 // do not disable GC notifications here - the tracker is supposed to survive multiple recordings
@@ -292,7 +278,7 @@ void LivenessTracker::track(JNIEnv* env, AllocEvent &event, jint tid, jobject ob
292278 retried = true ;
293279
294280 // try cleanup before resizing - there is a good chance it will free some space
295- cleanup_table (false );
281+ cleanup_table ();
296282
297283 if (_table_cap < _table_max_cap) {
298284
0 commit comments