28 #include "classfile/systemDictionary.hpp"
29 #include "classfile/vmSymbols.hpp"
30 #include "code/codeCache.hpp"
31 #include "jvmtifiles/jvmtiEnv.hpp"
32 #include "memory/resourceArea.hpp"
33 #include "oops/instanceMirrorKlass.hpp"
34 #include "oops/objArrayKlass.hpp"
35 #include "oops/objArrayOop.inline.hpp"
36 #include "oops/oop.inline.hpp"
37 #include "prims/jvmtiEventController.hpp"
38 #include "prims/jvmtiEventController.inline.hpp"
39 #include "prims/jvmtiExport.hpp"
40 #include "prims/jvmtiImpl.hpp"
41 #include "prims/jvmtiTagMap.hpp"
42 #include "runtime/biasedLocking.hpp"
43 #include "runtime/javaCalls.hpp"
44 #include "runtime/jniHandles.hpp"
45 #include "runtime/mutex.hpp"
46 #include "runtime/mutexLocker.hpp"
47 #include "runtime/reflectionUtils.hpp"
48 #include "runtime/vframe.hpp"
49 #include "runtime/vmThread.hpp"
50 #include "runtime/vm_operations.hpp"
51 #include "services/serviceUtil.hpp"
52 #include "utilities/macros.hpp"
53 #if INCLUDE_ALL_GCS
54 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
55 #include "gc/parallel/parallelScavengeHeap.hpp"
56 #endif // INCLUDE_ALL_GCS
57
58 // JvmtiTagHashmapEntry
59 //
60 // Each entry encapsulates a reference to the tagged object
61 // and the tag value. In addition an entry includes a next pointer which
62 // is used to chain entries together.
63
64 class JvmtiTagHashmapEntry : public CHeapObj<mtInternal> {
65 private:
66 friend class JvmtiTagMap;
67
3157 }
3158 }
3159
3160 vf = vf->sender();
3161 is_top_frame = false;
3162 }
3163 } else {
3164 // no last java frame but there may be JNI locals
3165 blk->set_context(thread_tag, tid, 0, (jmethodID)NULL);
3166 java_thread->active_handles()->oops_do(blk);
3167 }
3168 return true;
3169 }
3170
3171
3172 // Collects the simple roots for all threads and collects all
3173 // stack roots - for each thread it walks the execution
3174 // stack to find all references and local JNI refs.
3175 inline bool VM_HeapWalkOperation::collect_stack_roots() {
3176 JNILocalRootsClosure blk;
3177 for (JavaThread* thread = Threads::first(); thread != NULL ; thread = thread->next()) {
3178 oop threadObj = thread->threadObj();
3179 if (threadObj != NULL && !thread->is_exiting() && !thread->is_hidden_from_external_view()) {
3180 // Collect the simple root for this thread before we
3181 // collect its stack roots
3182 if (!CallbackInvoker::report_simple_root(JVMTI_HEAP_REFERENCE_THREAD,
3183 threadObj)) {
3184 return false;
3185 }
3186 if (!collect_stack_roots(thread, &blk)) {
3187 return false;
3188 }
3189 }
3190 }
3191 return true;
3192 }
3193
3194 // visit an object
3195 // first mark the object as visited
3196 // second get all the outbound references from this object (in other words, all
3197 // the objects referenced by this object).
|
28 #include "classfile/systemDictionary.hpp"
29 #include "classfile/vmSymbols.hpp"
30 #include "code/codeCache.hpp"
31 #include "jvmtifiles/jvmtiEnv.hpp"
32 #include "memory/resourceArea.hpp"
33 #include "oops/instanceMirrorKlass.hpp"
34 #include "oops/objArrayKlass.hpp"
35 #include "oops/objArrayOop.inline.hpp"
36 #include "oops/oop.inline.hpp"
37 #include "prims/jvmtiEventController.hpp"
38 #include "prims/jvmtiEventController.inline.hpp"
39 #include "prims/jvmtiExport.hpp"
40 #include "prims/jvmtiImpl.hpp"
41 #include "prims/jvmtiTagMap.hpp"
42 #include "runtime/biasedLocking.hpp"
43 #include "runtime/javaCalls.hpp"
44 #include "runtime/jniHandles.hpp"
45 #include "runtime/mutex.hpp"
46 #include "runtime/mutexLocker.hpp"
47 #include "runtime/reflectionUtils.hpp"
48 #include "runtime/thread.inline.hpp"
49 #include "runtime/threadSMR.hpp"
50 #include "runtime/vframe.hpp"
51 #include "runtime/vmThread.hpp"
52 #include "runtime/vm_operations.hpp"
53 #include "services/serviceUtil.hpp"
54 #include "utilities/macros.hpp"
55 #if INCLUDE_ALL_GCS
56 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
57 #include "gc/parallel/parallelScavengeHeap.hpp"
58 #endif // INCLUDE_ALL_GCS
59
60 // JvmtiTagHashmapEntry
61 //
62 // Each entry encapsulates a reference to the tagged object
63 // and the tag value. In addition an entry includes a next pointer which
64 // is used to chain entries together.
65
66 class JvmtiTagHashmapEntry : public CHeapObj<mtInternal> {
67 private:
68 friend class JvmtiTagMap;
69
3159 }
3160 }
3161
3162 vf = vf->sender();
3163 is_top_frame = false;
3164 }
3165 } else {
3166 // no last java frame but there may be JNI locals
3167 blk->set_context(thread_tag, tid, 0, (jmethodID)NULL);
3168 java_thread->active_handles()->oops_do(blk);
3169 }
3170 return true;
3171 }
3172
3173
3174 // Collects the simple roots for all threads and collects all
3175 // stack roots - for each thread it walks the execution
3176 // stack to find all references and local JNI refs.
3177 inline bool VM_HeapWalkOperation::collect_stack_roots() {
3178 JNILocalRootsClosure blk;
3179 for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
3180 oop threadObj = thread->threadObj();
3181 if (threadObj != NULL && !thread->is_exiting() && !thread->is_hidden_from_external_view()) {
3182 // Collect the simple root for this thread before we
3183 // collect its stack roots
3184 if (!CallbackInvoker::report_simple_root(JVMTI_HEAP_REFERENCE_THREAD,
3185 threadObj)) {
3186 return false;
3187 }
3188 if (!collect_stack_roots(thread, &blk)) {
3189 return false;
3190 }
3191 }
3192 }
3193 return true;
3194 }
3195
3196 // visit an object
3197 // first mark the object as visited
3198 // second get all the outbound references from this object (in other words, all
3199 // the objects referenced by this object).
|