8026946: JvmtiEnv::SetBreakpoint and JvmtiEnv::ClearBreakpoint should use MethodHandle

8026948: JvmtiEnv::SetBreakpoint and JvmtiEnv::ClearBreakpoint might not work with anonymous classes

Walk methods in breakpoints for marking on stack so they aren't deallocated by redefine classes.  Use class_holder rather than class_loader to keep GC from reclaiming class owning the method.

Reviewed-by: sspitsyn, ehelin, sla
This commit is contained in:
Coleen Phillimore 2013-11-01 10:32:36 -04:00
parent 535b489554
commit b1689ab022
3 changed files with 51 additions and 11 deletions

View file

@ -27,6 +27,7 @@
#include "code/codeCache.hpp"
#include "compiler/compileBroker.hpp"
#include "oops/metadata.hpp"
#include "prims/jvmtiImpl.hpp"
#include "runtime/synchronizer.hpp"
#include "runtime/thread.hpp"
#include "utilities/growableArray.hpp"
@ -48,6 +49,7 @@ MetadataOnStackMark::MetadataOnStackMark() {
Threads::metadata_do(Metadata::mark_on_stack);
CodeCache::alive_nmethods_do(nmethod::mark_on_stack);
CompileBroker::mark_on_stack();
JvmtiCurrentBreakpoints::metadata_do(Metadata::mark_on_stack);
}
MetadataOnStackMark::~MetadataOnStackMark() {