17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_CLASSFILE_PLACEHOLDERS_HPP
26 #define SHARE_VM_CLASSFILE_PLACEHOLDERS_HPP
27
28 #include "runtime/thread.hpp"
29 #include "utilities/hashtable.hpp"
30
31 class PlaceholderEntry;
32
33 // Placeholder objects. These represent classes currently
34 // being loaded, as well as arrays of primitives.
35 //
36
37 class PlaceholderTable : public TwoOopHashtable<Symbol*, mtClass> {
38 friend class VMStructs;
39
40 public:
41 PlaceholderTable(int table_size);
42
43 PlaceholderEntry* new_entry(int hash, Symbol* name, ClassLoaderData* loader_data, bool havesupername, Symbol* supername);
44 void free_entry(PlaceholderEntry* entry);
45
46 PlaceholderEntry* bucket(int i) {
47 return (PlaceholderEntry*)Hashtable<Symbol*, mtClass>::bucket(i);
48 }
49
50 PlaceholderEntry** bucket_addr(int i) {
51 return (PlaceholderEntry**)Hashtable<Symbol*, mtClass>::bucket_addr(i);
52 }
53
54 void add_entry(int index, PlaceholderEntry* new_entry) {
55 Hashtable<Symbol*, mtClass>::add_entry(index, (HashtableEntry<Symbol*, mtClass>*)new_entry);
56 }
57
58 void add_entry(int index, unsigned int hash, Symbol* name,
132
133 #ifndef PRODUCT
134 void printActionQ() {
135 SeenThread* seen = this;
136 while (seen != NULL) {
137 seen->thread()->print_value();
138 tty->print(", ");
139 seen = seen->next();
140 }
141 }
142 #endif // PRODUCT
143 };
144
145 // Placeholder objects represent classes currently being loaded.
146 // All threads examining the placeholder table must hold the
147 // SystemDictionary_lock, so we don't need special precautions
148 // on store ordering here.
149 // The system dictionary is the only user of this class.
150
151 class PlaceholderEntry : public HashtableEntry<Symbol*, mtClass> {
152 friend class VMStructs;
153
154
155 private:
156 ClassLoaderData* _loader_data; // initiating loader
157 bool _havesupername; // distinguish between null supername, and unknown
158 Symbol* _supername;
159 Thread* _definer; // owner of define token
160 InstanceKlass* _instanceKlass; // InstanceKlass from successful define
161 SeenThread* _superThreadQ; // doubly-linked queue of Threads loading a superclass for this class
162 SeenThread* _loadInstanceThreadQ; // loadInstance thread
163 // can be multiple threads if classloader object lock broken by application
164 // or if classloader supports parallel classloading
165
166 SeenThread* _defineThreadQ; // queue of Threads trying to define this class
167 // including _definer
168 // _definer owns token
169 // queue waits for and returns results from _definer
170
171 public:
172 // Simple accessors, used only by SystemDictionary
173 Symbol* klassname() const { return literal(); }
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_CLASSFILE_PLACEHOLDERS_HPP
26 #define SHARE_VM_CLASSFILE_PLACEHOLDERS_HPP
27
28 #include "runtime/thread.hpp"
29 #include "utilities/hashtable.hpp"
30
31 class PlaceholderEntry;
32
33 // Placeholder objects. These represent classes currently
34 // being loaded, as well as arrays of primitives.
35 //
36
37 class PlaceholderTable : public Hashtable<Symbol*, mtClass> {
38
39 public:
40 PlaceholderTable(int table_size);
41
42 PlaceholderEntry* new_entry(int hash, Symbol* name, ClassLoaderData* loader_data, bool havesupername, Symbol* supername);
43 void free_entry(PlaceholderEntry* entry);
44
45 PlaceholderEntry* bucket(int i) {
46 return (PlaceholderEntry*)Hashtable<Symbol*, mtClass>::bucket(i);
47 }
48
49 PlaceholderEntry** bucket_addr(int i) {
50 return (PlaceholderEntry**)Hashtable<Symbol*, mtClass>::bucket_addr(i);
51 }
52
53 void add_entry(int index, PlaceholderEntry* new_entry) {
54 Hashtable<Symbol*, mtClass>::add_entry(index, (HashtableEntry<Symbol*, mtClass>*)new_entry);
55 }
56
57 void add_entry(int index, unsigned int hash, Symbol* name,
131
132 #ifndef PRODUCT
133 void printActionQ() {
134 SeenThread* seen = this;
135 while (seen != NULL) {
136 seen->thread()->print_value();
137 tty->print(", ");
138 seen = seen->next();
139 }
140 }
141 #endif // PRODUCT
142 };
143
144 // Placeholder objects represent classes currently being loaded.
145 // All threads examining the placeholder table must hold the
146 // SystemDictionary_lock, so we don't need special precautions
147 // on store ordering here.
148 // The system dictionary is the only user of this class.
149
150 class PlaceholderEntry : public HashtableEntry<Symbol*, mtClass> {
151
152 private:
153 ClassLoaderData* _loader_data; // initiating loader
154 bool _havesupername; // distinguish between null supername, and unknown
155 Symbol* _supername;
156 Thread* _definer; // owner of define token
157 InstanceKlass* _instanceKlass; // InstanceKlass from successful define
158 SeenThread* _superThreadQ; // doubly-linked queue of Threads loading a superclass for this class
159 SeenThread* _loadInstanceThreadQ; // loadInstance thread
160 // can be multiple threads if classloader object lock broken by application
161 // or if classloader supports parallel classloading
162
163 SeenThread* _defineThreadQ; // queue of Threads trying to define this class
164 // including _definer
165 // _definer owns token
166 // queue waits for and returns results from _definer
167
168 public:
169 // Simple accessors, used only by SystemDictionary
170 Symbol* klassname() const { return literal(); }
|