1290 tty->print_cr("CompileTheWorld (%d) : %s", _compile_the_world_counter, buffer); |
1290 tty->print_cr("CompileTheWorld (%d) : %s", _compile_the_world_counter, buffer); |
1291 // Preload all classes to get around uncommon traps |
1291 // Preload all classes to get around uncommon traps |
1292 // Iterate over all methods in class |
1292 // Iterate over all methods in class |
1293 for (int n = 0; n < k->methods()->length(); n++) { |
1293 for (int n = 0; n < k->methods()->length(); n++) { |
1294 methodHandle m (THREAD, methodOop(k->methods()->obj_at(n))); |
1294 methodHandle m (THREAD, methodOop(k->methods()->obj_at(n))); |
1295 if (CompilationPolicy::canBeCompiled(m)) { |
1295 if (CompilationPolicy::can_be_compiled(m)) { |
1296 |
1296 |
1297 if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) { |
1297 if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) { |
1298 // Give sweeper a chance to keep up with CTW |
1298 // Give sweeper a chance to keep up with CTW |
1299 VM_ForceSafepoint op; |
1299 VM_ForceSafepoint op; |
1300 VMThread::execute(&op); |
1300 VMThread::execute(&op); |
1301 _codecache_sweep_counter = 0; |
1301 _codecache_sweep_counter = 0; |
1302 } |
1302 } |
1303 // Force compilation |
1303 // Force compilation |
1304 CompileBroker::compile_method(m, InvocationEntryBci, |
1304 CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_initial_compile, |
1305 methodHandle(), 0, "CTW", THREAD); |
1305 methodHandle(), 0, "CTW", THREAD); |
1306 if (HAS_PENDING_EXCEPTION) { |
1306 if (HAS_PENDING_EXCEPTION) { |
1307 CLEAR_PENDING_EXCEPTION; |
1307 CLEAR_PENDING_EXCEPTION; |
1308 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string()); |
1308 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string()); |
1309 } |
1309 } |
1313 if (nm != NULL) { |
1313 if (nm != NULL) { |
1314 // Throw out the code so that the code cache doesn't fill up |
1314 // Throw out the code so that the code cache doesn't fill up |
1315 nm->make_not_entrant(); |
1315 nm->make_not_entrant(); |
1316 m->clear_code(); |
1316 m->clear_code(); |
1317 } |
1317 } |
1318 CompileBroker::compile_method(m, InvocationEntryBci, |
1318 CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_full_optimization, |
1319 methodHandle(), 0, "CTW", THREAD); |
1319 methodHandle(), 0, "CTW", THREAD); |
1320 if (HAS_PENDING_EXCEPTION) { |
1320 if (HAS_PENDING_EXCEPTION) { |
1321 CLEAR_PENDING_EXCEPTION; |
1321 CLEAR_PENDING_EXCEPTION; |
1322 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string()); |
1322 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string()); |
1323 } |
1323 } |