120 |
120 |
121 bool is_osr = entry_bci != InvocationEntryBci; |
121 bool is_osr = entry_bci != InvocationEntryBci; |
122 if (_bootstrapping && is_osr) { |
122 if (_bootstrapping && is_osr) { |
123 // no OSR compilations during bootstrap - the compiler is just too slow at this point, |
123 // no OSR compilations during bootstrap - the compiler is just too slow at this point, |
124 // and we know that there are no endless loops |
124 // and we know that there are no endless loops |
|
125 env->set_failure(true, "No OSR during boostrap"); |
125 return; |
126 return; |
126 } |
127 } |
127 |
128 |
128 JVMCIRuntime::initialize_well_known_classes(CHECK_EXIT); |
129 JVMCIRuntime::initialize_well_known_classes(CHECK_EXIT); |
129 |
130 |
158 java_lang_Throwable::java_printStackTrace(exception, THREAD); |
159 java_lang_Throwable::java_printStackTrace(exception, THREAD); |
159 if (HAS_PENDING_EXCEPTION) { |
160 if (HAS_PENDING_EXCEPTION) { |
160 CLEAR_PENDING_EXCEPTION; |
161 CLEAR_PENDING_EXCEPTION; |
161 } |
162 } |
162 |
163 |
163 env->set_failure("exception throw", false); |
164 env->set_failure(false, "unexpected exception thrown"); |
164 } else { |
165 } else { |
165 oop result_object = (oop) result.get_jobject(); |
166 oop result_object = (oop) result.get_jobject(); |
166 if (result_object != NULL) { |
167 if (result_object != NULL) { |
167 oop failure_message = HotSpotCompilationRequestResult::failureMessage(result_object); |
168 oop failure_message = HotSpotCompilationRequestResult::failureMessage(result_object); |
168 if (failure_message != NULL) { |
169 if (failure_message != NULL) { |
|
170 // Copy failure reason into resource memory first ... |
169 const char* failure_reason = java_lang_String::as_utf8_string(failure_message); |
171 const char* failure_reason = java_lang_String::as_utf8_string(failure_message); |
170 env->set_failure(failure_reason, HotSpotCompilationRequestResult::retry(result_object) != 0); |
172 // ... and then into the C heap. |
|
173 failure_reason = os::strdup(failure_reason, mtCompiler); |
|
174 bool retryable = HotSpotCompilationRequestResult::retry(result_object) != 0; |
|
175 env->set_failure(retryable, failure_reason, true); |
171 } else { |
176 } else { |
172 if (env->task()->code() == NULL) { |
177 if (env->task()->code() == NULL) { |
173 env->set_failure("no nmethod produced", true); |
178 env->set_failure(true, "no nmethod produced"); |
174 } else { |
179 } else { |
175 env->task()->set_num_inlined_bytecodes(HotSpotCompilationRequestResult::inlinedBytecodes(result_object)); |
180 env->task()->set_num_inlined_bytecodes(HotSpotCompilationRequestResult::inlinedBytecodes(result_object)); |
176 Atomic::inc(&_methods_compiled); |
181 Atomic::inc(&_methods_compiled); |
177 } |
182 } |
178 } |
183 } |