Don't report OTHER references in test 913
These references are from vm-internal sources and can change depending
on the configuration and current state of the runtime. Notably
additional roots in the OTHER category will be present if the runtime
is current using instrumentation trampolines for tracing.
Test: ./test/testrunner/testrunner.py --host --debug --runtime-option=-Xplugin:libtracefast-trampolined.so
Change-Id: Ib8c2da7b203edd59be296028557bc074f9d0dceb
diff --git a/test/913-heaps/heaps.cc b/test/913-heaps/heaps.cc
index 00a7ea7..b07554c 100644
--- a/test/913-heaps/heaps.cc
+++ b/test/913-heaps/heaps.cc
@@ -168,6 +168,12 @@
if (reference_kind == JVMTI_HEAP_REFERENCE_JNI_GLOBAL && class_tag == 0) {
return 0;
}
+ // Ignore HEAP_REFERENCE_OTHER roots because these are vm-internal roots and can vary
+ // depending on the configuration of the runtime (notably having trampoline tracing will add a
+ // lot of these).
+ if (reference_kind == JVMTI_HEAP_REFERENCE_OTHER) {
+ return 0;
+ }
// Ignore classes (1000 <= tag < 3000) for thread objects. These can be held by the JIT.
if (reference_kind == JVMTI_HEAP_REFERENCE_THREAD && class_tag == 0 &&
(1000 <= *tag_ptr && *tag_ptr < 3000)) {