ART: Fix ObjectFree reporting
Free events should not be dispatched to all registered envs. They
are specific to the env that the tag came from.
Add a DispatchEvent that takes an env, add an env field to the
tagging table, and connect the two.
Update the stress test. Make it actually work with a tagging
function for the second env.
Bug: 36648696
Test: ./test.py --host -r -t 905
Change-Id: I485ef1a6a57e233a2c2128b30cae93532676b3bf
diff --git a/runtime/openjdkjvmti/object_tagging.cc b/runtime/openjdkjvmti/object_tagging.cc
index 4215588..dcdd3ed 100644
--- a/runtime/openjdkjvmti/object_tagging.cc
+++ b/runtime/openjdkjvmti/object_tagging.cc
@@ -33,6 +33,7 @@
#include <limits>
+#include "art_jvmti.h"
#include "events-inl.h"
#include "jvmti_weak_table-inl.h"
@@ -60,7 +61,7 @@
return event_handler_->IsEventEnabledAnywhere(ArtJvmtiEvent::kObjectFree);
}
void ObjectTagTable::HandleNullSweep(jlong tag) {
- event_handler_->DispatchEvent<ArtJvmtiEvent::kObjectFree>(nullptr, tag);
+ event_handler_->DispatchEvent<ArtJvmtiEvent::kObjectFree>(jvmti_env_, nullptr, tag);
}
} // namespace openjdkjvmti