@@ -142,6 +142,7 @@ OptoReg::Name Matcher::warp_incoming_stk_arg( VMReg reg ) {
142
142
_in_arg_limit = OptoReg::add (warped, 1 ); // Bump max stack slot seen
143
143
if (!RegMask::can_represent_arg (warped)) {
144
144
// the compiler cannot represent this method's calling sequence
145
+ // Bailout. We do not have space to represent all arguments.
145
146
C->record_method_not_compilable (" unsupported incoming calling sequence" );
146
147
return OptoReg::Bad;
147
148
}
@@ -311,6 +312,7 @@ void Matcher::match( ) {
311
312
312
313
if (!RegMask::can_represent_arg (OptoReg::add (_out_arg_limit,-1 ))) {
313
314
// the compiler cannot represent this method's calling sequence
315
+ // Bailout. We do not have space to represent all arguments.
314
316
C->record_method_not_compilable (" must be able to represent all call arguments in reg mask" );
315
317
}
316
318
@@ -358,6 +360,7 @@ void Matcher::match( ) {
358
360
Node* xroot = xform ( C->root (), 1 );
359
361
if (xroot == nullptr ) {
360
362
Matcher::soft_match_failure (); // recursive matching process failed
363
+ assert (false , " instruction match failed" );
361
364
C->record_method_not_compilable (" instruction match failed" );
362
365
} else {
363
366
// During matching shared constants were attached to C->root()
@@ -389,7 +392,15 @@ void Matcher::match( ) {
389
392
}
390
393
}
391
394
if (C->top () == nullptr || C->root () == nullptr ) {
392
- C->record_method_not_compilable (" graph lost" ); // %%% cannot happen?
395
+ // New graph lost. This is due to a compilation failure we encountered earlier.
396
+ stringStream ss;
397
+ if (C->failure_reason () != nullptr ) {
398
+ ss.print (" graph lost: %s" , C->failure_reason ());
399
+ } else {
400
+ assert (C->failure_reason () != nullptr , " graph lost: reason unknown" );
401
+ ss.print (" graph lost: reason unknown" );
402
+ }
403
+ C->record_method_not_compilable (ss.as_string ());
393
404
}
394
405
if (C->failing ()) {
395
406
// delete old;
@@ -1242,6 +1253,7 @@ OptoReg::Name Matcher::warp_outgoing_stk_arg( VMReg reg, OptoReg::Name begin_out
1242
1253
if ( warped >= out_arg_limit_per_call )
1243
1254
out_arg_limit_per_call = OptoReg::add (warped,1 );
1244
1255
if (!RegMask::can_represent_arg (warped)) {
1256
+ // Bailout. For example not enough space on stack for all arguments. Happens for methods with too many arguments.
1245
1257
C->record_method_not_compilable (" unsupported calling sequence" );
1246
1258
return OptoReg::Bad;
1247
1259
}
@@ -1434,6 +1446,7 @@ MachNode *Matcher::match_sfpt( SafePointNode *sfpt ) {
1434
1446
uint r_cnt = mcall->tf ()->range ()->cnt ();
1435
1447
MachProjNode *proj = new MachProjNode ( mcall, r_cnt+10000 , RegMask::Empty, MachProjNode::fat_proj );
1436
1448
if (!RegMask::can_represent_arg (OptoReg::Name (out_arg_limit_per_call-1 ))) {
1449
+ // Bailout. We do not have space to represent all arguments.
1437
1450
C->record_method_not_compilable (" unsupported outgoing calling sequence" );
1438
1451
} else {
1439
1452
for (int i = begin_out_arg_area; i < out_arg_limit_per_call; i++)
@@ -1621,6 +1634,7 @@ Node* Matcher::Label_Root(const Node* n, State* svec, Node* control, Node*& mem)
1621
1634
// out of stack space. See bugs 6272980 & 6227033 for more info.
1622
1635
LabelRootDepth++;
1623
1636
if (LabelRootDepth > MaxLabelRootDepth) {
1637
+ // Bailout. Can for example be hit with a deep chain of operations.
1624
1638
C->record_method_not_compilable (" Out of stack space, increase MaxLabelRootDepth" );
1625
1639
return nullptr ;
1626
1640
}
0 commit comments