44 }
45 static unsigned hash(PlaceholderKey const& k) {
46 return (unsigned) k._name->identity_hash() ^ (int)((intptr_t)k._loader_data >> 3);
47 }
48 void print_on(outputStream* st) const;
49 };
50
51 const int _placeholder_table_size = 503; // Does this really have to be prime?
52 using InternalPlaceholderTable = ResourceHashtable<PlaceholderKey, PlaceholderEntry, _placeholder_table_size, AnyObj::C_HEAP, mtClass,
53 PlaceholderKey::hash, PlaceholderKey::equals>;
54 static InternalPlaceholderTable* _placeholders;
55
56 // SeenThread objects represent list of threads that are
57 // currently performing a load action on a class.
58 // For class circularity, set before loading a superclass.
59 // For bootclasssearchpath, set before calling load_instance_class.
60 // Defining must be single threaded on a class/classloader basis
61 // For DEFINE_CLASS, the head of the queue owns the
62 // define token and the rest of the threads wait to return the
63 // result the first thread gets.
64 class SeenThread: public CHeapObj<mtInternal> {
65 private:
66 JavaThread* _thread;
67 SeenThread* _stnext;
68 SeenThread* _stprev;
69 public:
70 SeenThread(JavaThread* thread) {
71 _thread = thread;
72 _stnext = nullptr;
73 _stprev = nullptr;
74 }
75 JavaThread* thread() const { return _thread;}
76 void set_thread(JavaThread* thread) { _thread = thread; }
77
78 SeenThread* next() const { return _stnext;}
79 void set_next(SeenThread* seen) { _stnext = seen; }
80 void set_prev(SeenThread* seen) { _stprev = seen; }
81
82 static void print_action_queue(SeenThread* seen, outputStream* st) {
83 while (seen != nullptr) {
|
44 }
45 static unsigned hash(PlaceholderKey const& k) {
46 return (unsigned) k._name->identity_hash() ^ (int)((intptr_t)k._loader_data >> 3);
47 }
48 void print_on(outputStream* st) const;
49 };
50
51 const int _placeholder_table_size = 503; // Does this really have to be prime?
52 using InternalPlaceholderTable = ResourceHashtable<PlaceholderKey, PlaceholderEntry, _placeholder_table_size, AnyObj::C_HEAP, mtClass,
53 PlaceholderKey::hash, PlaceholderKey::equals>;
54 static InternalPlaceholderTable* _placeholders;
55
56 // SeenThread objects represent list of threads that are
57 // currently performing a load action on a class.
58 // For class circularity, set before loading a superclass.
59 // For bootclasssearchpath, set before calling load_instance_class.
60 // Defining must be single threaded on a class/classloader basis
61 // For DEFINE_CLASS, the head of the queue owns the
62 // define token and the rest of the threads wait to return the
63 // result the first thread gets.
64 // For INLINE_FIELD, set when loading inline type fields for
65 // class circularity checking.
66 class SeenThread: public CHeapObj<mtInternal> {
67 private:
68 JavaThread* _thread;
69 SeenThread* _stnext;
70 SeenThread* _stprev;
71 public:
72 SeenThread(JavaThread* thread) {
73 _thread = thread;
74 _stnext = nullptr;
75 _stprev = nullptr;
76 }
77 JavaThread* thread() const { return _thread;}
78 void set_thread(JavaThread* thread) { _thread = thread; }
79
80 SeenThread* next() const { return _stnext;}
81 void set_next(SeenThread* seen) { _stnext = seen; }
82 void set_prev(SeenThread* seen) { _stprev = seen; }
83
84 static void print_action_queue(SeenThread* seen, outputStream* st) {
85 while (seen != nullptr) {
|