src/share/vm/classfile/classLoaderData.hpp

Print this page
rev 7903 : fix volatile qualifier ClassLoaderDataGraphKlassIteratorAtomic::next_klass


 298   void remove_class(Klass* k);
 299   bool contains_klass(Klass* k);
 300   void record_dependency(Klass* to, TRAPS);
 301   void init_dependencies(TRAPS);
 302 
 303   void add_to_deallocate_list(Metadata* m);
 304 
 305   static ClassLoaderData* class_loader_data(oop loader);
 306   static ClassLoaderData* class_loader_data_or_null(oop loader);
 307   static ClassLoaderData* anonymous_class_loader_data(oop loader, TRAPS);
 308   static void print_loader(ClassLoaderData *loader_data, outputStream *out);
 309 
 310   // CDS support
 311   Metaspace* ro_metaspace();
 312   Metaspace* rw_metaspace();
 313   void initialize_shared_metaspaces();
 314 };
 315 
 316 // An iterator that distributes Klasses to parallel worker threads.
 317 class ClassLoaderDataGraphKlassIteratorAtomic : public StackObj {
 318   volatile Klass* _next_klass;
 319  public:
 320   ClassLoaderDataGraphKlassIteratorAtomic();
 321   Klass* next_klass();
 322  private:
 323   static Klass* next_klass_in_cldg(Klass* klass);
 324 };
 325 
 326 class ClassLoaderDataGraphMetaspaceIterator : public StackObj {
 327   ClassLoaderData* _data;
 328  public:
 329   ClassLoaderDataGraphMetaspaceIterator();
 330   ~ClassLoaderDataGraphMetaspaceIterator();
 331   bool repeat() { return _data != NULL; }
 332   Metaspace* get_next() {
 333     assert(_data != NULL, "Should not be NULL in call to the iterator");
 334     Metaspace* result = _data->metaspace_or_null();
 335     _data = _data->next();
 336     // This result might be NULL for class loaders without metaspace
 337     // yet.  It would be nice to return only non-null results but
 338     // there is no guarantee that there will be a non-null result


 298   void remove_class(Klass* k);
 299   bool contains_klass(Klass* k);
 300   void record_dependency(Klass* to, TRAPS);
 301   void init_dependencies(TRAPS);
 302 
 303   void add_to_deallocate_list(Metadata* m);
 304 
 305   static ClassLoaderData* class_loader_data(oop loader);
 306   static ClassLoaderData* class_loader_data_or_null(oop loader);
 307   static ClassLoaderData* anonymous_class_loader_data(oop loader, TRAPS);
 308   static void print_loader(ClassLoaderData *loader_data, outputStream *out);
 309 
 310   // CDS support
 311   Metaspace* ro_metaspace();
 312   Metaspace* rw_metaspace();
 313   void initialize_shared_metaspaces();
 314 };
 315 
 316 // An iterator that distributes Klasses to parallel worker threads.
 317 class ClassLoaderDataGraphKlassIteratorAtomic : public StackObj {
 318  Klass* volatile _next_klass;
 319  public:
 320   ClassLoaderDataGraphKlassIteratorAtomic();
 321   Klass* next_klass();
 322  private:
 323   static Klass* next_klass_in_cldg(Klass* klass);
 324 };
 325 
 326 class ClassLoaderDataGraphMetaspaceIterator : public StackObj {
 327   ClassLoaderData* _data;
 328  public:
 329   ClassLoaderDataGraphMetaspaceIterator();
 330   ~ClassLoaderDataGraphMetaspaceIterator();
 331   bool repeat() { return _data != NULL; }
 332   Metaspace* get_next() {
 333     assert(_data != NULL, "Should not be NULL in call to the iterator");
 334     Metaspace* result = _data->metaspace_or_null();
 335     _data = _data->next();
 336     // This result might be NULL for class loaders without metaspace
 337     // yet.  It would be nice to return only non-null results but
 338     // there is no guarantee that there will be a non-null result