<!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>[173672] trunk/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/173672">173672</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2014-09-16 15:18:23 -0700 (Tue, 16 Sep 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Local OSR availability calculation should be reusable
https://bugs.webkit.org/show_bug.cgi?id=136860
Reviewed by Oliver Hunt.
Previously, the FTL lowering repeated some of the logic of the OSR availability analysis
phase. Humorously, it actually did this logic a bit differently; for example the phase
would claim that a SetLocal makes both the flush and the node available while the FTL
only claimed that the flush was available. This different was benign, but still: yuck!
Also, previously if you wanted to use availability information then you'd have to repeat
some of the logic that both the phase itself and the FTL lowering already had.
Presumably, you could get epic style points for finding other benign ways in which to
make your copy of the logic different from the other two!
This reduces the amount of style points one could conceivably get in the future when
hacking JSC, by creating a single reusable thingy for computing local OSR availability.
* dfg/DFGOSRAvailabilityAnalysisPhase.cpp:
(JSC::DFG::OSRAvailabilityAnalysisPhase::run):
(JSC::DFG::LocalOSRAvailabilityCalculator::LocalOSRAvailabilityCalculator):
(JSC::DFG::LocalOSRAvailabilityCalculator::~LocalOSRAvailabilityCalculator):
(JSC::DFG::LocalOSRAvailabilityCalculator::beginBlock):
(JSC::DFG::LocalOSRAvailabilityCalculator::executeNode):
* dfg/DFGOSRAvailabilityAnalysisPhase.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::LowerDFGToLLVM):
(JSC::FTL::LowerDFGToLLVM::compileBlock):
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileSetLocal):
(JSC::FTL::LowerDFGToLLVM::compileInvalidationPoint):
(JSC::FTL::LowerDFGToLLVM::appendOSRExit):
(JSC::FTL::LowerDFGToLLVM::buildExitArguments):
(JSC::FTL::LowerDFGToLLVM::availability):
(JSC::FTL::LowerDFGToLLVM::compileMovHint): Deleted.
(JSC::FTL::LowerDFGToLLVM::compileZombieHint): Deleted.
(JSC::FTL::LowerDFGToLLVM::initializeOSRExitStateForBlock): Deleted.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGOSRAvailabilityAnalysisPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGOSRAvailabilityAnalysisPhaseh">trunk/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLLowerDFGToLLVMcpp">trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (173671 => 173672)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-09-16 22:14:42 UTC (rev 173671)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-09-16 22:18:23 UTC (rev 173672)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2014-09-16 Filip Pizlo <fpizlo@apple.com>
+
+ Local OSR availability calculation should be reusable
+ https://bugs.webkit.org/show_bug.cgi?id=136860
+
+ Reviewed by Oliver Hunt.
+
+ Previously, the FTL lowering repeated some of the logic of the OSR availability analysis
+ phase. Humorously, it actually did this logic a bit differently; for example the phase
+ would claim that a SetLocal makes both the flush and the node available while the FTL
+ only claimed that the flush was available. This different was benign, but still: yuck!
+
+ Also, previously if you wanted to use availability information then you'd have to repeat
+ some of the logic that both the phase itself and the FTL lowering already had.
+ Presumably, you could get epic style points for finding other benign ways in which to
+ make your copy of the logic different from the other two!
+
+ This reduces the amount of style points one could conceivably get in the future when
+ hacking JSC, by creating a single reusable thingy for computing local OSR availability.
+
+ * dfg/DFGOSRAvailabilityAnalysisPhase.cpp:
+ (JSC::DFG::OSRAvailabilityAnalysisPhase::run):
+ (JSC::DFG::LocalOSRAvailabilityCalculator::LocalOSRAvailabilityCalculator):
+ (JSC::DFG::LocalOSRAvailabilityCalculator::~LocalOSRAvailabilityCalculator):
+ (JSC::DFG::LocalOSRAvailabilityCalculator::beginBlock):
+ (JSC::DFG::LocalOSRAvailabilityCalculator::executeNode):
+ * dfg/DFGOSRAvailabilityAnalysisPhase.h:
+ * ftl/FTLLowerDFGToLLVM.cpp:
+ (JSC::FTL::LowerDFGToLLVM::LowerDFGToLLVM):
+ (JSC::FTL::LowerDFGToLLVM::compileBlock):
+ (JSC::FTL::LowerDFGToLLVM::compileNode):
+ (JSC::FTL::LowerDFGToLLVM::compileSetLocal):
+ (JSC::FTL::LowerDFGToLLVM::compileInvalidationPoint):
+ (JSC::FTL::LowerDFGToLLVM::appendOSRExit):
+ (JSC::FTL::LowerDFGToLLVM::buildExitArguments):
+ (JSC::FTL::LowerDFGToLLVM::availability):
+ (JSC::FTL::LowerDFGToLLVM::compileMovHint): Deleted.
+ (JSC::FTL::LowerDFGToLLVM::compileZombieHint): Deleted.
+ (JSC::FTL::LowerDFGToLLVM::initializeOSRExitStateForBlock): Deleted.
+
</ins><span class="cx"> 2014-09-16 Csaba Osztrogonác <ossy@webkit.org>
</span><span class="cx">
</span><span class="cx"> JSC test gardening
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGOSRAvailabilityAnalysisPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.cpp (173671 => 173672)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.cpp        2014-09-16 22:14:42 UTC (rev 173671)
+++ trunk/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.cpp        2014-09-16 22:18:23 UTC (rev 173672)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -71,7 +71,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // This could be made more efficient by processing blocks in reverse postorder.
</span><del>- Operands<Availability> availability;
</del><ins>+
+ LocalOSRAvailabilityCalculator calculator;
</ins><span class="cx"> bool changed;
</span><span class="cx"> do {
</span><span class="cx"> changed = false;
</span><span class="lines">@@ -81,54 +82,23 @@
</span><span class="cx"> if (!block)
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- availability = block->ssa->availabilityAtHead;
</del><ins>+ calculator.beginBlock(block);
</ins><span class="cx">
</span><del>- for (unsigned nodeIndex = 0; nodeIndex < block->size(); ++nodeIndex) {
- Node* node = block->at(nodeIndex);
-
- switch (node->op()) {
- case SetLocal: {
- VariableAccessData* variable = node->variableAccessData();
- availability.operand(variable->local()) =
- Availability(node->child1().node(), variable->flushedAt());
- break;
- }
-
- case GetArgument: {
- VariableAccessData* variable = node->variableAccessData();
- availability.operand(variable->local()) =
- Availability(node, variable->flushedAt());
- break;
- }
-
- case MovHint: {
- availability.operand(node->unlinkedLocal()) =
- Availability(node->child1().node());
- break;
- }
-
- case ZombieHint: {
- availability.operand(node->unlinkedLocal()) =
- Availability::unavailable();
- break;
- }
-
- default:
- break;
- }
- }
</del><ins>+ for (unsigned nodeIndex = 0; nodeIndex < block->size(); ++nodeIndex)
+ calculator.executeNode(block->at(nodeIndex));
</ins><span class="cx">
</span><del>- if (availability == block->ssa->availabilityAtTail)
</del><ins>+ if (calculator.m_availability == block->ssa->availabilityAtTail)
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- block->ssa->availabilityAtTail = availability;
</del><ins>+ block->ssa->availabilityAtTail = calculator.m_availability;
</ins><span class="cx"> changed = true;
</span><span class="cx">
</span><span class="cx"> for (unsigned successorIndex = block->numSuccessors(); successorIndex--;) {
</span><span class="cx"> BasicBlock* successor = block->successor(successorIndex);
</span><del>- for (unsigned i = availability.size(); i--;) {
- successor->ssa->availabilityAtHead[i] = availability[i].merge(
- successor->ssa->availabilityAtHead[i]);
</del><ins>+ for (unsigned i = calculator.m_availability.size(); i--;) {
+ successor->ssa->availabilityAtHead[i] =
+ calculator.m_availability[i].merge(
+ successor->ssa->availabilityAtHead[i]);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -144,6 +114,53 @@
</span><span class="cx"> return runPhase<OSRAvailabilityAnalysisPhase>(graph);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+LocalOSRAvailabilityCalculator::LocalOSRAvailabilityCalculator()
+{
+}
+
+LocalOSRAvailabilityCalculator::~LocalOSRAvailabilityCalculator()
+{
+}
+
+void LocalOSRAvailabilityCalculator::beginBlock(BasicBlock* block)
+{
+ m_availability = block->ssa->availabilityAtHead;
+}
+
+void LocalOSRAvailabilityCalculator::executeNode(Node* node)
+{
+ switch (node->op()) {
+ case SetLocal: {
+ VariableAccessData* variable = node->variableAccessData();
+ m_availability.operand(variable->local()) =
+ Availability(node->child1().node(), variable->flushedAt());
+ break;
+ }
+
+ case GetArgument: {
+ VariableAccessData* variable = node->variableAccessData();
+ m_availability.operand(variable->local()) =
+ Availability(node, variable->flushedAt());
+ break;
+ }
+
+ case MovHint: {
+ m_availability.operand(node->unlinkedLocal()) =
+ Availability(node->child1().node());
+ break;
+ }
+
+ case ZombieHint: {
+ m_availability.operand(node->unlinkedLocal()) =
+ Availability::unavailable();
+ break;
+ }
+
+ default:
+ break;
+ }
+}
+
</ins><span class="cx"> } } // namespace JSC::DFG
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(DFG_JIT)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGOSRAvailabilityAnalysisPhaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h (173671 => 173672)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h        2014-09-16 22:14:42 UTC (rev 173671)
+++ trunk/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h        2014-09-16 22:18:23 UTC (rev 173672)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(DFG_JIT)
</span><span class="cx">
</span><ins>+#include "DFGBasicBlock.h"
</ins><span class="cx"> #include "DFGCommon.h"
</span><span class="cx">
</span><span class="cx"> namespace JSC { namespace DFG {
</span><span class="lines">@@ -35,10 +36,24 @@
</span><span class="cx"> class Graph;
</span><span class="cx">
</span><span class="cx"> // Computes BasicBlock::ssa->availabiltiyAtHead/Tail. This is a forward flow type inference
</span><del>-// over MovHints and SetLocals.
</del><ins>+// over MovHints and SetLocals. This analysis is run directly by the Plan for preparing for
+// lowering to LLVM IR, but it can also be used as a utility.
</ins><span class="cx">
</span><span class="cx"> bool performOSRAvailabilityAnalysis(Graph&);
</span><span class="cx">
</span><ins>+// Local calculator for figuring out the availability at any node in a basic block. Requires
+// having run the availability analysis.
+class LocalOSRAvailabilityCalculator {
+public:
+ LocalOSRAvailabilityCalculator();
+ ~LocalOSRAvailabilityCalculator();
+
+ void beginBlock(BasicBlock*);
+ void executeNode(Node*);
+
+ Operands<Availability> m_availability;
+};
+
</ins><span class="cx"> } } // namespace JSC::DFG
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(DFG_JIT)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLLowerDFGToLLVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp (173671 => 173672)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp        2014-09-16 22:14:42 UTC (rev 173671)
+++ trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp        2014-09-16 22:18:23 UTC (rev 173672)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "CodeBlockWithJITType.h"
</span><span class="cx"> #include "DFGAbstractInterpreterInlines.h"
</span><span class="cx"> #include "DFGInPlaceAbstractState.h"
</span><ins>+#include "DFGOSRAvailabilityAnalysisPhase.h"
</ins><span class="cx"> #include "FTLAbstractHeapRepository.h"
</span><span class="cx"> #include "FTLAvailableRecovery.h"
</span><span class="cx"> #include "FTLForOSREntryJITCode.h"
</span><span class="lines">@@ -93,7 +94,6 @@
</span><span class="cx"> , m_ftlState(state)
</span><span class="cx"> , m_heaps(state.context)
</span><span class="cx"> , m_out(state.context)
</span><del>- , m_availability(OperandsLike, state.graph.block(0)->variablesAtHead)
</del><span class="cx"> , m_state(state.graph)
</span><span class="cx"> , m_interpreter(state.graph, m_state)
</span><span class="cx"> , m_stackmapIDs(0)
</span><span class="lines">@@ -295,7 +295,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- initializeOSRExitStateForBlock();
</del><ins>+ m_availabilityCalculator.beginBlock(m_highBlock);
</ins><span class="cx">
</span><span class="cx"> m_state.reset();
</span><span class="cx"> m_state.beginBasicBlock(m_highBlock);
</span><span class="lines">@@ -388,18 +388,12 @@
</span><span class="cx"> case SetLocal:
</span><span class="cx"> compileSetLocal();
</span><span class="cx"> break;
</span><del>- case MovHint:
- compileMovHint();
- break;
</del><span class="cx"> case GetMyArgumentsLength:
</span><span class="cx"> compileGetMyArgumentsLength();
</span><span class="cx"> break;
</span><span class="cx"> case GetMyArgumentByVal:
</span><span class="cx"> compileGetMyArgumentByVal();
</span><span class="cx"> break;
</span><del>- case ZombieHint:
- compileZombieHint();
- break;
</del><span class="cx"> case Phantom:
</span><span class="cx"> case HardPhantom:
</span><span class="cx"> case Check:
</span><span class="lines">@@ -739,12 +733,16 @@
</span><span class="cx"> case FunctionReentryWatchpoint:
</span><span class="cx"> case TypedArrayWatchpoint:
</span><span class="cx"> case AllocationProfileWatchpoint:
</span><ins>+ case MovHint:
+ case ZombieHint:
</ins><span class="cx"> break;
</span><span class="cx"> default:
</span><span class="cx"> DFG_CRASH(m_graph, m_node, "Unrecognized node in FTL backend");
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ m_availabilityCalculator.executeNode(m_node);
+
</ins><span class="cx"> if (shouldExecuteEffects)
</span><span class="cx"> m_interpreter.executeEffects(nodeIndex);
</span><span class="cx">
</span><span class="lines">@@ -1064,24 +1062,8 @@
</span><span class="cx"> DFG_CRASH(m_graph, m_node, "Bad flush format");
</span><span class="cx"> break;
</span><span class="cx"> }
</span><del>-
- m_availability.operand(variable->local()) = Availability(variable->flushedAt());
</del><span class="cx"> }
</span><span class="cx">
</span><del>- void compileMovHint()
- {
- ASSERT(m_node->containsMovHint());
- ASSERT(m_node->op() != ZombieHint);
-
- VirtualRegister operand = m_node->unlinkedLocal();
- m_availability.operand(operand) = Availability(m_node->child1().node());
- }
-
- void compileZombieHint()
- {
- m_availability.operand(m_node->unlinkedLocal()) = Availability::unavailable();
- }
-
</del><span class="cx"> void compilePhantom()
</span><span class="cx"> {
</span><span class="cx"> DFG_NODE_DO_TO_CHILDREN(m_graph, m_node, speculate);
</span><span class="lines">@@ -3973,12 +3955,12 @@
</span><span class="cx"> void compileInvalidationPoint()
</span><span class="cx"> {
</span><span class="cx"> if (verboseCompilationEnabled())
</span><del>- dataLog(" Invalidation point with availability: ", m_availability, "\n");
</del><ins>+ dataLog(" Invalidation point with availability: ", availability(), "\n");
</ins><span class="cx">
</span><span class="cx"> m_ftlState.jitCode->osrExit.append(OSRExit(
</span><span class="cx"> UncountableInvalidation, InvalidValueFormat, MethodOfGettingAValueProfile(),
</span><span class="cx"> m_codeOriginForExitTarget, m_codeOriginForExitProfile,
</span><del>- m_availability.numberOfArguments(), m_availability.numberOfLocals()));
</del><ins>+ availability().numberOfArguments(), availability().numberOfLocals()));
</ins><span class="cx"> m_ftlState.finalizer->osrExit.append(OSRExitCompilationInfo());
</span><span class="cx">
</span><span class="cx"> OSRExit& exit = m_ftlState.jitCode->osrExit.last();
</span><span class="lines">@@ -6360,16 +6342,11 @@
</span><span class="cx"> return m_blocks.get(block);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- void initializeOSRExitStateForBlock()
- {
- m_availability = m_highBlock->ssa->availabilityAtHead;
- }
-
</del><span class="cx"> void appendOSRExit(
</span><span class="cx"> ExitKind kind, FormattedValue lowValue, Node* highValue, LValue failCondition)
</span><span class="cx"> {
</span><span class="cx"> if (verboseCompilationEnabled()) {
</span><del>- dataLog(" OSR exit #", m_ftlState.jitCode->osrExit.size(), " with availability: ", m_availability, "\n");
</del><ins>+ dataLog(" OSR exit #", m_ftlState.jitCode->osrExit.size(), " with availability: ", availability(), "\n");
</ins><span class="cx"> if (!m_availableRecoveries.isEmpty())
</span><span class="cx"> dataLog(" Available recoveries: ", listDump(m_availableRecoveries), "\n");
</span><span class="cx"> }
</span><span class="lines">@@ -6379,7 +6356,7 @@
</span><span class="cx"> m_ftlState.jitCode->osrExit.append(OSRExit(
</span><span class="cx"> kind, lowValue.format(), m_graph.methodOfGettingAValueProfileFor(highValue),
</span><span class="cx"> m_codeOriginForExitTarget, m_codeOriginForExitProfile,
</span><del>- m_availability.numberOfArguments(), m_availability.numberOfLocals()));
</del><ins>+ availability().numberOfArguments(), availability().numberOfLocals()));
</ins><span class="cx"> m_ftlState.finalizer->osrExit.append(OSRExitCompilationInfo());
</span><span class="cx">
</span><span class="cx"> OSRExit& exit = m_ftlState.jitCode->osrExit.last();
</span><span class="lines">@@ -6427,7 +6404,7 @@
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Availability availability = m_availability[i];
</del><ins>+ Availability availability = this->availability()[i];
</ins><span class="cx"> FlushedAt flush = availability.flushedAt();
</span><span class="cx"> switch (flush.format()) {
</span><span class="cx"> case DeadFlush:
</span><span class="lines">@@ -6766,6 +6743,8 @@
</span><span class="cx"> m_out.unreachable();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ Operands<Availability>& availability() { return m_availabilityCalculator.m_availability; }
+
</ins><span class="cx"> VM& vm() { return m_graph.m_vm; }
</span><span class="cx"> CodeBlock* codeBlock() { return m_graph.m_codeBlock; }
</span><span class="cx">
</span><span class="lines">@@ -6795,7 +6774,7 @@
</span><span class="cx">
</span><span class="cx"> HashMap<Node*, LValue> m_phis;
</span><span class="cx">
</span><del>- Operands<Availability> m_availability;
</del><ins>+ LocalOSRAvailabilityCalculator m_availabilityCalculator;
</ins><span class="cx">
</span><span class="cx"> Vector<AvailableRecovery, 3> m_availableRecoveries;
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>