30 class PlaceholderEntry;
31 class Thread;
32 class ClassLoaderData;
33
34 // Placeholder objects. These represent classes currently
35 // being loaded, as well as arrays of primitives.
36 //
37
38 class PlaceholderTable : public AllStatic {
39 public:
40 // caller to create a placeholder entry must enumerate an action
41 // caller claims ownership of that action
42 // For parallel classloading:
43 // multiple LOAD_INSTANCE threads can proceed in parallel
44 // multiple DETECT_CIRCULARITY threads can proceed in parallel
45 // DETECT_CIRCULARITY needed to check for class circularity
46 // DEFINE_CLASS: ultimately define class must be single threaded
47 // on a class/classloader basis
48 // so the head of that queue owns the token
49 // and the rest of the threads return the result the first thread gets
50 enum classloadAction {
51 LOAD_INSTANCE = 1, // calling load_instance_class
52 DETECT_CIRCULARITY = 2, // loading while detecting class circularity
53 DEFINE_CLASS = 3 // find_or_define class
54 };
55 static void initialize();
56 static PlaceholderEntry* get_entry(Symbol* name, ClassLoaderData* loader_data);
57
58 // find_and_add returns probe pointer - old or new
59 // If no entry exists, add a placeholder entry and push SeenThread for classloadAction
60 // If entry exists, reuse entry and push SeenThread for classloadAction
61 static PlaceholderEntry* find_and_add(Symbol* name, ClassLoaderData* loader_data,
62 classloadAction action, Symbol* supername,
63 JavaThread* thread);
64
65 // find_and_remove first removes SeenThread for classloadAction
66 // If all queues are empty and definer is null, remove the PlacheholderEntry completely
67 static void find_and_remove(Symbol* name, ClassLoaderData* loader_data,
68 classloadAction action, JavaThread* thread);
69
|
30 class PlaceholderEntry;
31 class Thread;
32 class ClassLoaderData;
33
34 // Placeholder objects. These represent classes currently
35 // being loaded, as well as arrays of primitives.
36 //
37
38 class PlaceholderTable : public AllStatic {
39 public:
40 // caller to create a placeholder entry must enumerate an action
41 // caller claims ownership of that action
42 // For parallel classloading:
43 // multiple LOAD_INSTANCE threads can proceed in parallel
44 // multiple DETECT_CIRCULARITY threads can proceed in parallel
45 // DETECT_CIRCULARITY needed to check for class circularity
46 // DEFINE_CLASS: ultimately define class must be single threaded
47 // on a class/classloader basis
48 // so the head of that queue owns the token
49 // and the rest of the threads return the result the first thread gets
50 // VALUE_OBJECT_FIELD: needed to check for inline type fields circularity
51 enum classloadAction {
52 LOAD_INSTANCE = 1, // calling load_instance_class
53 DETECT_CIRCULARITY = 2, // loading while detecting class circularity
54 DEFINE_CLASS = 3 // find_or_define class
55 };
56 static void initialize();
57 static PlaceholderEntry* get_entry(Symbol* name, ClassLoaderData* loader_data);
58
59 // find_and_add returns probe pointer - old or new
60 // If no entry exists, add a placeholder entry and push SeenThread for classloadAction
61 // If entry exists, reuse entry and push SeenThread for classloadAction
62 static PlaceholderEntry* find_and_add(Symbol* name, ClassLoaderData* loader_data,
63 classloadAction action, Symbol* supername,
64 JavaThread* thread);
65
66 // find_and_remove first removes SeenThread for classloadAction
67 // If all queues are empty and definer is null, remove the PlacheholderEntry completely
68 static void find_and_remove(Symbol* name, ClassLoaderData* loader_data,
69 classloadAction action, JavaThread* thread);
70
|