comparison src/share/vm/runtime/deoptimization.cpp @ 12699:38b84d5a66fd

Start passing down a 'speculation id' to deoptimizations. Use it to record GuardNode id during guard lowering as a debug feature for now
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 06 Nov 2013 14:53:31 +0100
parents bca33c3135de
children bc868f83bcec
comparison
equal deleted inserted replaced
12698:d59a65c11feb 12699:38b84d5a66fd
1337 // Revoke biases of any monitors in the frame to ensure we can migrate them 1337 // Revoke biases of any monitors in the frame to ensure we can migrate them
1338 revoke_biases_of_monitors(thread, fr, &reg_map); 1338 revoke_biases_of_monitors(thread, fr, &reg_map);
1339 1339
1340 DeoptReason reason = trap_request_reason(trap_request); 1340 DeoptReason reason = trap_request_reason(trap_request);
1341 DeoptAction action = trap_request_action(trap_request); 1341 DeoptAction action = trap_request_action(trap_request);
1342 #ifdef GRAAL
1343 short speculation_id = trap_request_speculation_id(trap_request);
1344 #endif
1342 jint unloaded_class_index = trap_request_index(trap_request); // CP idx or -1 1345 jint unloaded_class_index = trap_request_index(trap_request); // CP idx or -1
1343 1346
1344 vframe* vf = vframe::new_vframe(&fr, &reg_map, thread); 1347 vframe* vf = vframe::new_vframe(&fr, &reg_map, thread);
1345 compiledVFrame* cvf = compiledVFrame::cast(vf); 1348 compiledVFrame* cvf = compiledVFrame::cast(vf);
1346 1349
1347 nmethod* nm = cvf->code(); 1350 nmethod* nm = cvf->code();
1348 1351
1349 ScopeDesc* trap_scope = cvf->scope(); 1352 ScopeDesc* trap_scope = cvf->scope();
1350 1353
1351 if (TraceDeoptimization) { 1354 if (TraceDeoptimization) {
1352 tty->print_cr(" bci=%d pc=%d, relative_pc=%d, method=%s", trap_scope->bci(), fr.pc(), fr.pc() - nm->code_begin(), trap_scope->method()->name()->as_C_string()); 1355 tty->print_cr(" bci=%d pc=%d, relative_pc=%d, method=%s" GRAAL_ONLY(", speculation=%d"), trap_scope->bci(), fr.pc(), fr.pc() - nm->code_begin(), trap_scope->method()->name()->as_C_string()
1356 #ifdef GRAAL
1357 , speculation_id
1358 #endif
1359 );
1353 } 1360 }
1354 1361
1355 methodHandle trap_method = trap_scope->method(); 1362 methodHandle trap_method = trap_scope->method();
1356 int trap_bci = trap_scope->bci(); 1363 int trap_bci = trap_scope->bci();
1357 if (trap_bci == SynchronizationEntryBCI) { 1364 if (trap_bci == SynchronizationEntryBCI) {
1458 } 1465 }
1459 } else if (nm->is_compiled_by_graal()) { 1466 } else if (nm->is_compiled_by_graal()) {
1460 tty->print(" (Graal: no installed code) "); 1467 tty->print(" (Graal: no installed code) ");
1461 } 1468 }
1462 #endif //GRAAL 1469 #endif //GRAAL
1463 tty->print(" (@" INTPTR_FORMAT ") thread=" UINTX_FORMAT " reason=%s action=%s unloaded_class_index=%d", 1470 tty->print(" (@" INTPTR_FORMAT ") thread=" UINTX_FORMAT " reason=%s action=%s unloaded_class_index=%d" GRAAL_ONLY(" speculation=%d"),
1464 fr.pc(), 1471 fr.pc(),
1465 os::current_thread_id(), 1472 os::current_thread_id(),
1466 trap_reason_name(reason), 1473 trap_reason_name(reason),
1467 trap_action_name(action), 1474 trap_action_name(action),
1468 unloaded_class_index); 1475 unloaded_class_index
1476 #ifdef GRAAL
1477 , speculation_id
1478 #endif
1479 );
1469 if (class_name != NULL) { 1480 if (class_name != NULL) {
1470 tty->print(unresolved ? " unresolved class: " : " symbol: "); 1481 tty->print(unresolved ? " unresolved class: " : " symbol: ");
1471 class_name->print_symbol_on(tty); 1482 class_name->print_symbol_on(tty);
1472 } 1483 }
1473 tty->cr(); 1484 tty->cr();
1968 const char* Deoptimization::format_trap_request(char* buf, size_t buflen, 1979 const char* Deoptimization::format_trap_request(char* buf, size_t buflen,
1969 int trap_request) { 1980 int trap_request) {
1970 jint unloaded_class_index = trap_request_index(trap_request); 1981 jint unloaded_class_index = trap_request_index(trap_request);
1971 const char* reason = trap_reason_name(trap_request_reason(trap_request)); 1982 const char* reason = trap_reason_name(trap_request_reason(trap_request));
1972 const char* action = trap_action_name(trap_request_action(trap_request)); 1983 const char* action = trap_action_name(trap_request_action(trap_request));
1984 #ifdef GRAAL
1985 short speculation_id = trap_request_speculation_id(trap_request);
1986 #endif
1973 size_t len; 1987 size_t len;
1974 if (unloaded_class_index < 0) { 1988 if (unloaded_class_index < 0) {
1975 len = jio_snprintf(buf, buflen, "reason='%s' action='%s'", 1989 len = jio_snprintf(buf, buflen, "reason='%s' action='%s'" GRAAL_ONLY(" speculation='%d'"),
1976 reason, action); 1990 reason, action
1991 #ifdef GRAAL
1992 ,speculation_id
1993 #endif
1994 );
1977 } else { 1995 } else {
1978 len = jio_snprintf(buf, buflen, "reason='%s' action='%s' index='%d'", 1996 len = jio_snprintf(buf, buflen, "reason='%s' action='%s' index='%d'" GRAAL_ONLY(" speculation='%d'"),
1979 reason, action, unloaded_class_index); 1997 reason, action, unloaded_class_index
1998 #ifdef GRAAL
1999 ,speculation_id
2000 #endif
2001 );
1980 } 2002 }
1981 if (len >= buflen) 2003 if (len >= buflen)
1982 buf[buflen-1] = '\0'; 2004 buf[buflen-1] = '\0';
1983 return buf; 2005 return buf;
1984 } 2006 }