comparison src/share/vm/oops/instanceKlass.cpp @ 15926:af0e42dad358

reduced time to initialize ForeignCallProviders by avoiding triggering class initialization of Node subclasses as well as making annotation parsing lazy in SnippetInfo
author Doug Simon <doug.simon@oracle.com>
date Tue, 27 May 2014 15:43:36 +0200
parents bd4c7b669bd8
children 66a9286203a2
comparison
equal deleted inserted replaced
15925:674d4065e9fb 15926:af0e42dad358
57 #include "runtime/thread.inline.hpp" 57 #include "runtime/thread.inline.hpp"
58 #include "services/classLoadingService.hpp" 58 #include "services/classLoadingService.hpp"
59 #include "services/threadService.hpp" 59 #include "services/threadService.hpp"
60 #include "utilities/dtrace.hpp" 60 #include "utilities/dtrace.hpp"
61 #include "utilities/macros.hpp" 61 #include "utilities/macros.hpp"
62 #ifdef GRAAL
63 #include "classfile/javaAssertions.hpp"
64 #include "graal/graalVMToCompiler.hpp"
65 #endif
62 #if INCLUDE_ALL_GCS 66 #if INCLUDE_ALL_GCS
63 #include "gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp" 67 #include "gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp"
64 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" 68 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
65 #include "gc_implementation/g1/g1OopClosures.inline.hpp" 69 #include "gc_implementation/g1/g1OopClosures.inline.hpp"
66 #include "gc_implementation/g1/g1RemSet.inline.hpp" 70 #include "gc_implementation/g1/g1RemSet.inline.hpp"
1203 } 1207 }
1204 1208
1205 #ifdef GRAAL 1209 #ifdef GRAAL
1206 if (this_oop->is_subtype_of(SystemDictionary::Node_klass())) { 1210 if (this_oop->is_subtype_of(SystemDictionary::Node_klass())) {
1207 if (this_oop() != SystemDictionary::Node_klass()) { 1211 if (this_oop() != SystemDictionary::Node_klass()) {
1212 if (!VMToCompiler::is_HotSpotGraalRuntime_initialized() && JavaAssertions::systemClassDefault() == false) {
1213 // We want to ensure that the process of initializing HotSpotGraalRuntime
1214 // is fast since it executes at VM startup. We must avoid triggering
1215 // class initialization of any Node classes during this process.
1216 ResourceMark rm;
1217 char buf[200];
1218 jio_snprintf(buf, sizeof(buf), "Node subclass %s must not be initialized before HotSpotGraalRuntime is initialized", this_oop->name()->as_C_string());
1219 THROW_MSG(vmSymbols::java_lang_InternalError(), buf);
1220 }
1208 // Create the NodeClass for a Node subclass. 1221 // Create the NodeClass for a Node subclass.
1209 TempNewSymbol sig = SymbolTable::new_symbol("(Ljava/lang/Class;)Lcom/oracle/graal/graph/NodeClass;", CHECK); 1222 TempNewSymbol sig = SymbolTable::new_symbol("(Ljava/lang/Class;)Lcom/oracle/graal/graph/NodeClass;", CHECK);
1210 JavaValue result(T_OBJECT); 1223 JavaValue result(T_OBJECT);
1211 JavaCalls::call_static(&result, SystemDictionary::NodeClass_klass(), vmSymbols::get_name(), sig, this_oop->java_mirror(), CHECK); 1224 JavaCalls::call_static(&result, SystemDictionary::NodeClass_klass(), vmSymbols::get_name(), sig, this_oop->java_mirror(), CHECK);
1212 this_oop->set_graal_node_class((oop) result.get_jobject()); 1225 this_oop->set_graal_node_class((oop) result.get_jobject());