Mercurial > hg > graal-compiler
comparison src/share/vm/classfile/classLoaderData.hpp @ 10405:f2110083203d
8005849: JEP 167: Event-Based JVM Tracing
Reviewed-by: acorn, coleenp, sla
Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
author | sla |
---|---|
date | Mon, 10 Jun 2013 11:30:51 +0200 |
parents | 9d75bcd7c890 |
children | e64f1fe9756b |
comparison
equal
deleted
inserted
replaced
10404:d0add7016434 | 10405:f2110083203d |
---|---|
29 #include "memory/memRegion.hpp" | 29 #include "memory/memRegion.hpp" |
30 #include "memory/metaspace.hpp" | 30 #include "memory/metaspace.hpp" |
31 #include "memory/metaspaceCounters.hpp" | 31 #include "memory/metaspaceCounters.hpp" |
32 #include "runtime/mutex.hpp" | 32 #include "runtime/mutex.hpp" |
33 #include "utilities/growableArray.hpp" | 33 #include "utilities/growableArray.hpp" |
34 | |
35 #if INCLUDE_TRACE | |
36 # include "trace/traceTime.hpp" | |
37 #endif | |
34 | 38 |
35 // | 39 // |
36 // A class loader represents a linkset. Conceptually, a linkset identifies | 40 // A class loader represents a linkset. Conceptually, a linkset identifies |
37 // the complete transitive closure of resolved links that a dynamic linker can | 41 // the complete transitive closure of resolved links that a dynamic linker can |
38 // produce. | 42 // produce. |
47 | 51 |
48 class ClassLoaderData; | 52 class ClassLoaderData; |
49 class JNIMethodBlock; | 53 class JNIMethodBlock; |
50 class JNIHandleBlock; | 54 class JNIHandleBlock; |
51 class Metadebug; | 55 class Metadebug; |
56 | |
52 // GC root for walking class loader data created | 57 // GC root for walking class loader data created |
53 | 58 |
54 class ClassLoaderDataGraph : public AllStatic { | 59 class ClassLoaderDataGraph : public AllStatic { |
55 friend class ClassLoaderData; | 60 friend class ClassLoaderData; |
56 friend class ClassLoaderDataGraphMetaspaceIterator; | 61 friend class ClassLoaderDataGraphMetaspaceIterator; |
61 static ClassLoaderData* _unloading; | 66 static ClassLoaderData* _unloading; |
62 // CMS support. | 67 // CMS support. |
63 static ClassLoaderData* _saved_head; | 68 static ClassLoaderData* _saved_head; |
64 | 69 |
65 static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS); | 70 static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS); |
71 static void post_class_unload_events(void); | |
66 public: | 72 public: |
67 static ClassLoaderData* find_or_create(Handle class_loader, TRAPS); | 73 static ClassLoaderData* find_or_create(Handle class_loader, TRAPS); |
68 static void purge(); | 74 static void purge(); |
69 static void clear_claimed_marks(); | 75 static void clear_claimed_marks(); |
70 static void oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim); | 76 static void oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim); |
71 static void always_strong_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim); | 77 static void always_strong_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim); |
72 static void keep_alive_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim); | 78 static void keep_alive_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim); |
73 static void classes_do(KlassClosure* klass_closure); | 79 static void classes_do(KlassClosure* klass_closure); |
80 static void classes_do(void f(Klass* const)); | |
81 static void classes_unloading_do(void f(Klass* const)); | |
74 static bool do_unloading(BoolObjectClosure* is_alive); | 82 static bool do_unloading(BoolObjectClosure* is_alive); |
75 | 83 |
76 // CMS support. | 84 // CMS support. |
77 static void remember_new_clds(bool remember) { _saved_head = (remember ? _head : NULL); } | 85 static void remember_new_clds(bool remember) { _saved_head = (remember ? _head : NULL); } |
78 static GrowableArray<ClassLoaderData*>* new_clds(); | 86 static GrowableArray<ClassLoaderData*>* new_clds(); |
83 | 91 |
84 #ifndef PRODUCT | 92 #ifndef PRODUCT |
85 // expensive test for pointer in metaspace for debugging | 93 // expensive test for pointer in metaspace for debugging |
86 static bool contains(address x); | 94 static bool contains(address x); |
87 static bool contains_loader_data(ClassLoaderData* loader_data); | 95 static bool contains_loader_data(ClassLoaderData* loader_data); |
96 #endif | |
97 | |
98 #if INCLUDE_TRACE | |
99 private: | |
100 static TracingTime _class_unload_time; | |
101 static void class_unload_event(Klass* const k); | |
88 #endif | 102 #endif |
89 }; | 103 }; |
90 | 104 |
91 // ClassLoaderData class | 105 // ClassLoaderData class |
92 | 106 |
169 bool claim(); | 183 bool claim(); |
170 | 184 |
171 void unload(); | 185 void unload(); |
172 bool keep_alive() const { return _keep_alive; } | 186 bool keep_alive() const { return _keep_alive; } |
173 bool is_alive(BoolObjectClosure* is_alive_closure) const; | 187 bool is_alive(BoolObjectClosure* is_alive_closure) const; |
174 | 188 void classes_do(void f(Klass*)); |
175 void classes_do(void f(InstanceKlass*)); | 189 void classes_do(void f(InstanceKlass*)); |
176 | 190 |
177 // Deallocate free list during class unloading. | 191 // Deallocate free list during class unloading. |
178 void free_deallocate_list(); | 192 void free_deallocate_list(); |
179 | 193 |