--- old/src/share/vm/opto/output.cpp 2015-10-16 12:25:14.825380944 -0400 +++ new/src/share/vm/opto/output.cpp 2015-10-16 12:25:14.637375668 -0400 @@ -1486,7 +1486,11 @@ // Compute the size of the first block _first_block_size = blk_labels[1].loc_pos() - blk_labels[0].loc_pos(); - assert(cb->insts_size() < 500000, "method is unreasonably large"); + // Record compilation failure and return, if method is very large. + if (cb->insts_size() >= 500000) { + C->record_failure("method is unreasonably large"); + return; + } #ifdef ASSERT for (uint i = 0; i < nblocks; i++) { // For all blocks