# HG changeset patch # User Doug Simon # Date 1440507700 -7200 # Node ID 5e61ca976049d0eef61b191cbdabbd9f71a3fa6d # Parent b14500c9da22b57fd570e26d0d30c9e83e62cffb documented other JVMCI-specific fields in JavaThread diff -r b14500c9da22 -r 5e61ca976049 src/share/vm/runtime/deoptimization.cpp --- a/src/share/vm/runtime/deoptimization.cpp Tue Aug 25 14:34:50 2015 +0200 +++ b/src/share/vm/runtime/deoptimization.cpp Tue Aug 25 15:01:40 2015 +0200 @@ -1474,33 +1474,31 @@ #if INCLUDE_JVMCI oop speculation = thread->pending_failed_speculation(); if (nm->is_compiled_by_jvmci()) { - if (speculation != NULL) { - oop speculation_log = nm->speculation_log(); - if (speculation_log != NULL) { - if (TraceDeoptimization || TraceUncollectedSpeculations) { - if (SpeculationLog::lastFailed(speculation_log) != NULL) { - tty->print_cr("A speculation that was not collected by the compiler is being overwritten"); + if (speculation != NULL) { + oop speculation_log = nm->speculation_log(); + if (speculation_log != NULL) { + if (TraceDeoptimization || TraceUncollectedSpeculations) { + if (SpeculationLog::lastFailed(speculation_log) != NULL) { + tty->print_cr("A speculation that was not collected by the compiler is being overwritten"); + } + } + if (TraceDeoptimization) { + tty->print_cr("Saving speculation to speculation log"); + } + SpeculationLog::set_lastFailed(speculation_log, speculation); + } else { + if (TraceDeoptimization) { + tty->print_cr("Speculation present but no speculation log"); } } - if (TraceDeoptimization) { - tty->print_cr("Saving speculation to speculation log"); - } - SpeculationLog::set_lastFailed(speculation_log, speculation); + thread->set_pending_failed_speculation(NULL); } else { if (TraceDeoptimization) { - tty->print_cr("Speculation present but no speculation log"); + tty->print_cr("No speculation"); } } - thread->set_pending_failed_speculation(NULL); } else { - if (TraceDeoptimization) { - tty->print_cr("No speculation"); - } - } - } else { -#ifdef ASSERT - assert(speculation == NULL, "There should not be a speculation for method compiled by other compilers"); -#endif + assert(speculation == NULL, "There should not be a speculation for method compiled by non-JVMCI compilers"); } if (trap_bci == SynchronizationEntryBCI) { diff -r b14500c9da22 -r 5e61ca976049 src/share/vm/runtime/thread.hpp --- a/src/share/vm/runtime/thread.hpp Tue Aug 25 14:34:50 2015 +0200 +++ b/src/share/vm/runtime/thread.hpp Tue Aug 25 15:01:40 2015 +0200 @@ -917,10 +917,23 @@ private: #if INCLUDE_JVMCI + // The _pending_* fields below are used to communicate extra information + // from an uncommon trap in JVMCI compiled code to the uncommon trap handler. + + // Communicates the DeoptReason and DeoptAction of the uncommon trap int _pending_deoptimization; + + // An object that JVMCI compiled code can use to further describe and + // uniquely identify the speculative optimization guarded by the uncommon trap oop _pending_failed_speculation; + + // Specifies whether the uncommon trap is to bci 0 of a synchronized method + // before the monitor has been acquired. bool _pending_monitorenter; + + // Specifies if the DeoptReason for the last uncommon trap was Reason_transfer_to_interpreter bool _pending_transfer_to_interpreter; + // These fields are mutually exclusive in terms of live ranges // so this could be a union instead of a struct. struct {