Mercurial > hg > graal-compiler
comparison src/share/vm/graal/graalCompiler.cpp @ 18134:6a2f814224b1
hotspot/graal: simplify CTW logic. now, the following configurations are supported:
(1) CTW with Graal, graal compiled by itself with bootstrap (--vm graal -XX:+BootstrapGraal -XX:-TieredCompilation -XX:+CompileTheWorld)
(2) CTW with Graal, graal compiled by C1/itself aka. tiered with bootstrap (--vm graal -XX:+BootstrapGraal -XX:+TieredCompilation +XX:+CompileTheWorld)
(3) CTW with Graal, graal compiled by itself without bootstrap (--vm graal -XX:-BootstrapGraal -XX:-TieredCompilation -XX:+CompileTheWorld)
(4) CTW with Graal, graal compiled by C1/itself aka. tiered without bootstrap (--vm graal -XX:-BootstrapGraal -XX:+TieredCompilation -XX:+CompileTheWorld)
(5) CTW with Graal, graal compiled by C1/C2 aka. hosted (--vm server -XX:+CompileTheWorld)
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Tue, 21 Oct 2014 10:17:06 +0200 |
parents | 6997fce99fa3 |
children | 70077134cabc |
comparison
equal
deleted
inserted
replaced
18133:5c1bd485c54b | 18134:6a2f814224b1 |
---|---|
60 HandleMark hm; | 60 HandleMark hm; |
61 | 61 |
62 // Graal is considered as application code so we need to | 62 // Graal is considered as application code so we need to |
63 // stop the VM deferring compilation now. | 63 // stop the VM deferring compilation now. |
64 CompilationPolicy::completed_vm_startup(); | 64 CompilationPolicy::completed_vm_startup(); |
65 | |
66 #ifndef PRODUCT | |
67 if (CompileTheWorld && !BootstrapGraal) { | |
68 compile_the_world(); | |
69 } | |
70 #endif | |
71 } | 65 } |
72 #endif // COMPILERGRAAL | 66 #endif // COMPILERGRAAL |
73 } | 67 } |
74 | 68 |
75 #ifdef COMPILERGRAAL | 69 #ifdef COMPILERGRAAL |
76 void GraalCompiler::bootstrap() { | 70 void GraalCompiler::bootstrap() { |
77 JavaThread* THREAD = JavaThread::current(); | 71 JavaThread* THREAD = JavaThread::current(); |
78 #ifndef PRODUCT | |
79 // We turn off CompileTheWorld so that compilation requests are not ignored during bootstrap. | |
80 bool doCTW = CompileTheWorld; | |
81 if (CompileTheWorld) { | |
82 CompileTheWorld = false; | |
83 } | |
84 #endif | |
85 _bootstrapping = true; | 72 _bootstrapping = true; |
86 ResourceMark rm; | 73 ResourceMark rm; |
87 HandleMark hm; | 74 HandleMark hm; |
88 if (PrintBootstrap) { | 75 if (PrintBootstrap) { |
89 tty->print("Bootstrapping Graal"); | 76 tty->print("Bootstrapping Graal"); |
119 | 106 |
120 if (PrintBootstrap) { | 107 if (PrintBootstrap) { |
121 tty->print_cr(" in " JLONG_FORMAT " ms (compiled %d methods)", os::javaTimeMillis() - start, _methodsCompiled); | 108 tty->print_cr(" in " JLONG_FORMAT " ms (compiled %d methods)", os::javaTimeMillis() - start, _methodsCompiled); |
122 } | 109 } |
123 _bootstrapping = false; | 110 _bootstrapping = false; |
124 #ifndef PRODUCT | |
125 if (doCTW) { | |
126 compile_the_world(); | |
127 } | |
128 #endif | |
129 } | 111 } |
130 | 112 |
131 void GraalCompiler::compile_method(methodHandle method, int entry_bci, CompileTask* task) { | 113 void GraalCompiler::compile_method(methodHandle method, int entry_bci, CompileTask* task) { |
132 GRAAL_EXCEPTION_CONTEXT | 114 GRAAL_EXCEPTION_CONTEXT |
133 | 115 |
165 | 147 |
166 #endif // COMPILERGRAAL | 148 #endif // COMPILERGRAAL |
167 | 149 |
168 #ifndef PRODUCT | 150 #ifndef PRODUCT |
169 void GraalCompiler::compile_the_world() { | 151 void GraalCompiler::compile_the_world() { |
170 // We turn off CompileTheWorld so that Graal can | |
171 // be compiled by C1/C2 when Graal does a CTW. | |
172 CompileTheWorld = false; | |
173 HandleMark hm; | 152 HandleMark hm; |
174 | |
175 JavaThread* THREAD = JavaThread::current(); | 153 JavaThread* THREAD = JavaThread::current(); |
176 TempNewSymbol name = SymbolTable::new_symbol("com/oracle/graal/hotspot/HotSpotGraalRuntime", CHECK_ABORT); | 154 TempNewSymbol name = SymbolTable::new_symbol("com/oracle/graal/hotspot/HotSpotGraalRuntime", CHECK_ABORT); |
177 KlassHandle klass = GraalRuntime::load_required_class(name); | 155 KlassHandle klass = GraalRuntime::load_required_class(name); |
178 TempNewSymbol compileTheWorld = SymbolTable::new_symbol("compileTheWorld", CHECK_ABORT); | 156 TempNewSymbol compileTheWorld = SymbolTable::new_symbol("compileTheWorld", CHECK_ABORT); |
179 JavaValue result(T_VOID); | 157 JavaValue result(T_VOID); |