@@ -142,6 +142,7 @@ OptoReg::Name Matcher::warp_incoming_stk_arg( VMReg reg ) {
142142 _in_arg_limit = OptoReg::add (warped, 1 ); // Bump max stack slot seen
143143 if (!RegMask::can_represent_arg (warped)) {
144144 // the compiler cannot represent this method's calling sequence
145+ // Bailout. We do not have space to represent all arguments.
145146 C->record_method_not_compilable (" unsupported incoming calling sequence" );
146147 return OptoReg::Bad;
147148 }
@@ -311,6 +312,7 @@ void Matcher::match( ) {
311312
312313 if (!RegMask::can_represent_arg (OptoReg::add (_out_arg_limit,-1 ))) {
313314 // the compiler cannot represent this method's calling sequence
315+ // Bailout. We do not have space to represent all arguments.
314316 C->record_method_not_compilable (" must be able to represent all call arguments in reg mask" );
315317 }
316318
@@ -358,6 +360,7 @@ void Matcher::match( ) {
358360 Node* xroot = xform ( C->root (), 1 );
359361 if (xroot == nullptr ) {
360362 Matcher::soft_match_failure (); // recursive matching process failed
363+ assert (false , " instruction match failed" );
361364 C->record_method_not_compilable (" instruction match failed" );
362365 } else {
363366 // During matching shared constants were attached to C->root()
@@ -389,7 +392,15 @@ void Matcher::match( ) {
389392 }
390393 }
391394 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 ());
393404 }
394405 if (C->failing ()) {
395406 // delete old;
@@ -1242,6 +1253,7 @@ OptoReg::Name Matcher::warp_outgoing_stk_arg( VMReg reg, OptoReg::Name begin_out
12421253 if ( warped >= out_arg_limit_per_call )
12431254 out_arg_limit_per_call = OptoReg::add (warped,1 );
12441255 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.
12451257 C->record_method_not_compilable (" unsupported calling sequence" );
12461258 return OptoReg::Bad;
12471259 }
@@ -1434,6 +1446,7 @@ MachNode *Matcher::match_sfpt( SafePointNode *sfpt ) {
14341446 uint r_cnt = mcall->tf ()->range ()->cnt ();
14351447 MachProjNode *proj = new MachProjNode ( mcall, r_cnt+10000 , RegMask::Empty, MachProjNode::fat_proj );
14361448 if (!RegMask::can_represent_arg (OptoReg::Name (out_arg_limit_per_call-1 ))) {
1449+ // Bailout. We do not have space to represent all arguments.
14371450 C->record_method_not_compilable (" unsupported outgoing calling sequence" );
14381451 } else {
14391452 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)
16211634 // out of stack space. See bugs 6272980 & 6227033 for more info.
16221635 LabelRootDepth++;
16231636 if (LabelRootDepth > MaxLabelRootDepth) {
1637+ // Bailout. Can for example be hit with a deep chain of operations.
16241638 C->record_method_not_compilable (" Out of stack space, increase MaxLabelRootDepth" );
16251639 return nullptr ;
16261640 }
0 commit comments