comparison src/share/vm/classfile/classLoaderData.hpp @ 10184:9d75bcd7c890

8013136: NPG: Parallel class loading tests fail after fix for JDK-8011802 Summary: Move initialization of dependencies to before allocation of CLD Reviewed-by: stefank, coleenp
author mgerdin
date Wed, 24 Apr 2013 19:55:02 +0200
parents 1cb4795305b9
children f2110083203d
comparison
equal deleted inserted replaced
10183:868d87ed63c8 10184:9d75bcd7c890
98 void locked_add(objArrayHandle last, 98 void locked_add(objArrayHandle last,
99 objArrayHandle new_dependency, 99 objArrayHandle new_dependency,
100 Thread* THREAD); 100 Thread* THREAD);
101 public: 101 public:
102 Dependencies() : _list_head(NULL) {} 102 Dependencies() : _list_head(NULL) {}
103 Dependencies(TRAPS) : _list_head(NULL) {
104 init(CHECK);
105 }
103 void add(Handle dependency, TRAPS); 106 void add(Handle dependency, TRAPS);
104 void init(TRAPS); 107 void init(TRAPS);
105 void oops_do(OopClosure* f); 108 void oops_do(OopClosure* f);
106 }; 109 };
107 110
148 static Metaspace* _rw_metaspace; 151 static Metaspace* _rw_metaspace;
149 152
150 void set_next(ClassLoaderData* next) { _next = next; } 153 void set_next(ClassLoaderData* next) { _next = next; }
151 ClassLoaderData* next() const { return _next; } 154 ClassLoaderData* next() const { return _next; }
152 155
153 ClassLoaderData(Handle h_class_loader, bool is_anonymous); 156 ClassLoaderData(Handle h_class_loader, bool is_anonymous, Dependencies dependencies);
154 ~ClassLoaderData(); 157 ~ClassLoaderData();
155 158
156 void set_metaspace(Metaspace* m) { _metaspace = m; } 159 void set_metaspace(Metaspace* m) { _metaspace = m; }
157 160
158 JNIHandleBlock* handles() const; 161 JNIHandleBlock* handles() const;
188 bool is_anonymous() const { return _is_anonymous; } 191 bool is_anonymous() const { return _is_anonymous; }
189 192
190 static void init_null_class_loader_data() { 193 static void init_null_class_loader_data() {
191 assert(_the_null_class_loader_data == NULL, "cannot initialize twice"); 194 assert(_the_null_class_loader_data == NULL, "cannot initialize twice");
192 assert(ClassLoaderDataGraph::_head == NULL, "cannot initialize twice"); 195 assert(ClassLoaderDataGraph::_head == NULL, "cannot initialize twice");
193 _the_null_class_loader_data = new ClassLoaderData((oop)NULL, false); 196
197 // We explicitly initialize the Dependencies object at a later phase in the initialization
198 _the_null_class_loader_data = new ClassLoaderData((oop)NULL, false, Dependencies());
194 ClassLoaderDataGraph::_head = _the_null_class_loader_data; 199 ClassLoaderDataGraph::_head = _the_null_class_loader_data;
195 assert(_the_null_class_loader_data->is_the_null_class_loader_data(), "Must be"); 200 assert(_the_null_class_loader_data->is_the_null_class_loader_data(), "Must be");
196 if (DumpSharedSpaces) { 201 if (DumpSharedSpaces) {
197 _the_null_class_loader_data->initialize_shared_metaspaces(); 202 _the_null_class_loader_data->initialize_shared_metaspaces();
198 } 203 }