<!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>[188771] 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/188771">188771</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2015-08-21 13:48:59 -0700 (Fri, 21 Aug 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>DFG::NodeOrigin should have a flag determining if exiting is OK right now
https://bugs.webkit.org/show_bug.cgi?id=148323
Reviewed by Saam Barati.
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::currentNodeOrigin):
(JSC::DFG::ByteCodeParser::branchData):
* dfg/DFGInsertionSet.h:
(JSC::DFG::InsertionSet::insertConstant):
(JSC::DFG::InsertionSet::insertConstantForUse):
(JSC::DFG::InsertionSet::insertBottomConstantForUse):
* dfg/DFGIntegerCheckCombiningPhase.cpp:
(JSC::DFG::IntegerCheckCombiningPhase::handleBlock):
* dfg/DFGLICMPhase.cpp:
(JSC::DFG::LICMPhase::attemptHoist):
* dfg/DFGNodeOrigin.h:
(JSC::DFG::NodeOrigin::NodeOrigin):
(JSC::DFG::NodeOrigin::isSet):
(JSC::DFG::NodeOrigin::withSemantic):
* dfg/DFGObjectAllocationSinkingPhase.cpp:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp">trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGInsertionSeth">trunk/Source/JavaScriptCore/dfg/DFGInsertionSet.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGIntegerCheckCombiningPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGIntegerCheckCombiningPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGLICMPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGLICMPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGNodeOriginh">trunk/Source/JavaScriptCore/dfg/DFGNodeOrigin.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGObjectAllocationSinkingPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (188770 => 188771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-08-21 20:00:48 UTC (rev 188770)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-08-21 20:48:59 UTC (rev 188771)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2015-08-21 Filip Pizlo <fpizlo@apple.com>
+
+ DFG::NodeOrigin should have a flag determining if exiting is OK right now
+ https://bugs.webkit.org/show_bug.cgi?id=148323
+
+ Reviewed by Saam Barati.
+
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::currentNodeOrigin):
+ (JSC::DFG::ByteCodeParser::branchData):
+ * dfg/DFGInsertionSet.h:
+ (JSC::DFG::InsertionSet::insertConstant):
+ (JSC::DFG::InsertionSet::insertConstantForUse):
+ (JSC::DFG::InsertionSet::insertBottomConstantForUse):
+ * dfg/DFGIntegerCheckCombiningPhase.cpp:
+ (JSC::DFG::IntegerCheckCombiningPhase::handleBlock):
+ * dfg/DFGLICMPhase.cpp:
+ (JSC::DFG::LICMPhase::attemptHoist):
+ * dfg/DFGNodeOrigin.h:
+ (JSC::DFG::NodeOrigin::NodeOrigin):
+ (JSC::DFG::NodeOrigin::isSet):
+ (JSC::DFG::NodeOrigin::withSemantic):
+ * dfg/DFGObjectAllocationSinkingPhase.cpp:
+
</ins><span class="cx"> 2015-08-21 Saam barati <sbarati@apple.com>
</span><span class="cx">
</span><span class="cx"> DFG callOperations should not implicitly emit an exception check. At callOperation call sites, we should explicitly emit exception checks
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (188770 => 188771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2015-08-21 20:00:48 UTC (rev 188770)
+++ trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2015-08-21 20:48:59 UTC (rev 188771)
</span><span class="lines">@@ -653,9 +653,13 @@
</span><span class="cx"> {
</span><span class="cx"> // FIXME: We should set the forExit origin only on those nodes that can exit.
</span><span class="cx"> // https://bugs.webkit.org/show_bug.cgi?id=145204
</span><ins>+ CodeOrigin semantic;
</ins><span class="cx"> if (m_currentSemanticOrigin.isSet())
</span><del>- return NodeOrigin(m_currentSemanticOrigin, currentCodeOrigin());
- return NodeOrigin(currentCodeOrigin());
</del><ins>+ semantic = m_currentSemanticOrigin;
+ else
+ semantic = currentCodeOrigin();
+
+ return NodeOrigin(semantic, currentCodeOrigin(), true);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> BranchData* branchData(unsigned taken, unsigned notTaken)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGInsertionSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGInsertionSet.h (188770 => 188771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGInsertionSet.h        2015-08-21 20:00:48 UTC (rev 188770)
+++ trunk/Source/JavaScriptCore/dfg/DFGInsertionSet.h        2015-08-21 20:48:59 UTC (rev 188771)
</span><span class="lines">@@ -71,12 +71,6 @@
</span><span class="cx"> index, speculationFromValue(value->value()), op, origin, OpInfo(value));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Node* insertConstant(
- size_t index, CodeOrigin origin, FrozenValue* value, NodeType op = JSConstant)
- {
- return insertConstant(index, NodeOrigin(origin), value, op);
- }
-
</del><span class="cx"> Edge insertConstantForUse(
</span><span class="cx"> size_t index, NodeOrigin origin, FrozenValue* value, UseKind useKind)
</span><span class="cx"> {
</span><span class="lines">@@ -90,32 +84,16 @@
</span><span class="cx"> return Edge(insertConstant(index, origin, value, op), useKind);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Edge insertConstantForUse(
- size_t index, CodeOrigin origin, FrozenValue* value, UseKind useKind)
- {
- return insertConstantForUse(index, NodeOrigin(origin), value, useKind);
- }
-
</del><span class="cx"> Node* insertConstant(size_t index, NodeOrigin origin, JSValue value, NodeType op = JSConstant)
</span><span class="cx"> {
</span><span class="cx"> return insertConstant(index, origin, m_graph.freeze(value), op);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Node* insertConstant(size_t index, CodeOrigin origin, JSValue value, NodeType op = JSConstant)
- {
- return insertConstant(index, origin, m_graph.freeze(value), op);
- }
-
</del><span class="cx"> Edge insertConstantForUse(size_t index, NodeOrigin origin, JSValue value, UseKind useKind)
</span><span class="cx"> {
</span><span class="cx"> return insertConstantForUse(index, origin, m_graph.freeze(value), useKind);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Edge insertConstantForUse(size_t index, CodeOrigin origin, JSValue value, UseKind useKind)
- {
- return insertConstantForUse(index, NodeOrigin(origin), value, useKind);
- }
-
</del><span class="cx"> Edge insertBottomConstantForUse(size_t index, NodeOrigin origin, UseKind useKind)
</span><span class="cx"> {
</span><span class="cx"> if (isDouble(useKind))
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGIntegerCheckCombiningPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGIntegerCheckCombiningPhase.cpp (188770 => 188771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGIntegerCheckCombiningPhase.cpp        2015-08-21 20:00:48 UTC (rev 188770)
+++ trunk/Source/JavaScriptCore/dfg/DFGIntegerCheckCombiningPhase.cpp        2015-08-21 20:48:59 UTC (rev 188771)
</span><span class="lines">@@ -233,18 +233,15 @@
</span><span class="cx">
</span><span class="cx"> // Do the hoisting.
</span><span class="cx"> if (!range.m_hoisted) {
</span><ins>+ NodeOrigin minOrigin = node->origin.withSemantic(range.m_minOrigin);
+ NodeOrigin maxOrigin = node->origin.withSemantic(range.m_maxOrigin);
+
</ins><span class="cx"> switch (data.m_key.m_kind) {
</span><span class="cx"> case Addition: {
</span><del>- if (range.m_minBound < 0) {
- insertAdd(
- nodeIndex, NodeOrigin(range.m_minOrigin, node->origin.forExit),
- data.m_key.m_source, range.m_minBound);
- }
- if (range.m_maxBound > 0) {
- insertAdd(
- nodeIndex, NodeOrigin(range.m_maxOrigin, node->origin.forExit),
- data.m_key.m_source, range.m_maxBound);
- }
</del><ins>+ if (range.m_minBound < 0)
+ insertAdd(nodeIndex, minOrigin, data.m_key.m_source, range.m_minBound);
+ if (range.m_maxBound > 0)
+ insertAdd(nodeIndex, maxOrigin, data.m_key.m_source, range.m_maxBound);
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -255,14 +252,14 @@
</span><span class="cx"> if (!data.m_key.m_source) {
</span><span class="cx"> minNode = 0;
</span><span class="cx"> maxNode = m_insertionSet.insertConstant(
</span><del>- nodeIndex, range.m_maxOrigin, jsNumber(range.m_maxBound));
</del><ins>+ nodeIndex, maxOrigin, jsNumber(range.m_maxBound));
</ins><span class="cx"> } else {
</span><span class="cx"> minNode = insertAdd(
</span><del>- nodeIndex, NodeOrigin(range.m_minOrigin, node->origin.forExit),
- data.m_key.m_source, range.m_minBound, Arith::Unchecked);
</del><ins>+ nodeIndex, minOrigin, data.m_key.m_source, range.m_minBound,
+ Arith::Unchecked);
</ins><span class="cx"> maxNode = insertAdd(
</span><del>- nodeIndex, NodeOrigin(range.m_maxOrigin, node->origin.forExit),
- data.m_key.m_source, range.m_maxBound, Arith::Unchecked);
</del><ins>+ nodeIndex, maxOrigin, data.m_key.m_source, range.m_maxBound,
+ Arith::Unchecked);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (minNode) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGLICMPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGLICMPhase.cpp (188770 => 188771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGLICMPhase.cpp        2015-08-21 20:00:48 UTC (rev 188770)
+++ trunk/Source/JavaScriptCore/dfg/DFGLICMPhase.cpp        2015-08-21 20:48:59 UTC (rev 188771)
</span><span class="lines">@@ -287,9 +287,7 @@
</span><span class="cx"> data.preHeader->insertBeforeTerminal(node);
</span><span class="cx"> node->owner = data.preHeader;
</span><span class="cx"> NodeOrigin originalOrigin = node->origin;
</span><del>- node->origin.forExit = data.preHeader->terminal()->origin.forExit;
- if (!node->origin.semantic.isSet())
- node->origin.semantic = node->origin.forExit;
</del><ins>+ node->origin = data.preHeader->terminal()->origin.withSemantic(node->origin.semantic);
</ins><span class="cx">
</span><span class="cx"> // Modify the states at the end of the preHeader of the loop we hoisted to,
</span><span class="cx"> // and all pre-headers inside the loop.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGNodeOriginh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGNodeOrigin.h (188770 => 188771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGNodeOrigin.h        2015-08-21 20:00:48 UTC (rev 188770)
+++ trunk/Source/JavaScriptCore/dfg/DFGNodeOrigin.h        2015-08-21 20:48:59 UTC (rev 188771)
</span><span class="lines">@@ -35,29 +35,37 @@
</span><span class="cx"> struct NodeOrigin {
</span><span class="cx"> NodeOrigin() { }
</span><span class="cx">
</span><del>- explicit NodeOrigin(CodeOrigin codeOrigin)
- : semantic(codeOrigin)
- , forExit(codeOrigin)
- {
- }
-
- NodeOrigin(CodeOrigin semantic, CodeOrigin forExit)
</del><ins>+ NodeOrigin(CodeOrigin semantic, CodeOrigin forExit, bool exitOK)
</ins><span class="cx"> : semantic(semantic)
</span><span class="cx"> , forExit(forExit)
</span><ins>+ , exitOK(exitOK)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> bool isSet() const
</span><span class="cx"> {
</span><span class="cx"> ASSERT(semantic.isSet() == forExit.isSet());
</span><span class="cx"> return semantic.isSet();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ NodeOrigin withSemantic(CodeOrigin semantic)
+ {
+ if (!isSet())
+ return NodeOrigin();
+
+ NodeOrigin result = *this;
+ if (semantic.isSet())
+ result.semantic = semantic;
+ return result;
+ }
+
</ins><span class="cx"> // Used for determining what bytecode this came from. This is important for
</span><span class="cx"> // debugging, exceptions, and even basic execution semantics.
</span><span class="cx"> CodeOrigin semantic;
</span><span class="cx"> // Code origin for where the node exits to.
</span><span class="cx"> CodeOrigin forExit;
</span><ins>+ // Whether or not it is legal to exit here.
+ bool exitOK { false };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } } // namespace JSC::DFG
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGObjectAllocationSinkingPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp (188770 => 188771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp        2015-08-21 20:00:48 UTC (rev 188770)
+++ trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp        2015-08-21 20:48:59 UTC (rev 188771)
</span><span class="lines">@@ -1483,9 +1483,7 @@
</span><span class="cx">
</span><span class="cx"> return m_graph.addNode(
</span><span class="cx"> allocation.identifier()->prediction(), Node::VarArg, MaterializeNewObject,
</span><del>- NodeOrigin(
- allocation.identifier()->origin.semantic,
- where->origin.forExit),
</del><ins>+ where->origin.withSemantic(allocation.identifier()->origin.semantic),
</ins><span class="cx"> OpInfo(set), OpInfo(data), 0, 0);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1497,9 +1495,8 @@
</span><span class="cx">
</span><span class="cx"> return m_graph.addNode(
</span><span class="cx"> allocation.identifier()->prediction(), nodeType,
</span><del>- NodeOrigin(
- allocation.identifier()->origin.semantic,
- where->origin.forExit),
</del><ins>+ where->origin.withSemantic(
+ allocation.identifier()->origin.semantic),
</ins><span class="cx"> OpInfo(executable));
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="lines">@@ -1510,9 +1507,8 @@
</span><span class="cx">
</span><span class="cx"> return m_graph.addNode(
</span><span class="cx"> allocation.identifier()->prediction(), Node::VarArg, MaterializeCreateActivation,
</span><del>- NodeOrigin(
- allocation.identifier()->origin.semantic,
- where->origin.forExit),
</del><ins>+ where->origin.withSemantic(
+ allocation.identifier()->origin.semantic),
</ins><span class="cx"> OpInfo(symbolTable), OpInfo(data), 0, 0);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2093,11 +2089,7 @@
</span><span class="cx">
</span><span class="cx"> if (base->isPhantomAllocation()) {
</span><span class="cx"> return PromotedHeapLocation(base, location.descriptor()).createHint(
</span><del>- m_graph,
- NodeOrigin(
- base->origin.semantic,
- where->origin.forExit),
- value);
</del><ins>+ m_graph, where->origin.withSemantic(base->origin.semantic), value);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> switch (location.kind()) {
</span><span class="lines">@@ -2160,9 +2152,7 @@
</span><span class="cx"> return m_graph.addNode(
</span><span class="cx"> SpecNone,
</span><span class="cx"> MultiPutByOffset,
</span><del>- NodeOrigin(
- base->origin.semantic,
- where->origin.forExit),
</del><ins>+ where->origin.withSemantic(base->origin.semantic),
</ins><span class="cx"> OpInfo(data),
</span><span class="cx"> Edge(base, KnownCellUse),
</span><span class="cx"> value->defaultEdge());
</span><span class="lines">@@ -2173,9 +2163,7 @@
</span><span class="cx"> return m_graph.addNode(
</span><span class="cx"> SpecNone,
</span><span class="cx"> PutClosureVar,
</span><del>- NodeOrigin(
- base->origin.semantic,
- where->origin.forExit),
</del><ins>+ where->origin.withSemantic(base->origin.semantic),
</ins><span class="cx"> OpInfo(location.info()),
</span><span class="cx"> Edge(base, KnownCellUse),
</span><span class="cx"> value->defaultEdge());
</span></span></pre>
</div>
</div>
</body>
</html>