--- old/src/share/vm/runtime/stubRoutines.cpp 2015-06-19 15:52:00.000000000 -0700 +++ new/src/share/vm/runtime/stubRoutines.cpp 2015-06-19 15:52:00.000000000 -0700 @@ -174,6 +174,9 @@ } CodeBuffer buffer(_code1); StubGenerator_generate(&buffer, false); + // When new stubs added we need to make sure there is some space left + // to catch situation when we should increase size again. + assert(buffer.insts_remaining() > 200, "increase code_size1"); } } @@ -258,6 +261,9 @@ } CodeBuffer buffer(_code2); StubGenerator_generate(&buffer, true); + // When new stubs added we need to make sure there is some space left + // to catch situation when we should increase size again. + assert(buffer.insts_remaining() > 200, "increase code_size2"); } #ifdef ASSERT