<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[211704] branches/safari-603-branch/Source/JavaScriptCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/211704">211704</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2017-02-05 22:17:09 -0800 (Sun, 05 Feb 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/211658">r211658</a>. rdar://problem/29144126</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari603branchSourceJavaScriptCoreChangeLog">branches/safari-603-branch/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceJavaScriptCoredfgDFGJITCodeh">branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGJITCode.h</a></li>
<li><a href="#branchessafari603branchSourceJavaScriptCoredfgDFGJITCompilercpp">branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp</a></li>
<li><a href="#branchessafari603branchSourceJavaScriptCoredfgDFGOperationscpp">branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGOperations.cpp</a></li>
<li><a href="#branchessafari603branchSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp">branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp</a></li>
<li><a href="#branchessafari603branchSourceJavaScriptCoredfgDFGToFTLForOSREntryDeferredCompilationCallbackcpp">branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp</a></li>
<li><a href="#branchessafari603branchSourceJavaScriptCoredfgDFGToFTLForOSREntryDeferredCompilationCallbackh">branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGToFTLForOSREntryDeferredCompilationCallback.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari603branchSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/JavaScriptCore/ChangeLog (211703 => 211704)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/JavaScriptCore/ChangeLog        2017-02-06 05:51:01 UTC (rev 211703)
+++ branches/safari-603-branch/Source/JavaScriptCore/ChangeLog        2017-02-06 06:17:09 UTC (rev 211704)
</span><span class="lines">@@ -1,3 +1,72 @@
</span><ins>+2017-02-05 Matthew Hanson <matthew_hanson@apple.com>
+
+ Merge r211658. rdar://problem/29144126
+
+ 2017-02-03 JF Bastien <jfbastien@apple.com>
+
+ OSR entry: delay outer-loop compilation when at inner-loop
+ https://bugs.webkit.org/show_bug.cgi?id=167149
+
+ Reviewed by Filip Pizlo.
+
+ r211224 and r211461 were reverted because they caused massive
+ kraken/ai-astar regressions. This patch instead does the
+ minimally-disruptive change to fix the original bug as described
+ below, but omits extra tuning and refactoring which I had
+ before. I'll commit tuning and refactoring separately, if this
+ sticks. This patch is therefore very minimal, and layers carefully
+ on top of the complex spaghetti-logic. The only change it makes is
+ that it uses triggers to indicate to outer loops that they should
+ compile, which fixes the immediate bug and seems roughly perf
+ neutral (maybe a small gain on kraken sometimes, other times a
+ small regression as would be expected from slightly compiling
+ later). As opposed to r211461 this patch doesn't unconditionally
+ unset the trigger because it prevents further DFG executions from
+ entering. It therefore makes the trigger a tri-state enum class:
+ don't trigger, compilation done, start compilation. Only "start
+ compilation" gets reset to "don't trigger". "Compilation done"
+ does not (unless there's a problem compiling, then it gets set
+ back to "don't trigger").
+
+ As of https://bugs.webkit.org/show_bug.cgi?id=155217 OSR
+ compilation can be kicked off for an entry into an outer-loop,
+ while executing an inner-loop. This is desirable because often the
+ codegen from an inner-entry isn't as good as the codegen from an
+ outer-entry, but execution from an inner-loop is often pretty hot
+ and likely to kick off compilation. This approach provided nice
+ speedups on Kraken because we'd select to enter to the outer-loop
+ very reliably, which reduces variability (the inner-loop was
+ selected roughly 1/5 times from my unscientific measurements).
+
+ When compilation starts we take a snapshot of the JSValues at the
+ current execution state using OSR's recovery mechanism. These
+ values are passed to the compiler and are used as way to perform
+ type profiling, and could be used to observe cell types as well as
+ to perform predictions such as through constant propagation.
+
+ It's therefore desired to enter from the outer-loop when we can,
+ but we need to be executing from that location to capture the
+ right JSValues, otherwise we're confusing the compiler and giving
+ it inaccurate JSValues which can lead it to predict the wrong
+ things, leading to suboptimal code or recompilation due to
+ misprediction, or in super-corner-cases a crash.
+
+ DFG tier-up was added here:
+ https://bugs.webkit.org/show_bug.cgi?id=112838
+
+ * dfg/DFGJITCode.h:
+ * dfg/DFGJITCompiler.cpp:
+ (JSC::DFG::JITCompiler::JITCompiler):
+ * dfg/DFGOperations.cpp:
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp:
+ (JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::ToFTLForOSREntryDeferredCompilationCallback):
+ (JSC::DFG::Ref<ToFTLForOSREntryDeferredCompilationCallback>ToFTLForOSREntryDeferredCompilationCallback::create):
+ (JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously):
+ (JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::compilationDidComplete):
+ * dfg/DFGToFTLForOSREntryDeferredCompilationCallback.h:
+
</ins><span class="cx"> 2017-02-02 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r211486. rdar://problem/30167791
</span></span></pre></div>
<a id="branchessafari603branchSourceJavaScriptCoredfgDFGJITCodeh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGJITCode.h (211703 => 211704)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGJITCode.h        2017-02-06 05:51:01 UTC (rev 211703)
+++ branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGJITCode.h        2017-02-06 06:17:09 UTC (rev 211704)
</span><span class="lines">@@ -151,10 +151,16 @@
</span><span class="cx"> // Map each bytecode of CheckTierUpAndOSREnter to its stream index.
</span><span class="cx"> HashMap<unsigned, unsigned, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<unsigned>> bytecodeIndexToStreamIndex;
</span><span class="cx">
</span><ins>+ enum class TriggerReason : uint8_t {
+ DontTrigger,
+ CompilationDone,
+ StartCompilation,
+ };
+
</ins><span class="cx"> // Map each bytecode of CheckTierUpAndOSREnter to its trigger forcing OSR Entry.
</span><span class="cx"> // This can never be modified after it has been initialized since the addresses of the triggers
</span><span class="cx"> // are used by the JIT.
</span><del>- HashMap<unsigned, uint8_t> tierUpEntryTriggers;
</del><ins>+ HashMap<unsigned, TriggerReason> tierUpEntryTriggers;
</ins><span class="cx">
</span><span class="cx"> // Set of bytecode that were the target of a TierUp operation.
</span><span class="cx"> HashSet<unsigned, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<unsigned>> tierUpEntrySeen;
</span></span></pre></div>
<a id="branchessafari603branchSourceJavaScriptCoredfgDFGJITCompilercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp (211703 => 211704)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp        2017-02-06 05:51:01 UTC (rev 211703)
+++ branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp        2017-02-06 06:17:09 UTC (rev 211704)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> #if ENABLE(FTL_JIT)
</span><span class="cx"> m_jitCode->tierUpInLoopHierarchy = WTFMove(m_graph.m_plan.tierUpInLoopHierarchy);
</span><span class="cx"> for (unsigned tierUpBytecode : m_graph.m_plan.tierUpAndOSREnterBytecodes)
</span><del>- m_jitCode->tierUpEntryTriggers.add(tierUpBytecode, 0);
</del><ins>+ m_jitCode->tierUpEntryTriggers.add(tierUpBytecode, JITCode::TriggerReason::DontTrigger);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari603branchSourceJavaScriptCoredfgDFGOperationscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGOperations.cpp (211703 => 211704)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGOperations.cpp        2017-02-06 05:51:01 UTC (rev 211703)
+++ branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGOperations.cpp        2017-02-06 06:17:09 UTC (rev 211704)
</span><span class="lines">@@ -2351,6 +2351,37 @@
</span><span class="cx"> worklistState = Worklist::NotKnown;
</span><span class="cx">
</span><span class="cx"> JITCode* jitCode = codeBlock->jitCode()->dfg();
</span><ins>+
+ // The following is only true for triggerTierUpNowInLoop, which can never
+ // be an OSR entry.
+ bool canOSRFromHere = originBytecodeIndex == osrEntryBytecodeIndex;
+
+ bool triggeredSlowPathToStartCompilation = false;
+ auto tierUpEntryTriggers = jitCode->tierUpEntryTriggers.find(originBytecodeIndex);
+ if (tierUpEntryTriggers != jitCode->tierUpEntryTriggers.end()) {
+ switch (tierUpEntryTriggers->value) {
+ case JITCode::TriggerReason::DontTrigger:
+ // The trigger isn't set, we entered because the counter reached its
+ // threshold.
+ break;
+
+ case JITCode::TriggerReason::CompilationDone:
+ // The trigger was set because compilation completed. Don't unset it
+ // so that further DFG executions OSR enters as well.
+ RELEASE_ASSERT(canOSRFromHere);
+ break;
+
+ case JITCode::TriggerReason::StartCompilation:
+ // We were asked to enter as soon as possible and start compiling an
+ // entry for the current bytecode location. Unset this trigger so we
+ // don't continually enter.
+ RELEASE_ASSERT(canOSRFromHere);
+ tierUpEntryTriggers->value = JITCode::TriggerReason::DontTrigger;
+ triggeredSlowPathToStartCompilation = true;
+ break;
+ }
+ }
+
</ins><span class="cx"> if (worklistState == Worklist::Compiling) {
</span><span class="cx"> CODEBLOCK_LOG_EVENT(codeBlock, "delayFTLCompile", ("still compiling"));
</span><span class="cx"> jitCode->setOptimizationThresholdBasedOnCompilationResult(
</span><span class="lines">@@ -2367,7 +2398,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // If we can OSR Enter, do it right away.
</span><del>- if (originBytecodeIndex == osrEntryBytecodeIndex) {
</del><ins>+ if (canOSRFromHere) {
</ins><span class="cx"> unsigned streamIndex = jitCode->bytecodeIndexToStreamIndex.get(originBytecodeIndex);
</span><span class="cx"> if (CodeBlock* entryBlock = jitCode->osrEntryBlock()) {
</span><span class="cx"> if (void* address = FTL::prepareOSREntry(exec, codeBlock, entryBlock, originBytecodeIndex, streamIndex)) {
</span><span class="lines">@@ -2381,10 +2412,10 @@
</span><span class="cx"> // - If we do have an FTL code block, then try to enter for a while.
</span><span class="cx"> // - If we couldn't enter for a while, then trigger OSR entry.
</span><span class="cx">
</span><del>- if (!shouldTriggerFTLCompile(codeBlock, jitCode))
</del><ins>+ if (!shouldTriggerFTLCompile(codeBlock, jitCode) && !triggeredSlowPathToStartCompilation)
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- if (!jitCode->neverExecutedEntry) {
</del><ins>+ if (!jitCode->neverExecutedEntry && !triggeredSlowPathToStartCompilation) {
</ins><span class="cx"> triggerFTLReplacementCompile(vm, codeBlock, jitCode);
</span><span class="cx">
</span><span class="cx"> if (!codeBlock->hasOptimizedReplacement())
</span><span class="lines">@@ -2424,19 +2455,36 @@
</span><span class="cx"> unsigned osrEntryBytecode = entryBlock->jitCode()->ftlForOSREntry()->bytecodeIndex();
</span><span class="cx"> jitCode->clearOSREntryBlock();
</span><span class="cx"> jitCode->osrEntryRetry = 0;
</span><del>- jitCode->tierUpEntryTriggers.set(osrEntryBytecode, 0);
</del><ins>+ jitCode->tierUpEntryTriggers.set(osrEntryBytecode, JITCode::TriggerReason::DontTrigger);
</ins><span class="cx"> jitCode->setOptimizationThresholdBasedOnCompilationResult(
</span><span class="cx"> codeBlock, CompilationDeferred);
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (!canOSRFromHere) {
+ // We can't OSR from here, or even start a compilation because doing so
+ // calls jitCode->reconstruct which would get the wrong state.
+ if (Options::verboseOSR())
+ dataLog("Non-OSR-able bc#", originBytecodeIndex, " in ", *codeBlock, " setting parent loop bc#", osrEntryBytecodeIndex, "'s trigger and backing off.\n");
+ jitCode->tierUpEntryTriggers.set(osrEntryBytecodeIndex, JITCode::TriggerReason::StartCompilation);
+ jitCode->setOptimizationThresholdBasedOnCompilationResult(codeBlock, CompilationDeferred);
+ return nullptr;
+ }
+
</ins><span class="cx"> unsigned streamIndex = jitCode->bytecodeIndexToStreamIndex.get(osrEntryBytecodeIndex);
</span><del>- auto tierUpHierarchyEntry = jitCode->tierUpInLoopHierarchy.find(osrEntryBytecodeIndex);
- if (tierUpHierarchyEntry != jitCode->tierUpInLoopHierarchy.end()) {
- for (unsigned osrEntryCandidate : tierUpHierarchyEntry->value) {
- if (jitCode->tierUpEntrySeen.contains(osrEntryCandidate)) {
- osrEntryBytecodeIndex = osrEntryCandidate;
- streamIndex = jitCode->bytecodeIndexToStreamIndex.get(osrEntryBytecodeIndex);
</del><ins>+
+ if (!triggeredSlowPathToStartCompilation) {
+ auto tierUpHierarchyEntry = jitCode->tierUpInLoopHierarchy.find(osrEntryBytecodeIndex);
+ if (tierUpHierarchyEntry != jitCode->tierUpInLoopHierarchy.end()) {
+ for (unsigned osrEntryCandidate : tierUpHierarchyEntry->value) {
+ if (jitCode->tierUpEntrySeen.contains(osrEntryCandidate)) {
+ // Ask an enclosing loop to compile, instead of doing so here.
+ if (Options::verboseOSR())
+ dataLog("Inner-loop bc#", originBytecodeIndex, " in ", *codeBlock, " setting parent loop bc#", osrEntryCandidate, "'s trigger and backing off.\n");
+ jitCode->tierUpEntryTriggers.set(osrEntryCandidate, JITCode::TriggerReason::StartCompilation);
+ jitCode->setOptimizationThresholdBasedOnCompilationResult(codeBlock, CompilationDeferred);
+ return nullptr;
+ }
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -2445,7 +2493,7 @@
</span><span class="cx"> // something.
</span><span class="cx"> auto triggerIterator = jitCode->tierUpEntryTriggers.find(osrEntryBytecodeIndex);
</span><span class="cx"> RELEASE_ASSERT(triggerIterator != jitCode->tierUpEntryTriggers.end());
</span><del>- uint8_t* triggerAddress = &(triggerIterator->value);
</del><ins>+ JITCode::TriggerReason* triggerAddress = &(triggerIterator->value);
</ins><span class="cx">
</span><span class="cx"> Operands<JSValue> mustHandleValues;
</span><span class="cx"> jitCode->reconstruct(
</span></span></pre></div>
<a id="branchessafari603branchSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp (211703 => 211704)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2017-02-06 05:51:01 UTC (rev 211703)
+++ branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2017-02-06 06:17:09 UTC (rev 211704)
</span><span class="lines">@@ -5781,7 +5781,9 @@
</span><span class="cx"> unsigned bytecodeIndex = node->origin.semantic.bytecodeIndex;
</span><span class="cx"> auto triggerIterator = m_jit.jitCode()->tierUpEntryTriggers.find(bytecodeIndex);
</span><span class="cx"> DFG_ASSERT(m_jit.graph(), node, triggerIterator != m_jit.jitCode()->tierUpEntryTriggers.end());
</span><del>- uint8_t* forceEntryTrigger = &(m_jit.jitCode()->tierUpEntryTriggers.find(bytecodeIndex)->value);
</del><ins>+ JITCode::TriggerReason* forceEntryTrigger = &(m_jit.jitCode()->tierUpEntryTriggers.find(bytecodeIndex)->value);
+ static_assert(!static_cast<uint8_t>(JITCode::TriggerReason::DontTrigger), "the JIT code assumes non-zero means 'enter'");
+ static_assert(sizeof(JITCode::TriggerReason) == 1, "branchTest8 assumes this size");
</ins><span class="cx">
</span><span class="cx"> MacroAssembler::Jump forceOSREntry = m_jit.branchTest8(MacroAssembler::NonZero, MacroAssembler::AbsoluteAddress(forceEntryTrigger));
</span><span class="cx"> MacroAssembler::Jump overflowedCounter = m_jit.branchAdd32(
</span></span></pre></div>
<a id="branchessafari603branchSourceJavaScriptCoredfgDFGToFTLForOSREntryDeferredCompilationCallbackcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp (211703 => 211704)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp        2017-02-06 05:51:01 UTC (rev 211703)
+++ branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp        2017-02-06 06:17:09 UTC (rev 211704)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">
</span><span class="cx"> namespace JSC { namespace DFG {
</span><span class="cx">
</span><del>-ToFTLForOSREntryDeferredCompilationCallback::ToFTLForOSREntryDeferredCompilationCallback(uint8_t* forcedOSREntryTrigger)
</del><ins>+ToFTLForOSREntryDeferredCompilationCallback::ToFTLForOSREntryDeferredCompilationCallback(JITCode::TriggerReason* forcedOSREntryTrigger)
</ins><span class="cx"> : m_forcedOSREntryTrigger(forcedOSREntryTrigger)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<ToFTLForOSREntryDeferredCompilationCallback>ToFTLForOSREntryDeferredCompilationCallback::create(uint8_t* forcedOSREntryTrigger)
</del><ins>+Ref<ToFTLForOSREntryDeferredCompilationCallback>ToFTLForOSREntryDeferredCompilationCallback::create(JITCode::TriggerReason* forcedOSREntryTrigger)
</ins><span class="cx"> {
</span><span class="cx"> return adoptRef(*new ToFTLForOSREntryDeferredCompilationCallback(forcedOSREntryTrigger));
</span><span class="cx"> }
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> ") did become ready.\n");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- *m_forcedOSREntryTrigger = 1;
</del><ins>+ *m_forcedOSREntryTrigger = JITCode::TriggerReason::CompilationDone;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ToFTLForOSREntryDeferredCompilationCallback::compilationDidComplete(
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx"> case CompilationSuccessful: {
</span><span class="cx"> jitCode->setOSREntryBlock(*codeBlock->vm(), profiledDFGCodeBlock, codeBlock);
</span><span class="cx"> unsigned osrEntryBytecode = codeBlock->jitCode()->ftlForOSREntry()->bytecodeIndex();
</span><del>- jitCode->tierUpEntryTriggers.set(osrEntryBytecode, 1);
</del><ins>+ jitCode->tierUpEntryTriggers.set(osrEntryBytecode, JITCode::TriggerReason::CompilationDone);
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case CompilationFailed:
</span></span></pre></div>
<a id="branchessafari603branchSourceJavaScriptCoredfgDFGToFTLForOSREntryDeferredCompilationCallbackh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGToFTLForOSREntryDeferredCompilationCallback.h (211703 => 211704)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGToFTLForOSREntryDeferredCompilationCallback.h        2017-02-06 05:51:01 UTC (rev 211703)
+++ branches/safari-603-branch/Source/JavaScriptCore/dfg/DFGToFTLForOSREntryDeferredCompilationCallback.h        2017-02-06 06:17:09 UTC (rev 211704)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FTL_JIT)
</span><span class="cx">
</span><ins>+#include "DFGJITCode.h"
</ins><span class="cx"> #include "DeferredCompilationCallback.h"
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="cx">
</span><span class="lines">@@ -38,18 +39,18 @@
</span><span class="cx">
</span><span class="cx"> class ToFTLForOSREntryDeferredCompilationCallback : public DeferredCompilationCallback {
</span><span class="cx"> protected:
</span><del>- ToFTLForOSREntryDeferredCompilationCallback(uint8_t* forcedOSREntryTrigger);
</del><ins>+ ToFTLForOSREntryDeferredCompilationCallback(JITCode::TriggerReason* forcedOSREntryTrigger);
</ins><span class="cx">
</span><span class="cx"> public:
</span><span class="cx"> virtual ~ToFTLForOSREntryDeferredCompilationCallback();
</span><span class="cx">
</span><del>- static Ref<ToFTLForOSREntryDeferredCompilationCallback> create(uint8_t* forcedOSREntryTrigger);
</del><ins>+ static Ref<ToFTLForOSREntryDeferredCompilationCallback> create(JITCode::TriggerReason* forcedOSREntryTrigger);
</ins><span class="cx">
</span><span class="cx"> virtual void compilationDidBecomeReadyAsynchronously(CodeBlock*, CodeBlock* profiledDFGCodeBlock);
</span><span class="cx"> virtual void compilationDidComplete(CodeBlock*, CodeBlock* profiledDFGCodeBlock, CompilationResult);
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- uint8_t* m_forcedOSREntryTrigger;
</del><ins>+ JITCode::TriggerReason* m_forcedOSREntryTrigger;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } } // namespace JSC::DFG
</span></span></pre>
</div>
</div>
</body>
</html>