172 if (_code1 == NULL) { |
172 if (_code1 == NULL) { |
173 vm_exit_out_of_memory(code_size1, OOM_MALLOC_ERROR, "CodeCache: no room for StubRoutines (1)"); |
173 vm_exit_out_of_memory(code_size1, OOM_MALLOC_ERROR, "CodeCache: no room for StubRoutines (1)"); |
174 } |
174 } |
175 CodeBuffer buffer(_code1); |
175 CodeBuffer buffer(_code1); |
176 StubGenerator_generate(&buffer, false); |
176 StubGenerator_generate(&buffer, false); |
|
177 // When new stubs added we need to make sure there is some space left |
|
178 // to catch situation when we should increase size again. |
|
179 assert(buffer.insts_remaining() > 200, "increase code_size1"); |
177 } |
180 } |
178 } |
181 } |
179 |
182 |
180 |
183 |
181 #ifdef ASSERT |
184 #ifdef ASSERT |
224 if (_code2 == NULL) { |
227 if (_code2 == NULL) { |
225 vm_exit_out_of_memory(code_size2, OOM_MALLOC_ERROR, "CodeCache: no room for StubRoutines (2)"); |
228 vm_exit_out_of_memory(code_size2, OOM_MALLOC_ERROR, "CodeCache: no room for StubRoutines (2)"); |
226 } |
229 } |
227 CodeBuffer buffer(_code2); |
230 CodeBuffer buffer(_code2); |
228 StubGenerator_generate(&buffer, true); |
231 StubGenerator_generate(&buffer, true); |
|
232 // When new stubs added we need to make sure there is some space left |
|
233 // to catch situation when we should increase size again. |
|
234 assert(buffer.insts_remaining() > 200, "increase code_size2"); |
229 } |
235 } |
230 |
236 |
231 #ifdef ASSERT |
237 #ifdef ASSERT |
232 |
238 |
233 #define TEST_ARRAYCOPY(type) \ |
239 #define TEST_ARRAYCOPY(type) \ |