<!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>[209728] 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/209728">209728</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2016-12-12 15:11:29 -0800 (Mon, 12 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Rename BytecodeGenerator's ControlFlowContext to ControlFlowScope.
https://bugs.webkit.org/show_bug.cgi?id=165777

Reviewed by Keith Miller.

The existing code sometimes refer to ControlFlowContext (and associated references)
as context, and sometimes as scope.  Let's be consistent and always call it a scope.

Also renamed push/popScopedControlFlowContext() to push/popLocalControlFlowScope()
because these are only used when we inc/dec the m_localScopeDepth.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::initializeVarLexicalEnvironment):
(JSC::BytecodeGenerator::pushLexicalScopeInternal):
(JSC::BytecodeGenerator::popLexicalScopeInternal):
(JSC::BytecodeGenerator::emitPushWithScope):
(JSC::BytecodeGenerator::emitPopWithScope):
(JSC::BytecodeGenerator::pushFinallyControlFlowScope):
(JSC::BytecodeGenerator::pushIteratorCloseControlFlowScope):
(JSC::BytecodeGenerator::popFinallyControlFlowScope):
(JSC::BytecodeGenerator::popIteratorCloseControlFlowScope):
(JSC::BytecodeGenerator::emitComplexPopScopes):
(JSC::BytecodeGenerator::emitPopScopes):
(JSC::BytecodeGenerator::pushLocalControlFlowScope):
(JSC::BytecodeGenerator::popLocalControlFlowScope):
(JSC::BytecodeGenerator::emitEnumeration):
(JSC::BytecodeGenerator::pushFinallyContext): Deleted.
(JSC::BytecodeGenerator::pushIteratorCloseContext): Deleted.
(JSC::BytecodeGenerator::popFinallyContext): Deleted.
(JSC::BytecodeGenerator::popIteratorCloseContext): Deleted.
(JSC::BytecodeGenerator::pushScopedControlFlowContext): Deleted.
(JSC::BytecodeGenerator::popScopedControlFlowContext): Deleted.
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::TryNode::emitBytecode):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerNodesCodegencpp">trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (209727 => 209728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-12-12 22:06:41 UTC (rev 209727)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-12-12 23:11:29 UTC (rev 209728)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2016-12-12  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Rename BytecodeGenerator's ControlFlowContext to ControlFlowScope.
+        https://bugs.webkit.org/show_bug.cgi?id=165777
+
+        Reviewed by Keith Miller.
+
+        The existing code sometimes refer to ControlFlowContext (and associated references)
+        as context, and sometimes as scope.  Let's be consistent and always call it a scope.
+
+        Also renamed push/popScopedControlFlowContext() to push/popLocalControlFlowScope()
+        because these are only used when we inc/dec the m_localScopeDepth.
+
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::initializeVarLexicalEnvironment):
+        (JSC::BytecodeGenerator::pushLexicalScopeInternal):
+        (JSC::BytecodeGenerator::popLexicalScopeInternal):
+        (JSC::BytecodeGenerator::emitPushWithScope):
+        (JSC::BytecodeGenerator::emitPopWithScope):
+        (JSC::BytecodeGenerator::pushFinallyControlFlowScope):
+        (JSC::BytecodeGenerator::pushIteratorCloseControlFlowScope):
+        (JSC::BytecodeGenerator::popFinallyControlFlowScope):
+        (JSC::BytecodeGenerator::popIteratorCloseControlFlowScope):
+        (JSC::BytecodeGenerator::emitComplexPopScopes):
+        (JSC::BytecodeGenerator::emitPopScopes):
+        (JSC::BytecodeGenerator::pushLocalControlFlowScope):
+        (JSC::BytecodeGenerator::popLocalControlFlowScope):
+        (JSC::BytecodeGenerator::emitEnumeration):
+        (JSC::BytecodeGenerator::pushFinallyContext): Deleted.
+        (JSC::BytecodeGenerator::pushIteratorCloseContext): Deleted.
+        (JSC::BytecodeGenerator::popFinallyContext): Deleted.
+        (JSC::BytecodeGenerator::popIteratorCloseContext): Deleted.
+        (JSC::BytecodeGenerator::pushScopedControlFlowContext): Deleted.
+        (JSC::BytecodeGenerator::popScopedControlFlowContext): Deleted.
+        * bytecompiler/BytecodeGenerator.h:
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::TryNode::emitBytecode):
+
</ins><span class="cx"> 2016-12-12  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         GC scheduler should avoid consecutive pauses
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (209727 => 209728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2016-12-12 22:06:41 UTC (rev 209727)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2016-12-12 23:11:29 UTC (rev 209728)
</span><span class="lines">@@ -1121,7 +1121,7 @@
</span><span class="cx">         instructions().append(scopeRegister()-&gt;index());
</span><span class="cx">         instructions().append(m_lexicalEnvironmentRegister-&gt;index());
</span><span class="cx"> 
</span><del>-        pushScopedControlFlowContext();
</del><ins>+        pushLocalControlFlowScope();
</ins><span class="cx">     }
</span><span class="cx">     bool isWithScope = false;
</span><span class="cx">     m_lexicalScopeStack.append({ functionSymbolTable, m_lexicalEnvironmentRegister, isWithScope, symbolTableConstantIndex });
</span><span class="lines">@@ -2067,7 +2067,7 @@
</span><span class="cx"> 
</span><span class="cx">         emitMove(scopeRegister(), newScope);
</span><span class="cx"> 
</span><del>-        pushScopedControlFlowContext();
</del><ins>+        pushLocalControlFlowScope();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool isWithScope = false;
</span><span class="lines">@@ -2191,7 +2191,7 @@
</span><span class="cx">     if (hasCapturedVariables) {
</span><span class="cx">         RELEASE_ASSERT(stackEntry.m_scope);
</span><span class="cx">         emitPopScope(scopeRegister(), stackEntry.m_scope);
</span><del>-        popScopedControlFlowContext();
</del><ins>+        popLocalControlFlowScope();
</ins><span class="cx">         stackEntry.m_scope-&gt;deref();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -3599,7 +3599,7 @@
</span><span class="cx"> 
</span><span class="cx"> RegisterID* BytecodeGenerator::emitPushWithScope(RegisterID* objectScope)
</span><span class="cx"> {
</span><del>-    pushScopedControlFlowContext();
</del><ins>+    pushLocalControlFlowScope();
</ins><span class="cx">     RegisterID* newScope = newBlockScopeVariable();
</span><span class="cx">     newScope-&gt;ref();
</span><span class="cx"> 
</span><span class="lines">@@ -3631,7 +3631,7 @@
</span><span class="cx"> void BytecodeGenerator::emitPopWithScope()
</span><span class="cx"> {
</span><span class="cx">     emitPopScope(scopeRegister(), scopeRegister());
</span><del>-    popScopedControlFlowContext();
</del><ins>+    popLocalControlFlowScope();
</ins><span class="cx">     auto stackEntry = m_lexicalScopeStack.takeLast();
</span><span class="cx">     stackEntry.m_scope-&gt;deref();
</span><span class="cx">     RELEASE_ASSERT(stackEntry.m_isWithScope);
</span><span class="lines">@@ -3673,19 +3673,19 @@
</span><span class="cx">     emitDebugHook(WillLeaveCallFrame, m_scopeNode-&gt;lastLine(), m_scopeNode-&gt;startOffset(), m_scopeNode-&gt;lineStartOffset());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::pushFinallyContext(StatementNode* finallyBlock)
</del><ins>+void BytecodeGenerator::pushFinallyControlFlowScope(StatementNode* finallyBlock)
</ins><span class="cx"> {
</span><span class="cx">     // Reclaim free label scopes.
</span><span class="cx">     while (m_labelScopes.size() &amp;&amp; !m_labelScopes.last().refCount())
</span><span class="cx">         m_labelScopes.removeLast();
</span><span class="cx"> 
</span><del>-    ControlFlowContext scope;
</del><ins>+    ControlFlowScope scope;
</ins><span class="cx">     scope.isFinallyBlock = true;
</span><span class="cx">     FinallyContext context = {
</span><span class="cx">         finallyBlock,
</span><span class="cx">         nullptr,
</span><span class="cx">         nullptr,
</span><del>-        static_cast&lt;unsigned&gt;(m_scopeContextStack.size()),
</del><ins>+        static_cast&lt;unsigned&gt;(m_controlFlowScopeStack.size()),
</ins><span class="cx">         static_cast&lt;unsigned&gt;(m_switchContextStack.size()),
</span><span class="cx">         static_cast&lt;unsigned&gt;(m_forInContextStack.size()),
</span><span class="cx">         static_cast&lt;unsigned&gt;(m_tryContextStack.size()),
</span><span class="lines">@@ -3695,23 +3695,23 @@
</span><span class="cx">         m_localScopeDepth
</span><span class="cx">     };
</span><span class="cx">     scope.finallyContext = context;
</span><del>-    m_scopeContextStack.append(scope);
</del><ins>+    m_controlFlowScopeStack.append(scope);
</ins><span class="cx">     m_finallyDepth++;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::pushIteratorCloseContext(RegisterID* iterator, ThrowableExpressionData* node)
</del><ins>+void BytecodeGenerator::pushIteratorCloseControlFlowScope(RegisterID* iterator, ThrowableExpressionData* node)
</ins><span class="cx"> {
</span><span class="cx">     // Reclaim free label scopes.
</span><span class="cx">     while (m_labelScopes.size() &amp;&amp; !m_labelScopes.last().refCount())
</span><span class="cx">         m_labelScopes.removeLast();
</span><span class="cx"> 
</span><del>-    ControlFlowContext scope;
</del><ins>+    ControlFlowScope scope;
</ins><span class="cx">     scope.isFinallyBlock = true;
</span><span class="cx">     FinallyContext context = {
</span><span class="cx">         nullptr,
</span><span class="cx">         iterator,
</span><span class="cx">         node,
</span><del>-        static_cast&lt;unsigned&gt;(m_scopeContextStack.size()),
</del><ins>+        static_cast&lt;unsigned&gt;(m_controlFlowScopeStack.size()),
</ins><span class="cx">         static_cast&lt;unsigned&gt;(m_switchContextStack.size()),
</span><span class="cx">         static_cast&lt;unsigned&gt;(m_forInContextStack.size()),
</span><span class="cx">         static_cast&lt;unsigned&gt;(m_tryContextStack.size()),
</span><span class="lines">@@ -3721,31 +3721,31 @@
</span><span class="cx">         m_localScopeDepth
</span><span class="cx">     };
</span><span class="cx">     scope.finallyContext = context;
</span><del>-    m_scopeContextStack.append(scope);
</del><ins>+    m_controlFlowScopeStack.append(scope);
</ins><span class="cx">     m_finallyDepth++;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::popFinallyContext()
</del><ins>+void BytecodeGenerator::popFinallyControlFlowScope()
</ins><span class="cx"> {
</span><del>-    ASSERT(m_scopeContextStack.size());
-    ASSERT(m_scopeContextStack.last().isFinallyBlock);
-    ASSERT(m_scopeContextStack.last().finallyContext.finallyBlock);
-    ASSERT(!m_scopeContextStack.last().finallyContext.iterator);
-    ASSERT(!m_scopeContextStack.last().finallyContext.enumerationNode);
</del><ins>+    ASSERT(m_controlFlowScopeStack.size());
+    ASSERT(m_controlFlowScopeStack.last().isFinallyBlock);
+    ASSERT(m_controlFlowScopeStack.last().finallyContext.finallyBlock);
+    ASSERT(!m_controlFlowScopeStack.last().finallyContext.iterator);
+    ASSERT(!m_controlFlowScopeStack.last().finallyContext.enumerationNode);
</ins><span class="cx">     ASSERT(m_finallyDepth &gt; 0);
</span><del>-    m_scopeContextStack.removeLast();
</del><ins>+    m_controlFlowScopeStack.removeLast();
</ins><span class="cx">     m_finallyDepth--;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::popIteratorCloseContext()
</del><ins>+void BytecodeGenerator::popIteratorCloseControlFlowScope()
</ins><span class="cx"> {
</span><del>-    ASSERT(m_scopeContextStack.size());
-    ASSERT(m_scopeContextStack.last().isFinallyBlock);
-    ASSERT(!m_scopeContextStack.last().finallyContext.finallyBlock);
-    ASSERT(m_scopeContextStack.last().finallyContext.iterator);
-    ASSERT(m_scopeContextStack.last().finallyContext.enumerationNode);
</del><ins>+    ASSERT(m_controlFlowScopeStack.size());
+    ASSERT(m_controlFlowScopeStack.last().isFinallyBlock);
+    ASSERT(!m_controlFlowScopeStack.last().finallyContext.finallyBlock);
+    ASSERT(m_controlFlowScopeStack.last().finallyContext.iterator);
+    ASSERT(m_controlFlowScopeStack.last().finallyContext.enumerationNode);
</ins><span class="cx">     ASSERT(m_finallyDepth &gt; 0);
</span><del>-    m_scopeContextStack.removeLast();
</del><ins>+    m_controlFlowScopeStack.removeLast();
</ins><span class="cx">     m_finallyDepth--;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3847,24 +3847,24 @@
</span><span class="cx">     emitMove(m_topMostScope, scopeRegister());
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-void BytecodeGenerator::emitComplexPopScopes(RegisterID* scope, ControlFlowContext* topScope, ControlFlowContext* bottomScope)
</del><ins>+void BytecodeGenerator::emitComplexPopScopes(RegisterID* scope, ControlFlowScope* topScope, ControlFlowScope* bottomScope)
</ins><span class="cx"> {
</span><span class="cx">     while (topScope &gt; bottomScope) {
</span><span class="cx">         // First we count the number of dynamic scopes we need to remove to get
</span><span class="cx">         // to a finally block.
</span><del>-        int nNormalScopes = 0;
</del><ins>+        int numberOfNormalScopes = 0;
</ins><span class="cx">         while (topScope &gt; bottomScope) {
</span><span class="cx">             if (topScope-&gt;isFinallyBlock)
</span><span class="cx">                 break;
</span><del>-            ++nNormalScopes;
</del><ins>+            ++numberOfNormalScopes;
</ins><span class="cx">             --topScope;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (nNormalScopes) {
</del><ins>+        if (numberOfNormalScopes) {
</ins><span class="cx">             // We need to remove a number of dynamic scopes to get to the next
</span><span class="cx">             // finally block
</span><span class="cx">             RefPtr&lt;RegisterID&gt; parentScope = newTemporary();
</span><del>-            while (nNormalScopes--) {
</del><ins>+            while (numberOfNormalScopes--) {
</ins><span class="cx">                 parentScope = emitGetParentScope(parentScope.get(), scope);
</span><span class="cx">                 emitMove(scope, parentScope.get());
</span><span class="cx">             }
</span><span class="lines">@@ -3874,7 +3874,7 @@
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        Vector&lt;ControlFlowContext&gt; savedScopeContextStack;
</del><ins>+        Vector&lt;ControlFlowScope&gt; savedControlFlowScopeStack;
</ins><span class="cx">         Vector&lt;SwitchInfo&gt; savedSwitchContextStack;
</span><span class="cx">         Vector&lt;RefPtr&lt;ForInContext&gt;&gt; savedForInContextStack;
</span><span class="cx">         Vector&lt;TryContext&gt; poppedTryContexts;
</span><span class="lines">@@ -3886,7 +3886,7 @@
</span><span class="cx">             // Save the current state of the world while instating the state of the world
</span><span class="cx">             // for the finally block.
</span><span class="cx">             FinallyContext finallyContext = topScope-&gt;finallyContext;
</span><del>-            bool flipScopes = finallyContext.scopeContextStackSize != m_scopeContextStack.size();
</del><ins>+            bool flipScopes = finallyContext.controlFlowScopeStackSize != m_controlFlowScopeStack.size();
</ins><span class="cx">             bool flipSwitches = finallyContext.switchContextStackSize != m_switchContextStack.size();
</span><span class="cx">             bool flipForIns = finallyContext.forInContextStackSize != m_forInContextStack.size();
</span><span class="cx">             bool flipTries = finallyContext.tryContextStackSize != m_tryContextStack.size();
</span><span class="lines">@@ -3895,10 +3895,10 @@
</span><span class="cx">             int topScopeIndex = -1;
</span><span class="cx">             int bottomScopeIndex = -1;
</span><span class="cx">             if (flipScopes) {
</span><del>-                topScopeIndex = topScope - m_scopeContextStack.begin();
-                bottomScopeIndex = bottomScope - m_scopeContextStack.begin();
-                savedScopeContextStack = m_scopeContextStack;
-                m_scopeContextStack.shrink(finallyContext.scopeContextStackSize);
</del><ins>+                topScopeIndex = topScope - m_controlFlowScopeStack.begin();
+                bottomScopeIndex = bottomScope - m_controlFlowScopeStack.begin();
+                savedControlFlowScopeStack = m_controlFlowScopeStack;
+                m_controlFlowScopeStack.shrink(finallyContext.controlFlowScopeStackSize);
</ins><span class="cx">             }
</span><span class="cx">             if (flipSwitches) {
</span><span class="cx">                 savedSwitchContextStack = m_switchContextStack;
</span><span class="lines">@@ -3947,9 +3947,9 @@
</span><span class="cx">             
</span><span class="cx">             // Restore the state of the world.
</span><span class="cx">             if (flipScopes) {
</span><del>-                m_scopeContextStack = savedScopeContextStack;
-                topScope = &amp;m_scopeContextStack[topScopeIndex]; // assert it's within bounds
-                bottomScope = m_scopeContextStack.begin() + bottomScopeIndex; // don't assert, since it the index might be -1.
</del><ins>+                m_controlFlowScopeStack = savedControlFlowScopeStack;
+                topScope = &amp;m_controlFlowScopeStack[topScopeIndex]; // assert it's within bounds
+                bottomScope = m_controlFlowScopeStack.begin() + bottomScopeIndex; // don't assert, since it the index might be -1.
</ins><span class="cx">             }
</span><span class="cx">             if (flipSwitches)
</span><span class="cx">                 m_switchContextStack = savedSwitchContextStack;
</span><span class="lines">@@ -3981,7 +3981,7 @@
</span><span class="cx">     ASSERT(labelScopeDepth() - targetScopeDepth &gt;= 0);
</span><span class="cx"> 
</span><span class="cx">     size_t scopeDelta = labelScopeDepth() - targetScopeDepth;
</span><del>-    ASSERT(scopeDelta &lt;= m_scopeContextStack.size());
</del><ins>+    ASSERT(scopeDelta &lt;= m_controlFlowScopeStack.size());
</ins><span class="cx">     if (!scopeDelta)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -3994,7 +3994,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    emitComplexPopScopes(scope, &amp;m_scopeContextStack.last(), &amp;m_scopeContextStack.last() - scopeDelta);
</del><ins>+    emitComplexPopScopes(scope, &amp;m_controlFlowScopeStack.last(), &amp;m_controlFlowScopeStack.last() - scopeDelta);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TryData* BytecodeGenerator::pushTry(Label* start)
</span><span class="lines">@@ -4123,19 +4123,19 @@
</span><span class="cx">     emitPutToScope(m_lexicalScopeStack.last().m_scope, functionVar, callee, ThrowIfNotFound, InitializationMode::NotInitialization);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::pushScopedControlFlowContext()
</del><ins>+void BytecodeGenerator::pushLocalControlFlowScope()
</ins><span class="cx"> {
</span><del>-    ControlFlowContext context;
-    context.isFinallyBlock = false;
-    m_scopeContextStack.append(context);
</del><ins>+    ControlFlowScope scope;
+    scope.isFinallyBlock = false;
+    m_controlFlowScopeStack.append(scope);
</ins><span class="cx">     m_localScopeDepth++;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::popScopedControlFlowContext()
</del><ins>+void BytecodeGenerator::popLocalControlFlowScope()
</ins><span class="cx"> {
</span><del>-    ASSERT(m_scopeContextStack.size());
-    ASSERT(!m_scopeContextStack.last().isFinallyBlock);
-    m_scopeContextStack.removeLast();
</del><ins>+    ASSERT(m_controlFlowScopeStack.size());
+    ASSERT(!m_controlFlowScopeStack.last().isFinallyBlock);
+    m_controlFlowScopeStack.removeLast();
</ins><span class="cx">     m_localScopeDepth--;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -4303,7 +4303,7 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Label&gt; loopDone = newLabel();
</span><span class="cx">     // RefPtr&lt;Register&gt; iterator's lifetime must be longer than IteratorCloseContext.
</span><del>-    pushIteratorCloseContext(iterator.get(), node);
</del><ins>+    pushIteratorCloseControlFlowScope(iterator.get(), node);
</ins><span class="cx">     {
</span><span class="cx">         LabelScopePtr scope = newLabelScope(LabelScope::Loop);
</span><span class="cx">         RefPtr&lt;RegisterID&gt; value = newTemporary();
</span><span class="lines">@@ -4369,7 +4369,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // IteratorClose sequence for break-ed control flow.
</span><del>-    popIteratorCloseContext();
</del><ins>+    popIteratorCloseControlFlowScope();
</ins><span class="cx">     emitIteratorClose(iterator.get(), node);
</span><span class="cx">     emitLabel(loopDone.get());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (209727 => 209728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2016-12-12 22:06:41 UTC (rev 209727)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2016-12-12 23:11:29 UTC (rev 209728)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx">         StatementNode* finallyBlock;
</span><span class="cx">         RegisterID* iterator;
</span><span class="cx">         ThrowableExpressionData* enumerationNode;
</span><del>-        unsigned scopeContextStackSize;
</del><ins>+        unsigned controlFlowScopeStackSize;
</ins><span class="cx">         unsigned switchContextStackSize;
</span><span class="cx">         unsigned forInContextStackSize;
</span><span class="cx">         unsigned tryContextStackSize;
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx">         int dynamicScopeDepth;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    struct ControlFlowContext {
</del><ins>+    struct ControlFlowScope {
</ins><span class="cx">         bool isFinallyBlock;
</span><span class="cx">         FinallyContext finallyContext;
</span><span class="cx">     };
</span><span class="lines">@@ -700,10 +700,10 @@
</span><span class="cx"> 
</span><span class="cx">         bool isInFinallyBlock() { return m_finallyDepth &gt; 0; }
</span><span class="cx"> 
</span><del>-        void pushFinallyContext(StatementNode* finallyBlock);
-        void popFinallyContext();
-        void pushIteratorCloseContext(RegisterID* iterator, ThrowableExpressionData* enumerationNode);
-        void popIteratorCloseContext();
</del><ins>+        void pushFinallyControlFlowScope(StatementNode* finallyBlock);
+        void popFinallyControlFlowScope();
+        void pushIteratorCloseControlFlowScope(RegisterID* iterator, ThrowableExpressionData* enumerationNode);
+        void popIteratorCloseControlFlowScope();
</ins><span class="cx"> 
</span><span class="cx">         void pushIndexedForInScope(RegisterID* local, RegisterID* index);
</span><span class="cx">         void popIndexedForInScope(RegisterID* local);
</span><span class="lines">@@ -797,7 +797,7 @@
</span><span class="cx"> 
</span><span class="cx">         void allocateCalleeSaveSpace();
</span><span class="cx">         void allocateAndEmitScope();
</span><del>-        void emitComplexPopScopes(RegisterID*, ControlFlowContext* topScope, ControlFlowContext* bottomScope);
</del><ins>+        void emitComplexPopScopes(RegisterID*, ControlFlowScope* topScope, ControlFlowScope* bottomScope);
</ins><span class="cx"> 
</span><span class="cx">         typedef HashMap&lt;double, JSValue&gt; NumberMap;
</span><span class="cx">         typedef HashMap&lt;UniquedStringImpl*, JSString*, IdentifierRepHash&gt; IdentifierStringMap;
</span><span class="lines">@@ -946,10 +946,10 @@
</span><span class="cx">         const CodeType m_codeType;
</span><span class="cx"> 
</span><span class="cx">         int localScopeDepth() const;
</span><del>-        void pushScopedControlFlowContext();
-        void popScopedControlFlowContext();
</del><ins>+        void pushLocalControlFlowScope();
+        void popLocalControlFlowScope();
</ins><span class="cx"> 
</span><del>-        Vector&lt;ControlFlowContext, 0, UnsafeVectorOverflow&gt; m_scopeContextStack;
</del><ins>+        Vector&lt;ControlFlowScope, 0, UnsafeVectorOverflow&gt; m_controlFlowScopeStack;
</ins><span class="cx">         Vector&lt;SwitchInfo&gt; m_switchContextStack;
</span><span class="cx">         Vector&lt;RefPtr&lt;ForInContext&gt;&gt; m_forInContextStack;
</span><span class="cx">         Vector&lt;TryContext&gt; m_tryContextStack;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerNodesCodegencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp (209727 => 209728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2016-12-12 22:06:41 UTC (rev 209727)
+++ trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2016-12-12 23:11:29 UTC (rev 209728)
</span><span class="lines">@@ -3284,7 +3284,7 @@
</span><span class="cx">     generator.emitLabel(tryStartLabel.get());
</span><span class="cx">     
</span><span class="cx">     if (m_finallyBlock)
</span><del>-        generator.pushFinallyContext(m_finallyBlock);
</del><ins>+        generator.pushFinallyControlFlowScope(m_finallyBlock);
</ins><span class="cx">     TryData* tryData = generator.pushTry(tryStartLabel.get());
</span><span class="cx"> 
</span><span class="cx">     generator.emitNode(dst, m_tryBlock);
</span><span class="lines">@@ -3322,7 +3322,7 @@
</span><span class="cx">     if (m_finallyBlock) {
</span><span class="cx">         RefPtr&lt;Label&gt; preFinallyLabel = generator.emitLabel(generator.newLabel().get());
</span><span class="cx">         
</span><del>-        generator.popFinallyContext();
</del><ins>+        generator.popFinallyControlFlowScope();
</ins><span class="cx"> 
</span><span class="cx">         RefPtr&lt;Label&gt; finallyEndLabel = generator.newLabel();
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>