<!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>[186997] 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/186997">186997</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-07-18 14:21:48 -0700 (Sat, 18 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/186996">r186996</a>.
https://bugs.webkit.org/show_bug.cgi?id=147070

Broke JSC tests (Requested by smfr on #webkit).

Reverted changeset:

&quot;lexical scoping is broken with respect to &quot;break&quot; and
&quot;continue&quot;&quot;
https://bugs.webkit.org/show_bug.cgi?id=147063
http://trac.webkit.org/changeset/186996</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>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoretestsstresslexicalscopingbreakcontinuejs">trunk/Source/JavaScriptCore/tests/stress/lexical-scoping-break-continue.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (186996 => 186997)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-07-18 20:12:14 UTC (rev 186996)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-07-18 21:21:48 UTC (rev 186997)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-07-18  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r186996.
+        https://bugs.webkit.org/show_bug.cgi?id=147070
+
+        Broke JSC tests (Requested by smfr on #webkit).
+
+        Reverted changeset:
+
+        &quot;lexical scoping is broken with respect to &quot;break&quot; and
+        &quot;continue&quot;&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=147063
+        http://trac.webkit.org/changeset/186996
+
</ins><span class="cx"> 2015-07-18  Saam barati  &lt;saambarati1@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         lexical scoping is broken with respect to &quot;break&quot; and &quot;continue&quot;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (186996 => 186997)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-07-18 20:12:14 UTC (rev 186996)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-07-18 21:21:48 UTC (rev 186997)
</span><span class="lines">@@ -522,8 +522,6 @@
</span><span class="cx">         instructions().append(0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_lexicalEnvironmentRegister)
-        pushScopedControlFlowContext();
</del><span class="cx">     m_symbolTableStack.append(SymbolTableStackEntry{ Strong&lt;SymbolTable&gt;(*m_vm, m_symbolTable), m_lexicalEnvironmentRegister, false, symbolTableConstantIndex });
</span><span class="cx">     m_TDZStack.append(std::make_pair(*parentScopeTDZVariables, false));
</span><span class="cx"> }
</span><span class="lines">@@ -629,7 +627,7 @@
</span><span class="cx">         m_labelScopes.removeLast();
</span><span class="cx"> 
</span><span class="cx">     // Allocate new label scope.
</span><del>-    LabelScope scope(type, name, labelScopeDepth(), newLabel(), type == LabelScope::Loop ? newLabel() : PassRefPtr&lt;Label&gt;()); // Only loops have continue targets.
</del><ins>+    LabelScope scope(type, name, scopeDepth(), newLabel(), type == LabelScope::Loop ? newLabel() : PassRefPtr&lt;Label&gt;()); // Only loops have continue targets.
</ins><span class="cx">     m_labelScopes.append(scope);
</span><span class="cx">     return LabelScopePtr(m_labelScopes, m_labelScopes.size() - 1);
</span><span class="cx"> }
</span><span class="lines">@@ -1212,7 +1210,7 @@
</span><span class="cx">     // The format of this instruction is: op_profile_type regToProfile, TypeLocation*, flag, identifier?, resolveType?
</span><span class="cx">     emitOpcode(op_profile_type);
</span><span class="cx">     instructions().append(registerToProfile-&gt;index());
</span><del>-    instructions().append(localScopeDepth());
</del><ins>+    instructions().append(currentScopeDepth());
</ins><span class="cx">     instructions().append(flag);
</span><span class="cx">     instructions().append(identifier ? addConstant(*identifier) : 0);
</span><span class="cx">     instructions().append(resolveType());
</span><span class="lines">@@ -1320,8 +1318,6 @@
</span><span class="cx">         instructions().append(addConstantValue(jsTDZValue())-&gt;index());
</span><span class="cx"> 
</span><span class="cx">         emitMove(scopeRegister(), newScope);
</span><del>-
-        pushScopedControlFlowContext();
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_symbolTableStack.append(SymbolTableStackEntry{ symbolTable, newScope, false, symbolTableConstantIndex });
</span><span class="lines">@@ -1369,8 +1365,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (hasCapturedVariables) {
</span><span class="cx">         RELEASE_ASSERT(stackEntry.m_scope);
</span><del>-        emitPopScope(scopeRegister(), stackEntry.m_scope);
-        popScopedControlFlowContext();
</del><ins>+        RefPtr&lt;RegisterID&gt; parentScope = emitGetParentScope(newTemporary(), scopeRegister());
+        emitMove(scopeRegister(), parentScope.get());
</ins><span class="cx">         stackEntry.m_scope-&gt;deref();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1427,7 +1423,7 @@
</span><span class="cx">     // as the previous scope because the loop body is compiled under
</span><span class="cx">     // the assumption that the scope's register index is constant even
</span><span class="cx">     // though the value in that register will change on each loop iteration.
</span><del>-    RefPtr&lt;RegisterID&gt; parentScope = emitGetParentScope(newTemporary(), loopScope);
</del><ins>+    RefPtr&lt;RegisterID&gt; parentScope = emitGetParentScope(newTemporary(), scopeRegister());
</ins><span class="cx">     emitMove(scopeRegister(), parentScope.get());
</span><span class="cx"> 
</span><span class="cx">     emitOpcode(op_create_lexical_environment);
</span><span class="lines">@@ -1576,11 +1572,8 @@
</span><span class="cx"> // will start with this ResolveType and compute the least upper bound including intercepting scopes.
</span><span class="cx"> ResolveType BytecodeGenerator::resolveType()
</span><span class="cx"> {
</span><del>-    for (unsigned i = m_symbolTableStack.size(); i--; ) {
-        if (m_symbolTableStack[i].m_isWithOrCatch)
-            return Dynamic;
-    }
-
</del><ins>+    if (m_localScopeDepth)
+        return Dynamic;
</ins><span class="cx">     if (m_symbolTable &amp;&amp; m_symbolTable-&gt;usesNonStrictEval())
</span><span class="cx">         return GlobalPropertyWithVarInjectionChecks;
</span><span class="cx">     return GlobalProperty;
</span><span class="lines">@@ -1639,7 +1632,7 @@
</span><span class="cx">         instructions().append(scopeRegister()-&gt;index());
</span><span class="cx">         instructions().append(addConstant(variable.ident()));
</span><span class="cx">         instructions().append(resolveType());
</span><del>-        instructions().append(localScopeDepth());
</del><ins>+        instructions().append(currentScopeDepth());
</ins><span class="cx">         instructions().append(0);
</span><span class="cx">         return dst;
</span><span class="cx">     }
</span><span class="lines">@@ -1673,7 +1666,7 @@
</span><span class="cx">         instructions().append(scope-&gt;index());
</span><span class="cx">         instructions().append(addConstant(variable.ident()));
</span><span class="cx">         instructions().append(ResolveModeAndType(resolveMode, variable.offset().isScope() ? LocalClosureVar : resolveType()).operand());
</span><del>-        instructions().append(localScopeDepth());
</del><ins>+        instructions().append(currentScopeDepth());
</ins><span class="cx">         instructions().append(variable.offset().isScope() ? variable.offset().scopeOffset().offset() : 0);
</span><span class="cx">         instructions().append(profile);
</span><span class="cx">         return dst;
</span><span class="lines">@@ -1713,7 +1706,7 @@
</span><span class="cx">         } else {
</span><span class="cx">             ASSERT(resolveType() != LocalClosureVar);
</span><span class="cx">             instructions().append(ResolveModeAndType(resolveMode, resolveType()).operand());
</span><del>-            instructions().append(localScopeDepth());
</del><ins>+            instructions().append(currentScopeDepth());
</ins><span class="cx">         }
</span><span class="cx">         instructions().append(!!offset ? offset.offset() : 0);
</span><span class="cx">         return value;
</span><span class="lines">@@ -2481,7 +2474,10 @@
</span><span class="cx"> 
</span><span class="cx"> RegisterID* BytecodeGenerator::emitPushWithScope(RegisterID* dst, RegisterID* scope)
</span><span class="cx"> {
</span><del>-    pushScopedControlFlowContext();
</del><ins>+    ControlFlowContext context;
+    context.isFinallyBlock = false;
+    m_scopeContextStack.append(context);
+    m_localScopeDepth++;
</ins><span class="cx"> 
</span><span class="cx">     RegisterID* result = emitUnaryOp(op_push_with_scope, dst, scope);
</span><span class="cx">     m_symbolTableStack.append(SymbolTableStackEntry{ Strong&lt;SymbolTable&gt;(), nullptr, true, 0 });
</span><span class="lines">@@ -2496,16 +2492,16 @@
</span><span class="cx">     return dst;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::emitPopScope(RegisterID* dst, RegisterID* scope)
</del><ins>+void BytecodeGenerator::emitPopScope(RegisterID* srcDst)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;RegisterID&gt; parentScope = emitGetParentScope(newTemporary(), scope);
-    emitMove(dst, parentScope.get());
-}
</del><ins>+    ASSERT(m_scopeContextStack.size());
+    ASSERT(!m_scopeContextStack.last().isFinallyBlock);
</ins><span class="cx"> 
</span><del>-void BytecodeGenerator::emitPopWithOrCatchScope(RegisterID* srcDst)
-{
-    emitPopScope(srcDst, srcDst);
-    popScopedControlFlowContext();
</del><ins>+    RefPtr&lt;RegisterID&gt; parentScope = emitGetParentScope(newTemporary(), srcDst);
+    emitMove(srcDst, parentScope.get());
+
+    m_scopeContextStack.removeLast();
+    m_localScopeDepth--;
</ins><span class="cx">     SymbolTableStackEntry stackEntry = m_symbolTableStack.takeLast();
</span><span class="cx">     RELEASE_ASSERT(stackEntry.m_isWithOrCatch);
</span><span class="cx"> }
</span><span class="lines">@@ -2819,9 +2815,9 @@
</span><span class="cx"> 
</span><span class="cx"> void BytecodeGenerator::emitPopScopes(RegisterID* scope, int targetScopeDepth)
</span><span class="cx"> {
</span><del>-    ASSERT(labelScopeDepth() - targetScopeDepth &gt;= 0);
</del><ins>+    ASSERT(scopeDepth() - targetScopeDepth &gt;= 0);
</ins><span class="cx"> 
</span><del>-    size_t scopeDelta = labelScopeDepth() - targetScopeDepth;
</del><ins>+    size_t scopeDelta = scopeDepth() - targetScopeDepth;
</ins><span class="cx">     ASSERT(scopeDelta &lt;= m_scopeContextStack.size());
</span><span class="cx">     if (!scopeDelta)
</span><span class="cx">         return;
</span><span class="lines">@@ -2880,10 +2876,16 @@
</span><span class="cx"> 
</span><span class="cx"> int BytecodeGenerator::calculateTargetScopeDepthForExceptionHandler() const
</span><span class="cx"> {
</span><del>-    int depth = localScopeDepth();
</del><ins>+    int depth = m_localScopeDepth;
</ins><span class="cx"> 
</span><ins>+    for (unsigned i = m_symbolTableStack.size(); i--; ) {
+        RegisterID* scope = m_symbolTableStack[i].m_scope;
+        if (scope)
+            depth++;
+    }
+
</ins><span class="cx">     // Currently, we're maintaing compatibility with how things are done and letting the exception handling
</span><del>-    // code take into consideration the base activation of the function. There is no reason we shouldn't
</del><ins>+    // code take into consideration the base activation of the function. There is no reason we shouldn't 
</ins><span class="cx">     // be able to calculate the exact depth here and let the exception handler not worry if there is a base
</span><span class="cx">     // activation or not.
</span><span class="cx">     if (m_lexicalEnvironmentRegister)
</span><span class="lines">@@ -2893,16 +2895,18 @@
</span><span class="cx">     return depth;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-int BytecodeGenerator::localScopeDepth() const
</del><ins>+int BytecodeGenerator::currentScopeDepth() const
</ins><span class="cx"> {
</span><del>-    return m_localScopeDepth;
</del><ins>+    // This is the current number of JSScope descendents that would be allocated
+    // in this function/program if this code were running.
+    int depth = 0;
+    for (unsigned i = m_symbolTableStack.size(); i--; ) {
+        if (m_symbolTableStack[i].m_scope || m_symbolTableStack[i].m_isWithOrCatch)
+            depth++;
+    }
+    return depth;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-int BytecodeGenerator::labelScopeDepth() const
-{ 
-    return localScopeDepth() + m_finallyDepth;
-}
-
</del><span class="cx"> void BytecodeGenerator::emitThrowReferenceError(const String&amp; message)
</span><span class="cx"> {
</span><span class="cx">     emitOpcode(op_throw_static_error);
</span><span class="lines">@@ -2926,26 +2930,13 @@
</span><span class="cx">     instructions().append(JSNameScope::FunctionNameScope);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::pushScopedControlFlowContext()
</del><ins>+void BytecodeGenerator::emitPushCatchScope(RegisterID* dst, const Identifier&amp; property, RegisterID* value, unsigned attributes)
</ins><span class="cx"> {
</span><span class="cx">     ControlFlowContext context;
</span><span class="cx">     context.isFinallyBlock = false;
</span><span class="cx">     m_scopeContextStack.append(context);
</span><span class="cx">     m_localScopeDepth++;
</span><del>-}
</del><span class="cx"> 
</span><del>-void BytecodeGenerator::popScopedControlFlowContext()
-{
-    ASSERT(m_scopeContextStack.size());
-    ASSERT(!m_scopeContextStack.last().isFinallyBlock);
-    m_scopeContextStack.removeLast();
-    m_localScopeDepth--;
-}
-
-void BytecodeGenerator::emitPushCatchScope(RegisterID* dst, const Identifier&amp; property, RegisterID* value, unsigned attributes)
-{
-    pushScopedControlFlowContext();
-
</del><span class="cx">     emitOpcode(op_push_name_scope);
</span><span class="cx">     instructions().append(dst-&gt;index());
</span><span class="cx">     instructions().append(value-&gt;index());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (186996 => 186997)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-07-18 20:12:14 UTC (rev 186996)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-07-18 21:21:48 UTC (rev 186997)
</span><span class="lines">@@ -585,12 +585,12 @@
</span><span class="cx"> 
</span><span class="cx">         void emitGetScope();
</span><span class="cx">         RegisterID* emitPushWithScope(RegisterID* dst, RegisterID* scope);
</span><del>-        void emitPopScope(RegisterID* dst, RegisterID* scope);
-        void emitPopWithOrCatchScope(RegisterID* srcDst);
</del><ins>+        void emitPopScope(RegisterID* srcDst);
</ins><span class="cx">         RegisterID* emitGetParentScope(RegisterID* dst, RegisterID* scope);
</span><span class="cx"> 
</span><span class="cx">         void emitDebugHook(DebugHookID, unsigned line, unsigned charOffset, unsigned lineStart);
</span><span class="cx"> 
</span><ins>+        int scopeDepth() { return m_localScopeDepth + m_finallyDepth; }
</ins><span class="cx">         bool hasFinaliser() { return m_finallyDepth != 0; }
</span><span class="cx"> 
</span><span class="cx">         void pushFinallyContext(StatementNode* finallyBlock);
</span><span class="lines">@@ -624,7 +624,6 @@
</span><span class="cx">         void pushLexicalScope(VariableEnvironmentNode*, bool canOptimizeTDZChecks, RegisterID** constantSymbolTableResult = nullptr);
</span><span class="cx">         void popLexicalScope(VariableEnvironmentNode*);
</span><span class="cx">         void prepareLexicalScopeForNextForLoopIteration(VariableEnvironmentNode*, RegisterID* loopSymbolTable);
</span><del>-        int labelScopeDepth() const;
</del><span class="cx"> 
</span><span class="cx">     private:
</span><span class="cx">         void reclaimFreeRegisters();
</span><span class="lines">@@ -762,9 +761,7 @@
</span><span class="cx">         const CodeType m_codeType;
</span><span class="cx"> 
</span><span class="cx">         int calculateTargetScopeDepthForExceptionHandler() const;
</span><del>-        int localScopeDepth() const;
-        void pushScopedControlFlowContext();
-        void popScopedControlFlowContext();
</del><ins>+        int currentScopeDepth() const;
</ins><span class="cx"> 
</span><span class="cx">         Vector&lt;ControlFlowContext, 0, UnsafeVectorOverflow&gt; m_scopeContextStack;
</span><span class="cx">         Vector&lt;SwitchInfo&gt; m_switchContextStack;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerNodesCodegencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp (186996 => 186997)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2015-07-18 20:12:14 UTC (rev 186996)
+++ trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2015-07-18 21:21:48 UTC (rev 186997)
</span><span class="lines">@@ -2627,7 +2627,7 @@
</span><span class="cx">     LabelScopePtr scope = generator.continueTarget(m_ident);
</span><span class="cx">     ASSERT(scope);
</span><span class="cx"> 
</span><del>-    if (generator.labelScopeDepth() != scope-&gt;scopeDepth())
</del><ins>+    if (generator.scopeDepth() != scope-&gt;scopeDepth())
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     return scope-&gt;continueTarget();
</span><span class="lines">@@ -2656,7 +2656,7 @@
</span><span class="cx">     LabelScopePtr scope = generator.breakTarget(m_ident);
</span><span class="cx">     ASSERT(scope);
</span><span class="cx"> 
</span><del>-    if (generator.labelScopeDepth() != scope-&gt;scopeDepth())
</del><ins>+    if (generator.scopeDepth() != scope-&gt;scopeDepth())
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     return scope-&gt;breakTarget();
</span><span class="lines">@@ -2690,7 +2690,7 @@
</span><span class="cx">         generator.emitProfileType(returnRegister.get(), ProfileTypeBytecodeFunctionReturnStatement, nullptr);
</span><span class="cx">         generator.emitTypeProfilerExpressionInfo(divotStart(), divotEnd());
</span><span class="cx">     }
</span><del>-    if (generator.labelScopeDepth()) {
</del><ins>+    if (generator.scopeDepth()) {
</ins><span class="cx">         returnRegister = generator.emitMove(generator.newTemporary(), returnRegister.get());
</span><span class="cx">         generator.emitPopScopes(generator.scopeRegister(), 0);
</span><span class="cx">     }
</span><span class="lines">@@ -2714,7 +2714,7 @@
</span><span class="cx">     generator.emitExpressionInfo(m_divot, m_divot - m_expressionLength, m_divot);
</span><span class="cx">     generator.emitPushWithScope(generator.scopeRegister(), scope.get());
</span><span class="cx">     generator.emitNode(dst, m_statement);
</span><del>-    generator.emitPopWithOrCatchScope(generator.scopeRegister());
</del><ins>+    generator.emitPopScope(generator.scopeRegister());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // ------------------------------ CaseClauseNode --------------------------------
</span><span class="lines">@@ -2967,7 +2967,7 @@
</span><span class="cx">         generator.emitPushCatchScope(generator.scopeRegister(), m_thrownValueIdent, thrownValueRegister.get(), DontDelete);
</span><span class="cx">         generator.emitProfileControlFlow(m_tryBlock-&gt;endOffset() + 1);
</span><span class="cx">         generator.emitNode(dst, m_catchBlock);
</span><del>-        generator.emitPopWithOrCatchScope(generator.scopeRegister());
</del><ins>+        generator.emitPopScope(generator.scopeRegister());
</ins><span class="cx">         generator.emitLabel(catchEndLabel.get());
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresslexicalscopingbreakcontinuejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/tests/stress/lexical-scoping-break-continue.js (186996 => 186997)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/lexical-scoping-break-continue.js        2015-07-18 20:12:14 UTC (rev 186996)
+++ trunk/Source/JavaScriptCore/tests/stress/lexical-scoping-break-continue.js        2015-07-18 21:21:48 UTC (rev 186997)
</span><span class="lines">@@ -1,216 +0,0 @@
</span><del>-function assert(b) {
-    if (!b)
-        throw new Error(&quot;bad assertion&quot;);
-}
-noInline(assert);
-
-;(function() {
-    function test1() {
-        let x = 20;
-        function foo() {
-            label: {
-                let y = 21;
-                let capY = function () { return y; }
-                assert(x === 20);
-                break label;
-            }
-            assert(x === 20);
-        }
-        foo();
-    }
-
-    function test2() {
-        let x = 20;
-        function capX() { return x; }
-        function foo() {
-            label1: {
-                label2: {
-                    let y = 21;
-                    let capY = function () { return y; }
-                    break label2;
-                }
-                assert(x === 20);
-            }
-            assert(x === 20);
-
-            label1: {
-                label2: {
-                    let y = 21;
-                    let capY = function () { return y; }
-                    assert(x === 20);
-                    assert(y === 21);
-                    break label1;
-                }
-            }
-            assert(x === 20);
-
-            label1: {
-                let y = 21;
-                let capY = function () { return y; }
-                label2: {
-                    let y = 21;
-                    let capY = function () { return y; }
-                    assert(x === 20);
-                    assert(y === 21);
-                    break label1;
-                }
-            }
-            assert(x === 20);
-        }
-        foo()
-    }
-
-    function test3() {
-        let x = 20;
-        function capX() { return x; }
-        function foo() {
-            loop1: for (var i = 0; i++ &lt; 1000; ) {
-                //assert(x === 20);
-                loop2: for (var j = 0; j++ &lt; 1000; ) {
-                    let y = 21;
-                    let capY = function() { return y; }
-                    assert(x === 20);
-                    assert(y === 21);
-                    continue loop1;
-                    //break loop1;
-                }
-            }
-            assert(x === 20);
-        }
-        foo()
-    }
-
-    function test4() {
-        let x = 20;
-        function capX() { return x; }
-        function foo() {
-            loop1: for (var i = 0; i++ &lt; 1000; ) {
-                loop2: for (var j = 0; j++ &lt; 1000; ) {
-                    let y = 21;
-                    let capY = function() { return y; }
-                    assert(x === 20);
-                    assert(y === 21);
-                    break loop1;
-                }
-            }
-            assert(x === 20);
-        }
-        foo()
-    }
-
-    function test5() {
-        let x = 20;
-        function capX() { return x; }
-        function foo() {
-            loop1: for (var i = 0; i++ &lt; 1000; ) {
-                let y = 21;
-                let capY = function() { return y; }
-                loop2: for (var j = 0; j++ &lt; 1000; ) {
-                    let y = 21;
-                    let capY = function() { return y; }
-                    assert(x === 20);
-                    assert(y === 21);
-                    break loop1;
-                }
-            }
-            assert(x === 20);
-        }
-        foo()
-    }
-
-    function test6() {
-        let x = 20;
-        function capX() { return x; }
-        function foo() {
-            loop1: for (var i = 0; i++ &lt; 1000; ) {
-                assert(x === 20);
-                let y = 21;
-                let capY = function() { return y; }
-                loop2: for (var j = 0; j++ &lt; 1000; ) {
-                    let y = 21;
-                    let capY = function() { return y; }
-                    assert(x === 20);
-                    assert(y === 21);
-                    try {
-                        throw new Error();            
-                    } catch(e) {
-                    } finally {
-                        assert(x === 20);
-                        continue loop1;    
-                    }
-                }
-            }
-            assert(x === 20);
-        }
-        foo()
-    }
-
-    function test7() {
-        let x = 20;
-        function capX() { return x; }
-        function foo() {
-            loop1: for (var i = 0; i++ &lt; 1000; ) {
-                assert(x === 20);
-                let y = 21;
-                let capY = function() { return y; }
-                loop2: for (var j = 0; j++ &lt; 1000; ) {
-                    let y = 21;
-                    let capY = function() { return y; }
-                    assert(x === 20);
-                    assert(y === 21);
-                    try {
-                        throw new Error();            
-                    } catch(e) {
-                        continue loop1;
-                    } finally {
-                        let x = 40;
-                        let capX = function() { return x; }
-                        assert(x === 40);
-                    }
-                }
-            }
-            assert(x === 20);
-        }
-        foo()
-    }
-
-    function test8() {
-        let x = 20;
-        function capX() { return x; }
-        function foo() {
-            loop1: for (var i = 0; i++ &lt; 1000; ) {
-                assert(x === 20);
-                let y = 21;
-                let capY = function() { return y; }
-                loop2: for (var j = 0; j++ &lt; 1000; ) {
-                    let y = 21;
-                    let capY = function() { return y; }
-                    assert(x === 20);
-                    assert(y === 21);
-                    try {
-                        throw new Error();            
-                    } catch(e) {
-                        break loop1;
-                    } finally {
-                        let x = 40;
-                        let capX = function() { return x; }
-                        assert(x === 40);
-                    }
-                }
-            }
-            assert(x === 20);
-        }
-        foo()
-    }
-
-    for (var i = 0; i &lt; 1000; i++) {
-        test1();
-        test2();
-        test3();
-        test4();
-        test5();
-        test6();
-        test7();
-        test8();
-    }
-})();
</del></span></pre>
</div>
</div>

</body>
</html>