mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 20:14:43 +02:00
8055530: assert(_exits.control()->is_top() || !_gvn.type(ret_phi)->empty()) failed: return value must be well defined
Concurrent class loading causes return phi to become top Reviewed-by: kvn
This commit is contained in:
parent
add1e857d7
commit
186ca57447
4 changed files with 24 additions and 2 deletions
|
@ -39,6 +39,9 @@ const char* C2Compiler::retry_no_subsuming_loads() {
|
||||||
const char* C2Compiler::retry_no_escape_analysis() {
|
const char* C2Compiler::retry_no_escape_analysis() {
|
||||||
return "retry without escape analysis";
|
return "retry without escape analysis";
|
||||||
}
|
}
|
||||||
|
const char* C2Compiler::retry_class_loading_during_parsing() {
|
||||||
|
return "retry class loading during parsing";
|
||||||
|
}
|
||||||
bool C2Compiler::init_c2_runtime() {
|
bool C2Compiler::init_c2_runtime() {
|
||||||
|
|
||||||
// Check assumptions used while running ADLC
|
// Check assumptions used while running ADLC
|
||||||
|
@ -104,6 +107,10 @@ void C2Compiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) {
|
||||||
|
|
||||||
// Check result and retry if appropriate.
|
// Check result and retry if appropriate.
|
||||||
if (C.failure_reason() != NULL) {
|
if (C.failure_reason() != NULL) {
|
||||||
|
if (C.failure_reason_is(retry_class_loading_during_parsing())) {
|
||||||
|
env->report_failure(C.failure_reason());
|
||||||
|
continue; // retry
|
||||||
|
}
|
||||||
if (C.failure_reason_is(retry_no_subsuming_loads())) {
|
if (C.failure_reason_is(retry_no_subsuming_loads())) {
|
||||||
assert(subsume_loads, "must make progress");
|
assert(subsume_loads, "must make progress");
|
||||||
subsume_loads = false;
|
subsume_loads = false;
|
||||||
|
|
|
@ -47,6 +47,7 @@ public:
|
||||||
// sentinel value used to trigger backtracking in compile_method().
|
// sentinel value used to trigger backtracking in compile_method().
|
||||||
static const char* retry_no_subsuming_loads();
|
static const char* retry_no_subsuming_loads();
|
||||||
static const char* retry_no_escape_analysis();
|
static const char* retry_no_escape_analysis();
|
||||||
|
static const char* retry_class_loading_during_parsing();
|
||||||
|
|
||||||
// Print compilation timers and statistics
|
// Print compilation timers and statistics
|
||||||
void print_timers();
|
void print_timers();
|
||||||
|
|
|
@ -774,7 +774,9 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr
|
||||||
}
|
}
|
||||||
JVMState* jvms = build_start_state(start(), tf());
|
JVMState* jvms = build_start_state(start(), tf());
|
||||||
if ((jvms = cg->generate(jvms)) == NULL) {
|
if ((jvms = cg->generate(jvms)) == NULL) {
|
||||||
record_method_not_compilable("method parse failed");
|
if (!failure_reason_is(C2Compiler::retry_class_loading_during_parsing())) {
|
||||||
|
record_method_not_compilable("method parse failed");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GraphKit kit(jvms);
|
GraphKit kit(jvms);
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "interpreter/linkResolver.hpp"
|
#include "interpreter/linkResolver.hpp"
|
||||||
#include "oops/method.hpp"
|
#include "oops/method.hpp"
|
||||||
#include "opto/addnode.hpp"
|
#include "opto/addnode.hpp"
|
||||||
|
#include "opto/c2compiler.hpp"
|
||||||
#include "opto/castnode.hpp"
|
#include "opto/castnode.hpp"
|
||||||
#include "opto/idealGraphPrinter.hpp"
|
#include "opto/idealGraphPrinter.hpp"
|
||||||
#include "opto/locknode.hpp"
|
#include "opto/locknode.hpp"
|
||||||
|
@ -986,7 +987,18 @@ void Parse::do_exits() {
|
||||||
if (tf()->range()->cnt() > TypeFunc::Parms) {
|
if (tf()->range()->cnt() > TypeFunc::Parms) {
|
||||||
const Type* ret_type = tf()->range()->field_at(TypeFunc::Parms);
|
const Type* ret_type = tf()->range()->field_at(TypeFunc::Parms);
|
||||||
Node* ret_phi = _gvn.transform( _exits.argument(0) );
|
Node* ret_phi = _gvn.transform( _exits.argument(0) );
|
||||||
assert(_exits.control()->is_top() || !_gvn.type(ret_phi)->empty(), "return value must be well defined");
|
if (!_exits.control()->is_top() && _gvn.type(ret_phi)->empty()) {
|
||||||
|
// In case of concurrent class loading, the type we set for the
|
||||||
|
// ret_phi in build_exits() may have been too optimistic and the
|
||||||
|
// ret_phi may be top now.
|
||||||
|
#ifdef ASSERT
|
||||||
|
{
|
||||||
|
MutexLockerEx ml(Compile_lock, Mutex::_no_safepoint_check_flag);
|
||||||
|
assert(ret_type->isa_ptr() && C->env()->system_dictionary_modification_counter_changed(), "return value must be well defined");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
C->record_failure(C2Compiler::retry_class_loading_during_parsing());
|
||||||
|
}
|
||||||
_exits.push_node(ret_type->basic_type(), ret_phi);
|
_exits.push_node(ret_type->basic_type(), ret_phi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue