comparison src/share/vm/graal/graalCompiler.cpp @ 3651:a31028282e3e

Support blocking compilation.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Wed, 16 Nov 2011 23:35:03 +0100
parents 0e8a2a629afb
children 6aef50c6d967
comparison
equal deleted inserted replaced
3650:0e8a2a629afb 3651:a31028282e3e
79 tty->print_cr("Invalid option for graal!"); 79 tty->print_cr("Invalid option for graal!");
80 vm_abort(false); 80 vm_abort(false);
81 } 81 }
82 } 82 }
83 VMExits::startCompiler(); 83 VMExits::startCompiler();
84 } 84
85 85 _initialized = true;
86 _initialized = true; 86 if (BootstrapGraal) {
87 if (BootstrapGraal) { 87 VMExits::bootstrap();
88 VMExits::bootstrap(); 88 }
89 } 89 }
90 } 90 }
91 91
92 void GraalCompiler::initialize_buffer_blob() { 92 void GraalCompiler::initialize_buffer_blob() {
93 93
102 guarantee(blob != NULL, "must create code buffer"); 102 guarantee(blob != NULL, "must create code buffer");
103 THREAD->set_buffer_blob(blob); 103 THREAD->set_buffer_blob(blob);
104 } 104 }
105 } 105 }
106 106
107 void GraalCompiler::compile_method(methodHandle method, int entry_bci) { 107 void GraalCompiler::compile_method(methodHandle method, int entry_bci, jboolean blocking) {
108 EXCEPTION_CONTEXT 108 EXCEPTION_CONTEXT
109 if (!_initialized) return; 109 if (!_initialized) {
110 method->clear_queued_for_compilation();
111 method->invocation_counter()->reset();
112 method->backedge_counter()->reset();
113 return;
114 }
110 assert(_initialized, "must already be initialized"); 115 assert(_initialized, "must already be initialized");
111 ResourceMark rm; 116 ResourceMark rm;
112 ciEnv* current_env = JavaThread::current()->env(); 117 ciEnv* current_env = JavaThread::current()->env();
113 JavaThread::current()->set_env(NULL); 118 JavaThread::current()->set_env(NULL);
114 JavaThread::current()->set_compiling(true); 119 JavaThread::current()->set_compiling(true);
115 Handle hotspot_method = GraalCompiler::createHotSpotMethodResolved(method, CHECK); 120 Handle hotspot_method = GraalCompiler::createHotSpotMethodResolved(method, CHECK);
116 VMExits::compileMethod(hotspot_method, entry_bci); 121 VMExits::compileMethod(hotspot_method, entry_bci, blocking);
117 JavaThread::current()->set_compiling(false); 122 JavaThread::current()->set_compiling(false);
118 JavaThread::current()->set_env(current_env); 123 JavaThread::current()->set_env(current_env);
119 } 124 }
120 125
121 // Compilation entry point for methods 126 // Compilation entry point for methods
122 void GraalCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) { 127 void GraalCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) {
123 VM_ENTRY_MARK; 128 ShouldNotReachHere();
124 ResourceMark rm;
125 HandleMark hm;
126
127 TRACE_graal_2("GraalCompiler::compile_method");
128
129
130 compile_method((methodOop)target->get_oop(), entry_bci);
131
132 TRACE_graal_2("GraalCompiler::compile_method exit");
133 } 129 }
134 130
135 void GraalCompiler::exit() { 131 void GraalCompiler::exit() {
136 if (_initialized) { 132 if (_initialized) {
137 VMExits::shutdownCompiler(); 133 VMExits::shutdownCompiler();