Mercurial > hg > graal-compiler
comparison src/share/vm/graal/graalRuntime.cpp @ 18618:0aec14bcf006
ensure the error message about missing Graal classes is printed exactly once
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 04 Dec 2014 15:28:02 +0100 |
parents | c307546c7b0a |
children | 4ca70b51c8bb |
comparison
equal
deleted
inserted
replaced
18615:c2da0aa9e675 | 18618:0aec14bcf006 |
---|---|
768 if (_FactoryKlass == NULL) { | 768 if (_FactoryKlass == NULL) { |
769 Thread* THREAD = Thread::current(); | 769 Thread* THREAD = Thread::current(); |
770 TempNewSymbol name = SymbolTable::new_symbol("com/oracle/graal/hotspot/loader/Factory", CHECK_ABORT); | 770 TempNewSymbol name = SymbolTable::new_symbol("com/oracle/graal/hotspot/loader/Factory", CHECK_ABORT); |
771 KlassHandle klass = SystemDictionary::resolve_or_fail(name, true, THREAD); | 771 KlassHandle klass = SystemDictionary::resolve_or_fail(name, true, THREAD); |
772 if (HAS_PENDING_EXCEPTION) { | 772 if (HAS_PENDING_EXCEPTION) { |
773 abort_on_pending_exception(PENDING_EXCEPTION, "Graal classes are not available"); | 773 static volatile int seen_error = 0; |
774 } | 774 if (!seen_error && Atomic::cmpxchg(1, &seen_error, 0) == 0) { |
775 // Only report the failure on the first thread that hits it | |
776 abort_on_pending_exception(PENDING_EXCEPTION, "Graal classes are not available"); | |
777 } else { | |
778 CLEAR_PENDING_EXCEPTION; | |
779 // Give first thread time to report the error. | |
780 os::sleep(THREAD, 100, false); | |
781 vm_abort(false); | |
782 } | |
783 } | |
784 | |
775 TempNewSymbol field_name = SymbolTable::new_symbol("useGraalClassLoader", CHECK_ABORT); | 785 TempNewSymbol field_name = SymbolTable::new_symbol("useGraalClassLoader", CHECK_ABORT); |
776 | |
777 fieldDescriptor field_desc; | 786 fieldDescriptor field_desc; |
778 if (klass->find_field(field_name, vmSymbols::bool_signature(), &field_desc) == NULL) { | 787 if (klass->find_field(field_name, vmSymbols::bool_signature(), &field_desc) == NULL) { |
779 ResourceMark rm; | 788 ResourceMark rm; |
780 fatal(err_msg("Invalid layout of %s at %s", field_name->as_C_string(), klass->external_name())); | 789 fatal(err_msg("Invalid layout of %s at %s", field_name->as_C_string(), klass->external_name())); |
781 } | 790 } |
791 | |
782 InstanceKlass* ik = InstanceKlass::cast(klass()); | 792 InstanceKlass* ik = InstanceKlass::cast(klass()); |
783 address addr = ik->static_field_addr(field_desc.offset() - InstanceMirrorKlass::offset_of_static_fields()); | 793 address addr = ik->static_field_addr(field_desc.offset() - InstanceMirrorKlass::offset_of_static_fields()); |
784 *((jboolean *) addr) = (jboolean) UseGraalClassLoader; | 794 *((jboolean *) addr) = (jboolean) UseGraalClassLoader; |
785 klass->initialize(CHECK_ABORT); | 795 klass->initialize(CHECK_ABORT); |
786 _FactoryKlass = klass(); | 796 _FactoryKlass = klass(); |