< prev index next >

src/hotspot/share/classfile/placeholders.cpp

Print this page

 45   }
 46   static unsigned hash(PlaceholderKey const& k) {
 47     return (unsigned) k._name->identity_hash() ^ (int)((intptr_t)k._loader_data >> 3);
 48   }
 49   void print_on(outputStream* st) const;
 50 };
 51 
 52 const int _placeholder_table_size = 503;   // Does this really have to be prime?
 53 using InternalPlaceholderTable = ResourceHashtable<PlaceholderKey, PlaceholderEntry, _placeholder_table_size, AnyObj::C_HEAP, mtClass,
 54                   PlaceholderKey::hash, PlaceholderKey::equals>;
 55 static InternalPlaceholderTable* _placeholders;
 56 
 57 // SeenThread objects represent list of threads that are
 58 // currently performing a load action on a class.
 59 // For class circularity, set before loading a superclass.
 60 // For bootclasssearchpath, set before calling load_instance_class.
 61 // Defining must be single threaded on a class/classloader basis
 62 // For DEFINE_CLASS, the head of the queue owns the
 63 // define token and the rest of the threads wait to return the
 64 // result the first thread gets.


 65 class SeenThread: public CHeapObj<mtInternal> {
 66 private:
 67    JavaThread* _thread;
 68    SeenThread* _stnext;
 69    SeenThread* _stprev;
 70 public:
 71    SeenThread(JavaThread* thread) {
 72        _thread = thread;
 73        _stnext = nullptr;
 74        _stprev = nullptr;
 75    }
 76    JavaThread* thread()          const { return _thread;}
 77    void set_thread(JavaThread* thread) { _thread = thread; }
 78 
 79    SeenThread* next()        const { return _stnext;}
 80    void set_next(SeenThread* seen) { _stnext = seen; }
 81    void set_prev(SeenThread* seen) { _stprev = seen; }
 82 
 83   static void print_action_queue(SeenThread* seen, outputStream* st) {
 84     while (seen != nullptr) {

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