8159720: Failure of C2 compilation with tiered prevents some C1 compilations
If C2 fails to compile a method with tiered compilation, then it should mark the method as not compileable on the C2 tier only. Reviewed-by: twisti, thartmann
This commit is contained in:
parent
14621ff60c
commit
cc10eca0b0
@ -778,7 +778,7 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr
|
||||
}
|
||||
if (failing()) return;
|
||||
if (cg == NULL) {
|
||||
record_method_not_compilable_all_tiers("cannot parse method");
|
||||
record_method_not_compilable("cannot parse method");
|
||||
return;
|
||||
}
|
||||
JVMState* jvms = build_start_state(start(), tf());
|
||||
|
@ -823,16 +823,12 @@ class Compile : public Phase {
|
||||
}
|
||||
|
||||
void record_failure(const char* reason);
|
||||
void record_method_not_compilable(const char* reason, bool all_tiers = false) {
|
||||
// All bailouts cover "all_tiers" when TieredCompilation is off.
|
||||
if (!TieredCompilation) all_tiers = true;
|
||||
env()->record_method_not_compilable(reason, all_tiers);
|
||||
void record_method_not_compilable(const char* reason) {
|
||||
// Bailouts cover "all_tiers" when TieredCompilation is off.
|
||||
env()->record_method_not_compilable(reason, !TieredCompilation);
|
||||
// Record failure reason.
|
||||
record_failure(reason);
|
||||
}
|
||||
void record_method_not_compilable_all_tiers(const char* reason) {
|
||||
record_method_not_compilable(reason, true);
|
||||
}
|
||||
bool check_node_count(uint margin, const char* reason) {
|
||||
if (live_nodes() + margin > max_node_limit()) {
|
||||
record_method_not_compilable(reason);
|
||||
|
@ -124,7 +124,7 @@ OptoReg::Name Matcher::warp_incoming_stk_arg( VMReg reg ) {
|
||||
_in_arg_limit = OptoReg::add(warped, 1); // Bump max stack slot seen
|
||||
if (!RegMask::can_represent_arg(warped)) {
|
||||
// the compiler cannot represent this method's calling sequence
|
||||
C->record_method_not_compilable_all_tiers("unsupported incoming calling sequence");
|
||||
C->record_method_not_compilable("unsupported incoming calling sequence");
|
||||
return OptoReg::Bad;
|
||||
}
|
||||
return warped;
|
||||
@ -1120,7 +1120,7 @@ OptoReg::Name Matcher::warp_outgoing_stk_arg( VMReg reg, OptoReg::Name begin_out
|
||||
if( warped >= out_arg_limit_per_call )
|
||||
out_arg_limit_per_call = OptoReg::add(warped,1);
|
||||
if (!RegMask::can_represent_arg(warped)) {
|
||||
C->record_method_not_compilable_all_tiers("unsupported calling sequence");
|
||||
C->record_method_not_compilable("unsupported calling sequence");
|
||||
return OptoReg::Bad;
|
||||
}
|
||||
return warped;
|
||||
@ -1300,7 +1300,7 @@ MachNode *Matcher::match_sfpt( SafePointNode *sfpt ) {
|
||||
uint r_cnt = mcall->tf()->range()->cnt();
|
||||
MachProjNode *proj = new MachProjNode( mcall, r_cnt+10000, RegMask::Empty, MachProjNode::fat_proj );
|
||||
if (!RegMask::can_represent_arg(OptoReg::Name(out_arg_limit_per_call-1))) {
|
||||
C->record_method_not_compilable_all_tiers("unsupported outgoing calling sequence");
|
||||
C->record_method_not_compilable("unsupported outgoing calling sequence");
|
||||
} else {
|
||||
for (int i = begin_out_arg_area; i < out_arg_limit_per_call; i++)
|
||||
proj->_rout.Insert(OptoReg::Name(i));
|
||||
@ -1488,7 +1488,7 @@ Node *Matcher::Label_Root( const Node *n, State *svec, Node *control, const Node
|
||||
// out of stack space. See bugs 6272980 & 6227033 for more info.
|
||||
LabelRootDepth++;
|
||||
if (LabelRootDepth > MaxLabelRootDepth) {
|
||||
C->record_method_not_compilable_all_tiers("Out of stack space, increase MaxLabelRootDepth");
|
||||
C->record_method_not_compilable("Out of stack space, increase MaxLabelRootDepth");
|
||||
return NULL;
|
||||
}
|
||||
uint care = 0; // Edges matcher cares about
|
||||
|
@ -425,7 +425,7 @@ Parse::Parse(JVMState* caller, ciMethod* parse_method, float expected_uses)
|
||||
_iter.reset_to_method(method());
|
||||
_flow = method()->get_flow_analysis();
|
||||
if (_flow->failing()) {
|
||||
C->record_method_not_compilable_all_tiers(_flow->failure_reason());
|
||||
C->record_method_not_compilable(_flow->failure_reason());
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
@ -1118,7 +1118,7 @@ SafePointNode* Parse::create_entry_map() {
|
||||
// Check for really stupid bail-out cases.
|
||||
uint len = TypeFunc::Parms + method()->max_locals() + method()->max_stack();
|
||||
if (len >= 32760) {
|
||||
C->record_method_not_compilable_all_tiers("too many local variables");
|
||||
C->record_method_not_compilable("too many local variables");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user