# HG changeset patch # User Gilles Duboscq # Date 1386858684 -3600 # Node ID 10f943c778f651c715ecc29b464c611b888dc96c # Parent 5a9afbf72714b3eee1b69626653752351fd49e93 Add code to trace uncollected speculations diff -r 5a9afbf72714 -r 10f943c778f6 src/share/vm/graal/graalGlobals.hpp --- a/src/share/vm/graal/graalGlobals.hpp Thu Dec 12 15:13:02 2013 +0100 +++ b/src/share/vm/graal/graalGlobals.hpp Thu Dec 12 15:31:24 2013 +0100 @@ -76,6 +76,9 @@ notproduct(bool, GraalPrintSimpleStubs, false, \ "Print simple Graal stubs") \ \ + develop(bool, TraceUncollectedSpeculations, false, \ + "Print message when a failed speculation was not collected") \ + \ // Read default values for Graal globals diff -r 5a9afbf72714 -r 10f943c778f6 src/share/vm/runtime/deoptimization.cpp --- a/src/share/vm/runtime/deoptimization.cpp Thu Dec 12 15:13:02 2013 +0100 +++ b/src/share/vm/runtime/deoptimization.cpp Thu Dec 12 15:31:24 2013 +0100 @@ -1373,6 +1373,11 @@ if (speculation != NULL) { oop speculation_log = nm->speculation_log(); if (speculation_log != NULL) { + if (TraceUncollectedSpeculations) { + if (SpeculationLog::lastFailed(speculation_log) != NULL) { + tty->print_cr("A speculation that was not collected by the compiler is being overwritten"); + } + } SpeculationLog::set_lastFailed(speculation_log, speculation); } thread->set_pending_failed_speculation(NULL);