< prev index next >

src/hotspot/share/classfile/placeholders.hpp

Print this page

        

*** 72,85 **** // LOAD_SUPER needed to check for class circularity // DEFINE_CLASS: ultimately define class must be single threaded // on a class/classloader basis // so the head of that queue owns the token // and the rest of the threads return the result the first thread gets enum classloadAction { LOAD_INSTANCE = 1, // calling load_instance_class LOAD_SUPER = 2, // loading superclass for this class ! DEFINE_CLASS = 3 // find_or_define class }; // find_and_add returns probe pointer - old or new // If no entry exists, add a placeholder entry and push SeenThread for classloadAction // If entry exists, reuse entry and push SeenThread for classloadAction --- 72,87 ---- // LOAD_SUPER needed to check for class circularity // DEFINE_CLASS: ultimately define class must be single threaded // on a class/classloader basis // so the head of that queue owns the token // and the rest of the threads return the result the first thread gets + // FLATTENABLE_FIELD: needed to check for value type flattenable fields circularity enum classloadAction { LOAD_INSTANCE = 1, // calling load_instance_class LOAD_SUPER = 2, // loading superclass for this class ! DEFINE_CLASS = 3, // find_or_define class ! FLATTENABLE_FIELD = 4 // flattenable value type fields }; // find_and_add returns probe pointer - old or new // If no entry exists, add a placeholder entry and push SeenThread for classloadAction // If entry exists, reuse entry and push SeenThread for classloadAction
*** 107,116 **** --- 109,120 ---- // For bootclasssearchpath, set before calling load_instance_class. // Defining must be single threaded on a class/classloader basis // For DEFINE_CLASS, the head of the queue owns the // define token and the rest of the threads wait to return the // result the first thread gets. + // For FLATTENABLE_FIELD, set when loading value type fields for + // class circularity checking. class SeenThread: public CHeapObj<mtInternal> { private: Thread *_thread; SeenThread* _stnext; SeenThread* _stprev;
*** 158,167 **** --- 162,172 ---- SeenThread* _defineThreadQ; // queue of Threads trying to define this class // including _definer // _definer owns token // queue waits for and returns results from _definer + SeenThread* _flattenableFieldQ; // queue of value types for circularity checking public: // Simple accessors, used only by SystemDictionary Symbol* klassname() const { return literal(); }
*** 190,199 **** --- 195,207 ---- void set_loadInstanceThreadQ(SeenThread* SeenThread) { _loadInstanceThreadQ = SeenThread; } SeenThread* defineThreadQ() const { return _defineThreadQ; } void set_defineThreadQ(SeenThread* SeenThread) { _defineThreadQ = SeenThread; } + SeenThread* flattenableFieldQ() const { return _flattenableFieldQ; } + void set_flattenableFieldQ(SeenThread* SeenThread) { _flattenableFieldQ = SeenThread; } + PlaceholderEntry* next() const { return (PlaceholderEntry*)HashtableEntry<Symbol*, mtClass>::next(); } PlaceholderEntry** next_addr() {
*** 214,224 **** break; case PlaceholderTable::LOAD_SUPER: queuehead = _superThreadQ; break; case PlaceholderTable::DEFINE_CLASS: ! queuehead = _defineThreadQ; break; default: Unimplemented(); } return queuehead; } --- 222,235 ---- break; case PlaceholderTable::LOAD_SUPER: queuehead = _superThreadQ; break; case PlaceholderTable::DEFINE_CLASS: ! queuehead = _defineThreadQ; ! break; ! case PlaceholderTable::FLATTENABLE_FIELD: ! queuehead = _flattenableFieldQ; break; default: Unimplemented(); } return queuehead; }
*** 232,241 **** --- 243,255 ---- _superThreadQ = seenthread; break; case PlaceholderTable::DEFINE_CLASS: _defineThreadQ = seenthread; break; + case PlaceholderTable::FLATTENABLE_FIELD: + _flattenableFieldQ = seenthread; + break; default: Unimplemented(); } return; }
*** 249,258 **** --- 263,276 ---- bool define_class_in_progress() { return (_defineThreadQ != NULL); } + bool flattenable_field_in_progress() { + return (_flattenableFieldQ != NULL); + } + // Doubly-linked list of Threads per action for class/classloader pair // Class circularity support: links in thread before loading superclass // bootstrapsearchpath support: links in a thread before load_instance_class // definers: use as queue of define requestors, including owner of // define token. Appends for debugging of requestor order
< prev index next >