comparison src/share/vm/classfile/classLoader.cpp @ 12255:3a4e6c929bf3

8024275: During CTW: assert(sig_bt[member_arg_pos] == T_OBJECT) failed: dispatch argument must be an object Reviewed-by: kvn, vlivanov
author twisti
date Thu, 12 Sep 2013 14:53:44 -0700
parents 7e7dd25666da
children cefad50507d8 2b8e28fdf503
comparison
equal deleted inserted replaced
12192:34bd5e86aadb 12255:3a4e6c929bf3
1317 CLEAR_PENDING_EXCEPTION; 1317 CLEAR_PENDING_EXCEPTION;
1318 } 1318 }
1319 // The CHECK at the caller will propagate the exception out 1319 // The CHECK at the caller will propagate the exception out
1320 } 1320 }
1321 1321
1322 /**
1323 * Returns if the given method should be compiled when doing compile-the-world.
1324 *
1325 * TODO: This should be a private method in a CompileTheWorld class.
1326 */
1327 static bool can_be_compiled(methodHandle m, int comp_level) {
1328 assert(CompileTheWorld, "must be");
1329
1330 // It's not valid to compile a native wrapper for MethodHandle methods
1331 // that take a MemberName appendix since the bytecode signature is not
1332 // correct.
1333 vmIntrinsics::ID iid = m->intrinsic_id();
1334 if (MethodHandles::is_signature_polymorphic(iid) && MethodHandles::has_member_arg(iid)) {
1335 return false;
1336 }
1337
1338 return CompilationPolicy::can_be_compiled(m, comp_level);
1339 }
1340
1322 void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) { 1341 void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
1323 int len = (int)strlen(name); 1342 int len = (int)strlen(name);
1324 if (len > 6 && strcmp(".class", name + len - 6) == 0) { 1343 if (len > 6 && strcmp(".class", name + len - 6) == 0) {
1325 // We have a .class file 1344 // We have a .class file
1326 char buffer[2048]; 1345 char buffer[2048];
1360 // Preload all classes to get around uncommon traps 1379 // Preload all classes to get around uncommon traps
1361 // Iterate over all methods in class 1380 // Iterate over all methods in class
1362 int comp_level = CompilationPolicy::policy()->initial_compile_level(); 1381 int comp_level = CompilationPolicy::policy()->initial_compile_level();
1363 for (int n = 0; n < k->methods()->length(); n++) { 1382 for (int n = 0; n < k->methods()->length(); n++) {
1364 methodHandle m (THREAD, k->methods()->at(n)); 1383 methodHandle m (THREAD, k->methods()->at(n));
1365 if (CompilationPolicy::can_be_compiled(m, comp_level)) { 1384 if (can_be_compiled(m, comp_level)) {
1366
1367 if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) { 1385 if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) {
1368 // Give sweeper a chance to keep up with CTW 1386 // Give sweeper a chance to keep up with CTW
1369 VM_ForceSafepoint op; 1387 VM_ForceSafepoint op;
1370 VMThread::execute(&op); 1388 VMThread::execute(&op);
1371 _codecache_sweep_counter = 0; 1389 _codecache_sweep_counter = 0;
1373 // Force compilation 1391 // Force compilation
1374 CompileBroker::compile_method(m, InvocationEntryBci, comp_level, 1392 CompileBroker::compile_method(m, InvocationEntryBci, comp_level,
1375 methodHandle(), 0, "CTW", THREAD); 1393 methodHandle(), 0, "CTW", THREAD);
1376 if (HAS_PENDING_EXCEPTION) { 1394 if (HAS_PENDING_EXCEPTION) {
1377 clear_pending_exception_if_not_oom(CHECK); 1395 clear_pending_exception_if_not_oom(CHECK);
1378 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name()->as_C_string()); 1396 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
1379 } else { 1397 } else {
1380 _compile_the_world_method_counter++; 1398 _compile_the_world_method_counter++;
1381 } 1399 }
1382 if (TieredCompilation && TieredStopAtLevel >= CompLevel_full_optimization) { 1400 if (TieredCompilation && TieredStopAtLevel >= CompLevel_full_optimization) {
1383 // Clobber the first compile and force second tier compilation 1401 // Clobber the first compile and force second tier compilation
1389 } 1407 }
1390 CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_full_optimization, 1408 CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_full_optimization,
1391 methodHandle(), 0, "CTW", THREAD); 1409 methodHandle(), 0, "CTW", THREAD);
1392 if (HAS_PENDING_EXCEPTION) { 1410 if (HAS_PENDING_EXCEPTION) {
1393 clear_pending_exception_if_not_oom(CHECK); 1411 clear_pending_exception_if_not_oom(CHECK);
1394 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name()->as_C_string()); 1412 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
1395 } else { 1413 } else {
1396 _compile_the_world_method_counter++; 1414 _compile_the_world_method_counter++;
1397 } 1415 }
1398 } 1416 }
1417 } else {
1418 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
1399 } 1419 }
1400 1420
1401 nmethod* nm = m->code(); 1421 nmethod* nm = m->code();
1402 if (nm != NULL) { 1422 if (nm != NULL) {
1403 // Throw out the code so that the code cache doesn't fill up 1423 // Throw out the code so that the code cache doesn't fill up