<!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>[175426] 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/175426">175426</a></dd>
<dt>Author</dt> <dd>msaboff@apple.com</dd>
<dt>Date</dt> <dd>2014-10-31 14:27:10 -0700 (Fri, 31 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add scope operand to op_push_with_scope, op_push_name_scope and op_pop_scope
https://bugs.webkit.org/show_bug.cgi?id=138252

Reviewed by Geoffrey Garen.

Added scope operand to op_push_with_scope, op_push_name_scope and op_pop_scope.
Although the scope register is filled in with the ScopeChain register for all 
three bytecodes, this operand is not used in the processing of the bytecodes.
That will be addressed in a future patch.

* bytecode/BytecodeList.json: Lengthened the three bytecodes.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode): Added code to dump the scope operand.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitPushWithScope):
(JSC::BytecodeGenerator::emitPopScope):
(JSC::BytecodeGenerator::emitComplexPopScopes):
(JSC::BytecodeGenerator::emitPopScopes):
(JSC::BytecodeGenerator::emitPushFunctionNameScope):
(JSC::BytecodeGenerator::emitPushCatchScope):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::scopeRegister):
Added scope register to these emit functions and the bytecodes they emit.
New m_scopeRegister and accessor.

* bytecompiler/NodesCodegen.cpp:
(JSC::ContinueNode::emitBytecode):
(JSC::BreakNode::emitBytecode):
(JSC::ReturnNode::emitBytecode):
(JSC::WithNode::emitBytecode):
(JSC::TryNode::emitBytecode):
Created a RegisterID for the ScopeChain register and used it to emit the updated
bytecodes.

* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_push_with_scope):
(JSC::JIT::emit_op_push_name_scope):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_push_with_scope):
(JSC::JIT::emit_op_push_name_scope):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter.asm:
Updated the operand indecies for the processing of the updated bytecodes.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeListjson">trunk/Source/JavaScriptCore/bytecode/BytecodeList.json</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockcpp">trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp</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>
<li><a href="#trunkSourceJavaScriptCorejitJITOpcodescpp">trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOpcodes32_64cpp">trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreterasm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (175425 => 175426)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-10-31 21:25:42 UTC (rev 175425)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-10-31 21:27:10 UTC (rev 175426)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2014-10-31  Michael Saboff  &lt;msaboff@apple.com&gt;
+
+        Add scope operand to op_push_with_scope, op_push_name_scope and op_pop_scope
+        https://bugs.webkit.org/show_bug.cgi?id=138252
+
+        Reviewed by Geoffrey Garen.
+
+        Added scope operand to op_push_with_scope, op_push_name_scope and op_pop_scope.
+        Although the scope register is filled in with the ScopeChain register for all 
+        three bytecodes, this operand is not used in the processing of the bytecodes.
+        That will be addressed in a future patch.
+
+        * bytecode/BytecodeList.json: Lengthened the three bytecodes.
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::dumpBytecode): Added code to dump the scope operand.
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::BytecodeGenerator):
+        (JSC::BytecodeGenerator::emitPushWithScope):
+        (JSC::BytecodeGenerator::emitPopScope):
+        (JSC::BytecodeGenerator::emitComplexPopScopes):
+        (JSC::BytecodeGenerator::emitPopScopes):
+        (JSC::BytecodeGenerator::emitPushFunctionNameScope):
+        (JSC::BytecodeGenerator::emitPushCatchScope):
+        * bytecompiler/BytecodeGenerator.h:
+        (JSC::BytecodeGenerator::scopeRegister):
+        Added scope register to these emit functions and the bytecodes they emit.
+        New m_scopeRegister and accessor.
+
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::ContinueNode::emitBytecode):
+        (JSC::BreakNode::emitBytecode):
+        (JSC::ReturnNode::emitBytecode):
+        (JSC::WithNode::emitBytecode):
+        (JSC::TryNode::emitBytecode):
+        Created a RegisterID for the ScopeChain register and used it to emit the updated
+        bytecodes.
+
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emit_op_push_with_scope):
+        (JSC::JIT::emit_op_push_name_scope):
+        * jit/JITOpcodes32_64.cpp:
+        (JSC::JIT::emit_op_push_with_scope):
+        (JSC::JIT::emit_op_push_name_scope):
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * llint/LowLevelInterpreter.asm:
+        Updated the operand indecies for the processing of the updated bytecodes.
+
</ins><span class="cx"> 2014-10-31  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Make writes to RegExpObject.lastIndex cacheable.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeListjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeList.json (175425 => 175426)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2014-10-31 21:25:42 UTC (rev 175425)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2014-10-31 21:27:10 UTC (rev 175426)
</span><span class="lines">@@ -107,9 +107,9 @@
</span><span class="cx">             { &quot;name&quot; : &quot;op_resolve_scope&quot;, &quot;length&quot; : 6 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_get_from_scope&quot;, &quot;length&quot; : 8 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_put_to_scope&quot;, &quot;length&quot; : 7 },
</span><del>-            { &quot;name&quot; : &quot;op_push_with_scope&quot;, &quot;length&quot; : 2 },
-            { &quot;name&quot; : &quot;op_pop_scope&quot;, &quot;length&quot; : 1 },
-            { &quot;name&quot; : &quot;op_push_name_scope&quot;, &quot;length&quot; : 5 },
</del><ins>+            { &quot;name&quot; : &quot;op_push_with_scope&quot;, &quot;length&quot; : 3 },
+            { &quot;name&quot; : &quot;op_pop_scope&quot;, &quot;length&quot; : 2 },
+            { &quot;name&quot; : &quot;op_push_name_scope&quot;, &quot;length&quot; : 6 },
</ins><span class="cx">             { &quot;name&quot; : &quot;op_catch&quot;, &quot;length&quot; : 2 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_throw&quot;, &quot;length&quot; : 2 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_throw_static_error&quot;, &quot;length&quot; : 3 },
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp (175425 => 175426)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-10-31 21:25:42 UTC (rev 175425)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-10-31 21:27:10 UTC (rev 175426)
</span><span class="lines">@@ -1425,21 +1425,25 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case op_push_with_scope: {
</span><del>-            int r0 = (++it)-&gt;u.operand;
-            printLocationOpAndRegisterOperand(out, exec, location, it, &quot;push_with_scope&quot;, r0);
</del><ins>+            int dst = (++it)-&gt;u.operand;
+            int newScope = (++it)-&gt;u.operand;
+            printLocationAndOp(out, exec, location, it, &quot;push_with_scope&quot;);
+            out.printf(&quot;%s, %s&quot;, registerName(dst).data(), registerName(newScope).data());
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case op_pop_scope: {
</span><del>-            printLocationAndOp(out, exec, location, it, &quot;pop_scope&quot;);
</del><ins>+            int r0 = (++it)-&gt;u.operand;
+            printLocationOpAndRegisterOperand(out, exec, location, it, &quot;pop_scope&quot;, r0);
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case op_push_name_scope: {
</span><ins>+            int dst = (++it)-&gt;u.operand;
</ins><span class="cx">             int id0 = (++it)-&gt;u.operand;
</span><span class="cx">             int r1 = (++it)-&gt;u.operand;
</span><span class="cx">             unsigned attributes = (++it)-&gt;u.operand;
</span><span class="cx">             JSNameScope::Type scopeType = (JSNameScope::Type)(++it)-&gt;u.operand;
</span><span class="cx">             printLocationAndOp(out, exec, location, it, &quot;push_name_scope&quot;);
</span><del>-            out.printf(&quot;%s, %s, %u %s&quot;, idName(id0, identifier(id0)).data(), registerName(r1).data(), attributes, (scopeType == JSNameScope::FunctionNameScope) ? &quot;functionScope&quot; : ((scopeType == JSNameScope::CatchScope) ? &quot;catchScope&quot; : &quot;unknownScopeType&quot;));
</del><ins>+            out.printf(&quot;%s, %s, %s, %u %s&quot;, registerName(dst).data(), idName(id0, identifier(id0)).data(), registerName(r1).data(), attributes, (scopeType == JSNameScope::FunctionNameScope) ? &quot;functionScope&quot; : ((scopeType == JSNameScope::CatchScope) ? &quot;catchScope&quot; : &quot;unknownScopeType&quot;));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case op_catch: {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (175425 => 175426)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2014-10-31 21:25:42 UTC (rev 175425)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2014-10-31 21:27:10 UTC (rev 175426)
</span><span class="lines">@@ -164,6 +164,7 @@
</span><span class="cx">     , m_scopeNode(programNode)
</span><span class="cx">     , m_codeBlock(vm, codeBlock)
</span><span class="cx">     , m_thisRegister(CallFrame::thisArgumentOffset())
</span><ins>+    , m_scopeRegister(JSStack::ScopeChain)
</ins><span class="cx">     , m_lexicalEnvironmentRegister(0)
</span><span class="cx">     , m_emptyValueRegister(0)
</span><span class="cx">     , m_globalObjectRegister(0)
</span><span class="lines">@@ -209,6 +210,7 @@
</span><span class="cx">     , m_symbolTable(codeBlock-&gt;symbolTable())
</span><span class="cx">     , m_scopeNode(functionBody)
</span><span class="cx">     , m_codeBlock(vm, codeBlock)
</span><ins>+    , m_scopeRegister(JSStack::ScopeChain)
</ins><span class="cx">     , m_lexicalEnvironmentRegister(0)
</span><span class="cx">     , m_emptyValueRegister(0)
</span><span class="cx">     , m_globalObjectRegister(0)
</span><span class="lines">@@ -444,6 +446,7 @@
</span><span class="cx">     , m_scopeNode(evalNode)
</span><span class="cx">     , m_codeBlock(vm, codeBlock)
</span><span class="cx">     , m_thisRegister(CallFrame::thisArgumentOffset())
</span><ins>+    , m_scopeRegister(JSStack::ScopeChain)
</ins><span class="cx">     , m_lexicalEnvironmentRegister(0)
</span><span class="cx">     , m_emptyValueRegister(0)
</span><span class="cx">     , m_globalObjectRegister(0)
</span><span class="lines">@@ -2049,22 +2052,23 @@
</span><span class="cx">     instructions().append(src-&gt;index());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RegisterID* BytecodeGenerator::emitPushWithScope(RegisterID* scope)
</del><ins>+RegisterID* BytecodeGenerator::emitPushWithScope(RegisterID* dst, RegisterID* scope)
</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><span class="cx"> 
</span><del>-    return emitUnaryNoDstOp(op_push_with_scope, scope);
</del><ins>+    return emitUnaryOp(op_push_with_scope, dst, scope);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::emitPopScope()
</del><ins>+void BytecodeGenerator::emitPopScope(RegisterID* srcDst)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_scopeContextStack.size());
</span><span class="cx">     ASSERT(!m_scopeContextStack.last().isFinallyBlock);
</span><span class="cx"> 
</span><span class="cx">     emitOpcode(op_pop_scope);
</span><ins>+    instructions().append(srcDst-&gt;index());
</ins><span class="cx"> 
</span><span class="cx">     m_scopeContextStack.removeLast();
</span><span class="cx">     m_localScopeDepth--;
</span><span class="lines">@@ -2195,7 +2199,7 @@
</span><span class="cx">     return LabelScopePtr::null();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::emitComplexPopScopes(ControlFlowContext* topScope, ControlFlowContext* bottomScope)
</del><ins>+void BytecodeGenerator::emitComplexPopScopes(RegisterID* scope, ControlFlowContext* topScope, ControlFlowContext* 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="lines">@@ -2211,8 +2215,10 @@
</span><span class="cx">         if (nNormalScopes) {
</span><span class="cx">             // We need to remove a number of dynamic scopes to get to the next
</span><span class="cx">             // finally block
</span><del>-            while (nNormalScopes--)
</del><ins>+            while (nNormalScopes--) {
</ins><span class="cx">                 emitOpcode(op_pop_scope);
</span><ins>+                instructions().append(scope-&gt;index());
+            }
</ins><span class="cx"> 
</span><span class="cx">             // If topScope == bottomScope then there isn't a finally block left to emit.
</span><span class="cx">             if (topScope == bottomScope)
</span><span class="lines">@@ -2308,7 +2314,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::emitPopScopes(int targetScopeDepth)
</del><ins>+void BytecodeGenerator::emitPopScopes(RegisterID* scope, int targetScopeDepth)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(scopeDepth() - targetScopeDepth &gt;= 0);
</span><span class="cx"> 
</span><span class="lines">@@ -2318,12 +2324,14 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (!m_finallyDepth) {
</span><del>-        while (scopeDelta--)
</del><ins>+        while (scopeDelta--) {
</ins><span class="cx">             emitOpcode(op_pop_scope);
</span><ins>+            instructions().append(scope-&gt;index());
+        }
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    emitComplexPopScopes(&amp;m_scopeContextStack.last(), &amp;m_scopeContextStack.last() - scopeDelta);
</del><ins>+    emitComplexPopScopes(scope, &amp;m_scopeContextStack.last(), &amp;m_scopeContextStack.last() - scopeDelta);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TryData* BytecodeGenerator::pushTry(Label* start)
</span><span class="lines">@@ -2371,16 +2379,17 @@
</span><span class="cx">     instructions().append(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::emitPushFunctionNameScope(const Identifier&amp; property, RegisterID* value, unsigned attributes)
</del><ins>+void BytecodeGenerator::emitPushFunctionNameScope(RegisterID* dst, const Identifier&amp; property, RegisterID* value, unsigned attributes)
</ins><span class="cx"> {
</span><span class="cx">     emitOpcode(op_push_name_scope);
</span><ins>+    instructions().append(dst-&gt;index());
</ins><span class="cx">     instructions().append(addConstant(property));
</span><span class="cx">     instructions().append(value-&gt;index());
</span><span class="cx">     instructions().append(attributes);
</span><span class="cx">     instructions().append(JSNameScope::FunctionNameScope);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::emitPushCatchScope(const Identifier&amp; property, RegisterID* value, unsigned attributes)
</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="lines">@@ -2388,6 +2397,7 @@
</span><span class="cx">     m_localScopeDepth++;
</span><span class="cx"> 
</span><span class="cx">     emitOpcode(op_push_name_scope);
</span><ins>+    instructions().append(dst-&gt;index());
</ins><span class="cx">     instructions().append(addConstant(property));
</span><span class="cx">     instructions().append(value-&gt;index());
</span><span class="cx">     instructions().append(attributes);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (175425 => 175426)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2014-10-31 21:25:42 UTC (rev 175425)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2014-10-31 21:27:10 UTC (rev 175426)
</span><span class="lines">@@ -289,6 +289,8 @@
</span><span class="cx"> 
</span><span class="cx">         // Returns the register storing &quot;this&quot;
</span><span class="cx">         RegisterID* thisRegister() { return &amp;m_thisRegister; }
</span><ins>+        
+        RegisterID* scopeRegister() { return &amp;m_scopeRegister; }
</ins><span class="cx"> 
</span><span class="cx">         // Returns the next available temporary register. Registers returned by
</span><span class="cx">         // newTemporary require a modified form of reference counting: any
</span><span class="lines">@@ -510,7 +512,7 @@
</span><span class="cx">         PassRefPtr&lt;Label&gt; emitJumpIfFalse(RegisterID* cond, Label* target);
</span><span class="cx">         PassRefPtr&lt;Label&gt; emitJumpIfNotFunctionCall(RegisterID* cond, Label* target);
</span><span class="cx">         PassRefPtr&lt;Label&gt; emitJumpIfNotFunctionApply(RegisterID* cond, Label* target);
</span><del>-        void emitPopScopes(int targetScopeDepth);
</del><ins>+        void emitPopScopes(RegisterID* srcDst, int targetScopeDepth);
</ins><span class="cx"> 
</span><span class="cx">         RegisterID* emitHasIndexedProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName);
</span><span class="cx">         RegisterID* emitHasStructureProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName, RegisterID* enumerator);
</span><span class="lines">@@ -536,11 +538,11 @@
</span><span class="cx"> 
</span><span class="cx">         void emitThrowReferenceError(const String&amp; message);
</span><span class="cx"> 
</span><del>-        void emitPushFunctionNameScope(const Identifier&amp; property, RegisterID* value, unsigned attributes);
-        void emitPushCatchScope(const Identifier&amp; property, RegisterID* value, unsigned attributes);
</del><ins>+        void emitPushFunctionNameScope(RegisterID* dst, const Identifier&amp; property, RegisterID* value, unsigned attributes);
+        void emitPushCatchScope(RegisterID* dst, const Identifier&amp; property, RegisterID* value, unsigned attributes);
</ins><span class="cx"> 
</span><del>-        RegisterID* emitPushWithScope(RegisterID* scope);
-        void emitPopScope();
</del><ins>+        RegisterID* emitPushWithScope(RegisterID* dst, RegisterID* scope);
+        void emitPopScope(RegisterID* srcDst);
</ins><span class="cx"> 
</span><span class="cx">         void emitDebugHook(DebugHookID, unsigned line, unsigned charOffset, unsigned lineStart);
</span><span class="cx"> 
</span><span class="lines">@@ -591,7 +593,7 @@
</span><span class="cx">         ALWAYS_INLINE void rewindBinaryOp();
</span><span class="cx">         ALWAYS_INLINE void rewindUnaryOp();
</span><span class="cx"> 
</span><del>-        void emitComplexPopScopes(ControlFlowContext* topScope, ControlFlowContext* bottomScope);
</del><ins>+        void emitComplexPopScopes(RegisterID*, ControlFlowContext* topScope, ControlFlowContext* bottomScope);
</ins><span class="cx"> 
</span><span class="cx">         typedef HashMap&lt;double, JSValue&gt; NumberMap;
</span><span class="cx">         typedef HashMap&lt;StringImpl*, JSString*, IdentifierRepHash&gt; IdentifierStringMap;
</span><span class="lines">@@ -751,6 +753,7 @@
</span><span class="cx">         RegisterID m_ignoredResultRegister;
</span><span class="cx">         RegisterID m_thisRegister;
</span><span class="cx">         RegisterID m_calleeRegister;
</span><ins>+        RegisterID m_scopeRegister;
</ins><span class="cx">         RegisterID* m_lexicalEnvironmentRegister;
</span><span class="cx">         RegisterID* m_emptyValueRegister;
</span><span class="cx">         RegisterID* m_globalObjectRegister;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerNodesCodegencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp (175425 => 175426)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2014-10-31 21:25:42 UTC (rev 175425)
+++ trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2014-10-31 21:27:10 UTC (rev 175426)
</span><span class="lines">@@ -2250,7 +2250,7 @@
</span><span class="cx">     LabelScopePtr scope = generator.continueTarget(m_ident);
</span><span class="cx">     ASSERT(scope);
</span><span class="cx"> 
</span><del>-    generator.emitPopScopes(scope-&gt;scopeDepth());
</del><ins>+    generator.emitPopScopes(generator.scopeRegister(), scope-&gt;scopeDepth());
</ins><span class="cx">     generator.emitJump(scope-&gt;continueTarget());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2277,7 +2277,7 @@
</span><span class="cx">     LabelScopePtr scope = generator.breakTarget(m_ident);
</span><span class="cx">     ASSERT(scope);
</span><span class="cx"> 
</span><del>-    generator.emitPopScopes(scope-&gt;scopeDepth());
</del><ins>+    generator.emitPopScopes(generator.scopeRegister(), scope-&gt;scopeDepth());
</ins><span class="cx">     generator.emitJump(scope-&gt;breakTarget());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2298,7 +2298,7 @@
</span><span class="cx">     }
</span><span class="cx">     if (generator.scopeDepth()) {
</span><span class="cx">         returnRegister = generator.emitMove(generator.newTemporary(), returnRegister.get());
</span><del>-        generator.emitPopScopes(0);
</del><ins>+        generator.emitPopScopes(generator.scopeRegister(), 0);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     generator.emitDebugHook(WillLeaveCallFrame, lastLine(), startOffset(), lineStartOffset());
</span><span class="lines">@@ -2313,9 +2313,9 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;RegisterID&gt; scope = generator.emitNode(m_expr);
</span><span class="cx">     generator.emitExpressionInfo(m_divot, m_divot - m_expressionLength, m_divot);
</span><del>-    generator.emitPushWithScope(scope.get());
</del><ins>+    generator.emitPushWithScope(generator.scopeRegister(), scope.get());
</ins><span class="cx">     generator.emitNode(dst, m_statement);
</span><del>-    generator.emitPopScope();
</del><ins>+    generator.emitPopScope(generator.scopeRegister());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // ------------------------------ CaseClauseNode --------------------------------
</span><span class="lines">@@ -2555,10 +2555,10 @@
</span><span class="cx">             // block should &quot;catch&quot; that exception.
</span><span class="cx">             tryData = generator.pushTry(here.get());
</span><span class="cx">         }
</span><del>-        
-        generator.emitPushCatchScope(m_exceptionIdent, exceptionRegister.get(), DontDelete);
</del><ins>+
+        generator.emitPushCatchScope(generator.scopeRegister(), m_exceptionIdent, exceptionRegister.get(), DontDelete);
</ins><span class="cx">         generator.emitNode(dst, m_catchBlock);
</span><del>-        generator.emitPopScope();
</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="trunkSourceJavaScriptCorejitJITOpcodescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp (175425 => 175426)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp        2014-10-31 21:25:42 UTC (rev 175425)
+++ trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp        2014-10-31 21:27:10 UTC (rev 175426)
</span><span class="lines">@@ -444,7 +444,7 @@
</span><span class="cx"> 
</span><span class="cx"> void JIT::emit_op_push_with_scope(Instruction* currentInstruction)
</span><span class="cx"> {
</span><del>-    emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
</del><ins>+    emitGetVirtualRegister(currentInstruction[2].u.operand, regT0);
</ins><span class="cx">     callOperation(operationPushWithScope, regT0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -506,8 +506,8 @@
</span><span class="cx"> 
</span><span class="cx"> void JIT::emit_op_push_name_scope(Instruction* currentInstruction)
</span><span class="cx"> {
</span><del>-    emitGetVirtualRegister(currentInstruction[2].u.operand, regT0);
-    callOperation(operationPushNameScope, &amp;m_codeBlock-&gt;identifier(currentInstruction[1].u.operand), regT0, currentInstruction[3].u.operand, currentInstruction[4].u.operand);
</del><ins>+    emitGetVirtualRegister(currentInstruction[3].u.operand, regT0);
+    callOperation(operationPushNameScope, &amp;m_codeBlock-&gt;identifier(currentInstruction[2].u.operand), regT0, currentInstruction[4].u.operand, currentInstruction[5].u.operand);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JIT::emit_op_catch(Instruction* currentInstruction)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOpcodes32_64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp (175425 => 175426)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2014-10-31 21:25:42 UTC (rev 175425)
+++ trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2014-10-31 21:27:10 UTC (rev 175426)
</span><span class="lines">@@ -752,7 +752,7 @@
</span><span class="cx"> 
</span><span class="cx"> void JIT::emit_op_push_with_scope(Instruction* currentInstruction)
</span><span class="cx"> {
</span><del>-    emitLoad(currentInstruction[1].u.operand, regT1, regT0);
</del><ins>+    emitLoad(currentInstruction[2].u.operand, regT1, regT0);
</ins><span class="cx">     callOperation(operationPushWithScope, regT1, regT0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -786,8 +786,8 @@
</span><span class="cx"> 
</span><span class="cx"> void JIT::emit_op_push_name_scope(Instruction* currentInstruction)
</span><span class="cx"> {
</span><del>-    emitLoad(currentInstruction[2].u.operand, regT1, regT0);
-    callOperation(operationPushNameScope, &amp;m_codeBlock-&gt;identifier(currentInstruction[1].u.operand), regT1, regT0, currentInstruction[3].u.operand, currentInstruction[4].u.operand);
</del><ins>+    emitLoad(currentInstruction[3].u.operand, regT1, regT0);
+    callOperation(operationPushNameScope, &amp;m_codeBlock-&gt;identifier(currentInstruction[2].u.operand), regT1, regT0, currentInstruction[4].u.operand, currentInstruction[5].u.operand);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JIT::emit_op_catch(Instruction* currentInstruction)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (175425 => 175426)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2014-10-31 21:25:42 UTC (rev 175425)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2014-10-31 21:27:10 UTC (rev 175426)
</span><span class="lines">@@ -1269,10 +1269,10 @@
</span><span class="cx"> LLINT_SLOW_PATH_DECL(slow_path_push_with_scope)
</span><span class="cx"> {
</span><span class="cx">     LLINT_BEGIN();
</span><del>-    JSValue v = LLINT_OP_C(1).jsValue();
</del><ins>+    JSValue v = LLINT_OP_C(2).jsValue();
</ins><span class="cx">     JSObject* o = v.toObject(exec);
</span><span class="cx">     LLINT_CHECK_EXCEPTION();
</span><del>-    
</del><ins>+
</ins><span class="cx">     exec-&gt;setScope(JSWithScope::create(exec, o));
</span><span class="cx">     
</span><span class="cx">     LLINT_END();
</span><span class="lines">@@ -1289,8 +1289,8 @@
</span><span class="cx"> {
</span><span class="cx">     LLINT_BEGIN();
</span><span class="cx">     CodeBlock* codeBlock = exec-&gt;codeBlock();
</span><del>-    JSNameScope::Type type = static_cast&lt;JSNameScope::Type&gt;(pc[4].u.operand);
-    JSNameScope* scope = JSNameScope::create(exec, codeBlock-&gt;identifier(pc[1].u.operand), LLINT_OP(2).jsValue(), pc[3].u.operand, type);
</del><ins>+    JSNameScope::Type type = static_cast&lt;JSNameScope::Type&gt;(pc[5].u.operand);
+    JSNameScope* scope = JSNameScope::create(exec, codeBlock-&gt;identifier(pc[2].u.operand), LLINT_OP(3).jsValue(), pc[4].u.operand, type);
</ins><span class="cx">     exec-&gt;setScope(scope);
</span><span class="cx">     LLINT_END();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (175425 => 175426)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2014-10-31 21:25:42 UTC (rev 175425)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2014-10-31 21:27:10 UTC (rev 175426)
</span><span class="lines">@@ -1235,19 +1235,19 @@
</span><span class="cx"> _llint_op_push_with_scope:
</span><span class="cx">     traceExecution()
</span><span class="cx">     callSlowPath(_llint_slow_path_push_with_scope)
</span><del>-    dispatch(2)
</del><ins>+    dispatch(3)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> _llint_op_pop_scope:
</span><span class="cx">     traceExecution()
</span><span class="cx">     callSlowPath(_llint_slow_path_pop_scope)
</span><del>-    dispatch(1)
</del><ins>+    dispatch(2)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> _llint_op_push_name_scope:
</span><span class="cx">     traceExecution()
</span><span class="cx">     callSlowPath(_llint_slow_path_push_name_scope)
</span><del>-    dispatch(5)
</del><ins>+    dispatch(6)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> _llint_op_throw:
</span></span></pre>
</div>
</div>

</body>
</html>