Mercurial > hg > truffle
comparison src/share/vm/graal/graalCompiler.hpp @ 16006:66a9286203a2
decoupled Graal runtime initialization and Graal compilation queue initialization
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 03 Jun 2014 11:51:27 +0200 |
parents | 063ec2920d21 |
children | d32be0297274 |
comparison
equal
deleted
inserted
replaced
16003:83433cf49019 | 16006:66a9286203a2 |
---|---|
29 class GraalCompiler : public AbstractCompiler { | 29 class GraalCompiler : public AbstractCompiler { |
30 | 30 |
31 private: | 31 private: |
32 | 32 |
33 #ifdef COMPILERGRAAL | 33 #ifdef COMPILERGRAAL |
34 // Set to true once VMToCompiler.startCompiler() returns | 34 bool _bootstrapping; |
35 bool _started; | 35 |
36 void start_compilation_queue(); | |
37 void shutdown_compilation_queue(); | |
38 void bootstrap(); | |
36 #endif | 39 #endif |
37 | 40 |
38 static GraalCompiler* _instance; | 41 static GraalCompiler* _instance; |
39 | 42 |
40 public: | 43 public: |
64 void compile_method(methodHandle target, int entry_bci, CompileTask* task, jboolean blocking); | 67 void compile_method(methodHandle target, int entry_bci, CompileTask* task, jboolean blocking); |
65 | 68 |
66 // Print compilation timers and statistics | 69 // Print compilation timers and statistics |
67 virtual void print_timers(); | 70 virtual void print_timers(); |
68 | 71 |
72 // Print compilation statistics | |
73 void reset_compilation_stats(); | |
74 | |
69 void shutdown(); | 75 void shutdown(); |
76 #endif // COMPILERGRAAL | |
77 | |
78 #ifndef PRODUCT | |
79 void compile_the_world(); | |
70 #endif | 80 #endif |
71 }; | 81 }; |
72 | 82 |
83 #ifdef COMPILERGRAAL | |
84 /** | |
85 * Creates a scope in which scheduling a Graal compilation is disabled. | |
86 * Scheduling a compilation can happen anywhere a counter can overflow and | |
87 * calling back into the Java code for scheduling a compilation (i.e., | |
88 * CompilationTask.compileMetaspaceMethod()) from such arbitrary locations | |
89 * can cause objects to be in an unexpected state. | |
90 * | |
91 * In addition, it can be useful to disable compilation scheduling in | |
92 * other circumstances such as when initializing the Graal compilation | |
93 * queue or when running the Graal bootstrap process. | |
94 */ | |
95 class NoGraalCompilationScheduling: public StackObj { | |
96 private: | |
97 JavaThread* _thread; | |
98 public: | |
99 | |
100 NoGraalCompilationScheduling(JavaThread *thread) { | |
101 assert(thread == JavaThread::current(), "not the current thread"); | |
102 assert(thread->can_schedule_graal_compilation(), "recursive Graal compilation scheduling"); | |
103 _thread = thread; | |
104 thread->set_can_schedule_graal_compilation(false); | |
105 } | |
106 | |
107 ~NoGraalCompilationScheduling() { | |
108 assert(!_thread->can_schedule_graal_compilation(), "unexpected Graal compilation scheduling state"); | |
109 _thread->set_can_schedule_graal_compilation(true); | |
110 } | |
111 }; | |
112 #endif // COMPILERGRAAL | |
113 | |
73 #endif // SHARE_VM_GRAAL_GRAAL_COMPILER_HPP | 114 #endif // SHARE_VM_GRAAL_GRAAL_COMPILER_HPP |