< prev index next >

src/hotspot/share/classfile/placeholders.hpp

Print this page
*** 44,15 ***
    // 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
!   };
  
    static PlaceholderEntry* get_entry(Symbol* name, ClassLoaderData* loader_data);
  
    // find_and_add returns probe pointer - old or new
    // If no entry exists, add a placeholder entry and push SeenThread for classloadAction
--- 44,17 ---
    // 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
+   // PRIMITIVE_OBJECT_FIELD: needed to check for inline type 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
!     PRIMITIVE_OBJECT_FIELD = 4     // primitive object fields
+  };
  
    static PlaceholderEntry* get_entry(Symbol* name, ClassLoaderData* loader_data);
  
    // find_and_add returns probe pointer - old or new
    // If no entry exists, add a placeholder entry and push SeenThread for classloadAction

*** 90,20 ***
  
    SeenThread*       _defineThreadQ; // queue of Threads trying to define this class
                                      // including _definer
                                      // _definer owns token
                                      // queue waits for and returns results from _definer
  
    SeenThread* actionToQueue(PlaceholderTable::classloadAction action);
    void set_threadQ(SeenThread* seenthread, PlaceholderTable::classloadAction action);
    void add_seen_thread(JavaThread* thread, PlaceholderTable::classloadAction action);
    bool remove_seen_thread(JavaThread* thread, PlaceholderTable::classloadAction action);
  
   public:
    PlaceholderEntry() :
       _supername(nullptr), _definer(nullptr), _instanceKlass(nullptr),
!      _superThreadQ(nullptr), _loadInstanceThreadQ(nullptr), _defineThreadQ(nullptr) { }
  
    Symbol*            supername()           const { return _supername; }
    void               set_supername(Symbol* supername) {
      Symbol::maybe_decrement_refcount(_supername);
      _supername = supername;
--- 92,22 ---
  
    SeenThread*       _defineThreadQ; // queue of Threads trying to define this class
                                      // including _definer
                                      // _definer owns token
                                      // queue waits for and returns results from _definer
+   SeenThread*       _inlineTypeFieldQ;  // queue of inline types for circularity checking
  
    SeenThread* actionToQueue(PlaceholderTable::classloadAction action);
    void set_threadQ(SeenThread* seenthread, PlaceholderTable::classloadAction action);
    void add_seen_thread(JavaThread* thread, PlaceholderTable::classloadAction action);
    bool remove_seen_thread(JavaThread* thread, PlaceholderTable::classloadAction action);
  
   public:
    PlaceholderEntry() :
       _supername(nullptr), _definer(nullptr), _instanceKlass(nullptr),
!      _superThreadQ(nullptr), _loadInstanceThreadQ(nullptr), _defineThreadQ(nullptr),
+      _inlineTypeFieldQ(nullptr) { }
  
    Symbol*            supername()           const { return _supername; }
    void               set_supername(Symbol* supername) {
      Symbol::maybe_decrement_refcount(_supername);
      _supername = supername;

*** 127,10 ***
--- 131,13 ---
    void               set_loadInstanceThreadQ(SeenThread* SeenThread) { _loadInstanceThreadQ = SeenThread; }
  
    SeenThread*        defineThreadQ()       const { return _defineThreadQ; }
    void               set_defineThreadQ(SeenThread* SeenThread) { _defineThreadQ = SeenThread; }
  
+   SeenThread*        inlineTypeFieldQ()    const { return _inlineTypeFieldQ; }
+   void               set_inlineTypeFieldQ(SeenThread* SeenThread) { _inlineTypeFieldQ = SeenThread; }
+ 
    bool super_load_in_progress() {
       return (_superThreadQ != NULL);
    }
  
    bool instance_load_in_progress() {

*** 139,10 ***
--- 146,14 ---
  
    bool define_class_in_progress() {
      return (_defineThreadQ != NULL);
    }
  
+   bool inline_type_field_in_progress() {
+     return (_inlineTypeFieldQ != NULL);
+   }
+ 
    // Used for ClassCircularityError checking
    bool check_seen_thread(JavaThread* thread, PlaceholderTable::classloadAction action);
  
    void print_on(outputStream* st) const;
  };
< prev index next >