comparison src/share/vm/oops/instanceKlass.cpp @ 19412:e6637891a870

Simplify NodeClass management.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Mon, 16 Feb 2015 18:51:13 +0100
parents 52b4284cb496
children 7848fc12602b
comparison
equal deleted inserted replaced
19411:b029f5244371 19412:e6637891a870
292 set_nonstatic_field_size(0); 292 set_nonstatic_field_size(0);
293 set_is_marked_dependent(false); 293 set_is_marked_dependent(false);
294 set_init_state(InstanceKlass::allocated); 294 set_init_state(InstanceKlass::allocated);
295 set_init_thread(NULL); 295 set_init_thread(NULL);
296 set_reference_type(rt); 296 set_reference_type(rt);
297 #ifdef GRAAL
298 set_graal_node_class(NULL);
299 #endif
300 set_oop_map_cache(NULL); 297 set_oop_map_cache(NULL);
301 set_jni_ids(NULL); 298 set_jni_ids(NULL);
302 set_osr_nmethods_head(NULL); 299 set_osr_nmethods_head(NULL);
303 set_breakpoints(NULL); 300 set_breakpoints(NULL);
304 init_previous_versions(); 301 init_previous_versions();
323 320
324 // Set temporary value until parseClassFile updates it with the real instance 321 // Set temporary value until parseClassFile updates it with the real instance
325 // size. 322 // size.
326 set_layout_helper(Klass::instance_layout_helper(0, true)); 323 set_layout_helper(Klass::instance_layout_helper(0, true));
327 } 324 }
328
329 #ifdef GRAAL
330 void InstanceKlass::oops_do(OopClosure* cl) {
331 Klass::oops_do(cl);
332 cl->do_oop(adr_graal_node_class());
333 }
334 #endif
335 325
336 void InstanceKlass::deallocate_methods(ClassLoaderData* loader_data, 326 void InstanceKlass::deallocate_methods(ClassLoaderData* loader_data,
337 Array<Method*>* methods) { 327 Array<Method*>* methods) {
338 if (methods != NULL && methods != Universe::the_empty_method_array() && 328 if (methods != NULL && methods != Universe::the_empty_method_array() &&
339 !methods->is_shared()) { 329 !methods->is_shared()) {
1206 JavaCallArguments args; // No arguments 1196 JavaCallArguments args; // No arguments
1207 JavaValue result(T_VOID); 1197 JavaValue result(T_VOID);
1208 JavaCalls::call(&result, h_method, &args, CHECK); // Static call (no args) 1198 JavaCalls::call(&result, h_method, &args, CHECK); // Static call (no args)
1209 } 1199 }
1210 1200
1211 #ifdef GRAAL
1212 if (SystemDictionary::Node_klass() != NULL && this_oop->is_subtype_of(SystemDictionary::Node_klass())) {
1213 if (this_oop() != SystemDictionary::Node_klass()) {
1214 if (!GraalRuntime::is_HotSpotGraalRuntime_initialized() && JavaAssertions::systemClassDefault() == false) {
1215 // We want to ensure that the process of initializing HotSpotGraalRuntime
1216 // is fast since it executes at VM startup. We must avoid triggering
1217 // class initialization of any Node classes during this process.
1218 ResourceMark rm;
1219 char buf[200];
1220 jio_snprintf(buf, sizeof(buf), "Node subclass %s must not be initialized before HotSpotGraalRuntime is initialized", this_oop->name()->as_C_string());
1221 THROW_MSG(vmSymbols::java_lang_InternalError(), buf);
1222 }
1223 // Create the NodeClass for a Node subclass.
1224 TempNewSymbol sig = SymbolTable::new_symbol("(Ljava/lang/Class;)Lcom/oracle/graal/graph/NodeClass;", CHECK);
1225 JavaValue result(T_OBJECT);
1226 JavaCalls::call_static(&result, SystemDictionary::NodeClass_klass(), vmSymbols::get_name(), sig, this_oop->java_mirror(), CHECK);
1227 this_oop->set_graal_node_class((oop) result.get_jobject());
1228 } else {
1229 // A NodeClass cannot be created for Node due to checks in
1230 // NodeClass.FieldScanner.scanField()
1231 }
1232 }
1233 #endif
1234 } 1201 }
1235 1202
1236 1203
1237 void InstanceKlass::mask_for(methodHandle method, int bci, 1204 void InstanceKlass::mask_for(methodHandle method, int bci,
1238 InterpreterOopMap* entry_for) { 1205 InterpreterOopMap* entry_for) {
2307 // Unlink the class 2274 // Unlink the class
2308 if (is_linked()) { 2275 if (is_linked()) {
2309 unlink_class(); 2276 unlink_class();
2310 } 2277 }
2311 init_implementor(); 2278 init_implementor();
2312
2313 #ifdef GRAAL
2314 set_graal_node_class(NULL);
2315 #endif
2316 2279
2317 constants()->remove_unshareable_info(); 2280 constants()->remove_unshareable_info();
2318 2281
2319 for (int i = 0; i < methods()->length(); i++) { 2282 for (int i = 0; i < methods()->length(); i++) {
2320 Method* m = methods()->at(i); 2283 Method* m = methods()->at(i);