comparison src/share/vm/graal/graalEnv.cpp @ 3636:c7d4198a9bce

Use GraalEnv for installing code.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 15 Nov 2011 22:06:02 +0100
parents cb1181db8bec
children 2fd96b3040b9
comparison
equal deleted inserted replaced
3635:cb1181db8bec 3636:c7d4198a9bce
71 // ciEnv::get_klass_by_name_impl 71 // ciEnv::get_klass_by_name_impl
72 klassOop GraalEnv::get_klass_by_name_impl(KlassHandle accessing_klass, 72 klassOop GraalEnv::get_klass_by_name_impl(KlassHandle accessing_klass,
73 constantPoolHandle cpool, 73 constantPoolHandle cpool,
74 Symbol* sym, 74 Symbol* sym,
75 bool require_local) { 75 bool require_local) {
76 ASSERT_IN_VM;
77 EXCEPTION_CONTEXT; 76 EXCEPTION_CONTEXT;
78 77
79 // Now we need to check the SystemDictionary 78 // Now we need to check the SystemDictionary
80 if (sym->byte_at(0) == 'L' && 79 if (sym->byte_at(0) == 'L' &&
81 sym->byte_at(sym->utf8_length()-1) == ';') { 80 sym->byte_at(sym->utf8_length()-1) == ';') {
241 // in the accessor klass. 240 // in the accessor klass.
242 void GraalEnv::get_field_by_index_impl(instanceKlassHandle klass, fieldDescriptor& field_desc, 241 void GraalEnv::get_field_by_index_impl(instanceKlassHandle klass, fieldDescriptor& field_desc,
243 int index) { 242 int index) {
244 EXCEPTION_CONTEXT; 243 EXCEPTION_CONTEXT;
245 244
246 assert(klass->get_instanceKlass()->is_linked(), "must be linked before using its constan-pool"); 245 assert(klass->is_linked(), "must be linked before using its constan-pool");
247 246
248 constantPoolHandle cpool(thread, klass->constants()); 247 constantPoolHandle cpool(thread, klass->constants());
249 248
250 // Get the field's name, signature, and type. 249 // Get the field's name, signature, and type.
251 Symbol* name = cpool->name_ref_at(index); 250 Symbol* name = cpool->name_ref_at(index);
414 //bool counter_changed = system_dictionary_modification_counter_changed(); 413 //bool counter_changed = system_dictionary_modification_counter_changed();
415 //bool test_deps = counter_changed; 414 //bool test_deps = counter_changed;
416 //DEBUG_ONLY(test_deps = true); 415 //DEBUG_ONLY(test_deps = true);
417 //if (!test_deps) return; 416 //if (!test_deps) return;
418 417
419 bool print_failures = false;
420 DEBUG_ONLY(print_failures = !counter_changed);
421
422 bool keep_going = (print_failures || xtty != NULL);
423
424 int violated = 0;
425
426 for (Dependencies::DepStream deps(dependencies); deps.next(); ) { 418 for (Dependencies::DepStream deps(dependencies); deps.next(); ) {
427 klassOop witness = deps.check_dependency(); 419 klassOop witness = deps.check_dependency();
428 if (witness != NULL) { 420 if (witness != NULL) {
429 ++violated; 421 return false;
430 if (print_failures) deps.print_dependency(witness, /*verbose=*/ true); 422 }
431 // If there's no log and we're not sanity-checking, we're done. 423 }
432 if (!keep_going) break; 424
433 } 425 return true;
434 }
435
436 return violated == 0;
437 } 426 }
438 427
439 // ------------------------------------------------------------------ 428 // ------------------------------------------------------------------
440 // ciEnv::register_method 429 // ciEnv::register_method
441 nmethod* GraalEnv::register_method(methodHandle method, 430 nmethod* GraalEnv::register_method(methodHandle method,