Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/metadataOnStackMark.cpp @ 13038:910026b800b8
8026946: JvmtiEnv::SetBreakpoint and JvmtiEnv::ClearBreakpoint should use MethodHandle
8026948: JvmtiEnv::SetBreakpoint and JvmtiEnv::ClearBreakpoint might not work with anonymous classes
Summary: 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
author | coleenp |
---|---|
date | Fri, 01 Nov 2013 10:32:36 -0400 |
parents | 5daaddd917a1 |
children | 0b9ea9a72436 |
comparison
equal
deleted
inserted
replaced
13037:c8fc12209830 | 13038:910026b800b8 |
---|---|
25 #include "precompiled.hpp" | 25 #include "precompiled.hpp" |
26 #include "classfile/metadataOnStackMark.hpp" | 26 #include "classfile/metadataOnStackMark.hpp" |
27 #include "code/codeCache.hpp" | 27 #include "code/codeCache.hpp" |
28 #include "compiler/compileBroker.hpp" | 28 #include "compiler/compileBroker.hpp" |
29 #include "oops/metadata.hpp" | 29 #include "oops/metadata.hpp" |
30 #include "prims/jvmtiImpl.hpp" | |
30 #include "runtime/synchronizer.hpp" | 31 #include "runtime/synchronizer.hpp" |
31 #include "runtime/thread.hpp" | 32 #include "runtime/thread.hpp" |
32 #include "utilities/growableArray.hpp" | 33 #include "utilities/growableArray.hpp" |
33 | 34 |
34 | 35 |
46 _marked_objects = new (ResourceObj::C_HEAP, mtClass) GrowableArray<Metadata*>(1000, true); | 47 _marked_objects = new (ResourceObj::C_HEAP, mtClass) GrowableArray<Metadata*>(1000, true); |
47 } | 48 } |
48 Threads::metadata_do(Metadata::mark_on_stack); | 49 Threads::metadata_do(Metadata::mark_on_stack); |
49 CodeCache::alive_nmethods_do(nmethod::mark_on_stack); | 50 CodeCache::alive_nmethods_do(nmethod::mark_on_stack); |
50 CompileBroker::mark_on_stack(); | 51 CompileBroker::mark_on_stack(); |
52 JvmtiCurrentBreakpoints::metadata_do(Metadata::mark_on_stack); | |
51 } | 53 } |
52 | 54 |
53 MetadataOnStackMark::~MetadataOnStackMark() { | 55 MetadataOnStackMark::~MetadataOnStackMark() { |
54 assert(SafepointSynchronize::is_at_safepoint(), "sanity check"); | 56 assert(SafepointSynchronize::is_at_safepoint(), "sanity check"); |
55 // Unmark everything that was marked. Can't do the same walk because | 57 // Unmark everything that was marked. Can't do the same walk because |