<!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>[176479] trunk</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/176479">176479</a></dd>
<dt>Author</dt> <dd>msaboff@apple.com</dd>
<dt>Date</dt> <dd>2014-11-21 15:41:26 -0800 (Fri, 21 Nov 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Allocate local ScopeChain register
https://bugs.webkit.org/show_bug.cgi?id=138793

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Now we allocate the scope register as a local.  The allocated register is stored in the 
CodeBlock for use by other components.  Update the DFG to work with a local scope register.
Changed usage of JSStack::ScopeChain access to the CallFrame header to use the allocated
local register.

* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
Updated to properly represent the operand inputs and bytecode result.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::setScopeRegister):
(JSC::CodeBlock::scopeRegister):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::setScopeRegister):
(JSC::UnlinkedCodeBlock::scopeRegister):
Added scope register member and accessors.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::allocateAndEmitScope):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::scopeRegister):
Change m_scopeRegister to an allocated register.  Added allocateAndEmitScope helper to
allocate the scope register, set the CodeBlock with its value and emit op_get_scope.

* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::scope): Changed to access the scope using the new convention.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::get):
(JSC::DFG::ByteCodeParser::flush):
(JSC::DFG::ByteCodeParser::inlineCall):
(JSC::DFG::ByteCodeParser::parseBlock):
Changed op_create_lexical_environment to set the scope VirtualRegister operand.
Filled out op_get_scope processing to emit a GetScope node putting the result in
the scope VirtualRegister result operand.
Added Phantoms where appropriate to keep the Scope register alive in places where
it use is optimized away, but where the baseline JIT would need to use its value.
Eliminated uses of JSStack::ScopeChain.

* dfg/DFGStackLayoutPhase.cpp:
(JSC::DFG::StackLayoutPhase::run):
Make sure that the scope register stack location is allocated using the same place
that the codeBlock expects. 

* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
Allow strength reduction of Flush to skip of GetScope nodes looking for a prior
corresponding SetLocal.

* interpreter/CallFrame.h:
(JSC::ExecState::scope):
(JSC::ExecState::setScope):
Added new scope() and setScope() helpers that take a VirtualRegister offset.

* interpreter/Interpreter.cpp:
(JSC::eval):
Changed eval() to get the scope from the caller's scope register instead of from the
temporary frame created for eval.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::unwind):
Changed unwind() to manipulate the scope n the allocated register instead of from the
call frame slot.

* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::readNonInlinedFrame):
(JSC::StackVisitor::readInlinedFrame):
* interpreter/StackVisitor.h:
(JSC::StackVisitor::Frame::callee):
(JSC::StackVisitor::Frame::scope): Deleted.
Eliminated the scope member as it needed to change and no StackVisitor users use it.

* jit/JITOperations.cpp:
(JSC::operationPushNameScope):
(JSC::operationPushWithScope):
* runtime/JSNameScope.h:
(JSC::JSNameScope::create):
* runtime/JSWithScope.h:
(JSC::JSWithScope::create): Deleted.
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
Deleted JSNameScope::create() and JSWithScope::create() flavors tht used the ScopeChain slot
in the CallFrame header.  Changed the only user of these function, op_push_name_scope and
op_push_with_scope helpers, to use the remaining create variants that require explicit scope.  
Those operations get the scope from the register pointed to by their scope operands.

* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
Changed resolveScope to use the allocated register.

LayoutTests:

New test that sets a breakpoint in a callee of a DFG caller.  While stopped in the
breakpoint, it modifies a global via the scope chain of the DFG caller as well as
a local of the DFG caller.

* inspector-protocol/debugger/resources/breakpoint.js:
(notInlineable3):
(dfgWithoutInline3):
* inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local-expected.txt: Added.
* inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocoldebuggerresourcesbreakpointjs">trunk/LayoutTests/inspector-protocol/debugger/resources/breakpoint.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeUseDefh">trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockcpp">trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockh">trunk/Source/JavaScriptCore/bytecode/CodeBlock.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockh">trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h</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="#trunkSourceJavaScriptCoredebuggerDebuggerCallFramecpp">trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp">trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGStackLayoutPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGStackLayoutPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGStrengthReductionPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterCallFrameh">trunk/Source/JavaScriptCore/interpreter/CallFrame.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterInterpretercpp">trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterStackVisitorcpp">trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterStackVisitorh">trunk/Source/JavaScriptCore/interpreter/StackVisitor.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreter32_64asm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreter64asm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSNameScopeh">trunk/Source/JavaScriptCore/runtime/JSNameScope.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSWithScopeh">trunk/Source/JavaScriptCore/runtime/JSWithScope.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorprotocoldebuggersetBreakpointdfgcalleeandexaminedfglocalexpectedtxt">trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocoldebuggersetBreakpointdfgcalleeandexaminedfglocalhtml">trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/LayoutTests/ChangeLog        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-11-21  Michael Saboff  &lt;msaboff@apple.com&gt;
+
+        Allocate local ScopeChain register
+        https://bugs.webkit.org/show_bug.cgi?id=138793
+
+        Reviewed by Geoffrey Garen.
+
+        New test that sets a breakpoint in a callee of a DFG caller.  While stopped in the
+        breakpoint, it modifies a global via the scope chain of the DFG caller as well as
+        a local of the DFG caller.
+
+        * inspector-protocol/debugger/resources/breakpoint.js:
+        (notInlineable3):
+        (dfgWithoutInline3):
+        * inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local-expected.txt: Added.
+        * inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: Added.
+
</ins><span class="cx"> 2014-11-21  Glenn Adams  &lt;glenn@skynav.com&gt; and Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         CSS3: line-break property support
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocoldebuggerresourcesbreakpointjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/debugger/resources/breakpoint.js (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/debugger/resources/breakpoint.js        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/LayoutTests/inspector-protocol/debugger/resources/breakpoint.js        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -91,3 +91,25 @@
</span><span class="cx">     return x + 3;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function notInlineable3(x)
+{
+    var func = new Function(&quot;return x + 100;&quot;);
+    if (x == 1999)
+        breakpointBasic();
+    return x + 3;
+}
+
+var globalVal3 = 0;
+
+function dfgWithoutInline3()
+{
+    globalVal3 = 0;
+    var i;
+    var result = 0;
+    var localVal3 = 0;
+    for (i = 0; i &lt; 2000; i++)
+        result += notInlineable3(i);
+    if (globalVal3)
+        result = globalVal3 + localVal3;
+    log(&quot;result: &quot; + result);
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocoldebuggersetBreakpointdfgcalleeandexaminedfglocalexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local-expected.txt (0 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local-expected.txt        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Debugger.evaluateOnCallFrame in a DFG compiled function from a breakpoint in a non-DFG callee.
+
+Found breakpoint.js
+inside breakpointBasic
+result: 2005000
+dfg function warmed up
+
+Breakpoint set in breakpointBasic()
+Hit Breakpoint!
+Evaluating in DFG frame at frame[2]: 'globalVal3 = 30;'
+Response value is 30
+Evaluating in DFG frame at frame[2]: 'localVal3 = 12;'
+Response value is 12
+Evaluating in DFG frame at frame[2]: 'localVal3'
+Response value is 12
+Resumed from breakpoint
+inside breakpointBasic
+result: 42
+Test complete
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocoldebuggersetBreakpointdfgcalleeandexaminedfglocalhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html (0 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html                                (rev 0)
+++ trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -0,0 +1,113 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector-protocol/resources/protocol-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/breakpoint.js&quot;&gt;&lt;/script&gt;
+
+&lt;script&gt;
+// Put this here instead of on &lt;body onload&gt; to prevent an extra Debugger.scriptParsed event.
+window.onload = runTest;
+
+function test()
+{
+    // This test setting a breakpoints in DFG compiled functions callee and then modify
+    // and examine a global and local via the DFG frame.
+
+    InspectorTest.sendCommand(&quot;Debugger.enable&quot;, {});
+
+    var breakpointId = null;
+    var scriptId = 0;
+    var startLine = 0;
+
+    InspectorTest.eventHandler[&quot;Debugger.scriptParsed&quot;] = function(messageObject)
+    {
+        if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
+            InspectorTest.log(&quot;Found breakpoint.js&quot;);
+            scriptId = messageObject.params.scriptId;
+            startLine = messageObject.params.startLine;
+
+            InspectorTest.sendCommand(&quot;Runtime.evaluate&quot;, {
+                expression: &quot;dfgWithoutInline3();&quot;
+            }, function(responseObject) {
+                InspectorTest.log(&quot;dfg function warmed up\n&quot;);
+
+                var location1 = {scriptId: scriptId, lineNumber: 2, columnNumber: 0};
+
+                InspectorTest.sendCommand(&quot;Debugger.setBreakpoint&quot;, {location: location1}, function(responseObject) {
+                    InspectorTest.checkForError(responseObject);
+                    InspectorTest.log(&quot;Breakpoint set in breakpointBasic()&quot;);
+
+                    breakpointId = responseObject.result.breakpointId;
+                    InspectorTest.sendCommand(&quot;Runtime.evaluate&quot;, {
+                        expression: &quot;dfgWithoutInline3();&quot;
+                    }, function(responseObject) {
+                        InspectorTest.log(&quot;Test complete&quot;);
+                        InspectorTest.completeTest();
+                    });
+                });
+            });
+        }
+    }
+
+    InspectorTest.eventHandler[&quot;Debugger.paused&quot;] = function(messageObject)
+    {
+        function dumpResponse(response)
+        {
+            try {
+                if (response.result.wasThrown) {
+                    InspectorTest.log(&quot;Exception thrown processing request&quot;);
+                    return false;
+                }
+                InspectorTest.log(&quot;Response value is &quot; + response.result.result.value);
+                return true;
+            } catch (e) {
+                return false;
+            }
+        }
+
+        function resumeFromBreakpoint()
+        {
+            InspectorTest.sendCommand(&quot;Debugger.resume&quot;, {}, function(responseObject) {
+                InspectorTest.log(&quot;Resumed from breakpoint&quot;);
+            });
+        }
+
+        InspectorTest.log(&quot;Hit Breakpoint!&quot;);
+        var callFrames = messageObject.params.callFrames;
+        if (callFrames.length &lt; 3) {
+            InspectorTest.log(&quot;FAIL: too few frames in stack trace&quot;);
+            resumeFromBreakpoint();
+            return;
+        }
+        var callFrameId = callFrames[2].callFrameId;
+        InspectorTest.log(&quot;Evaluating in DFG frame at frame[2]: 'globalVal3 = 30;'&quot;);
+        InspectorTest.sendCommand(&quot;Debugger.evaluateOnCallFrame&quot;, { callFrameId: callFrameId, expression: &quot;globalVal3 = 30;&quot; }, function(responseObject) {
+            if (!dumpResponse(responseObject)) {
+                resumeFromBreakpoint();
+                return;
+            }
+            InspectorTest.log(&quot;Evaluating in DFG frame at frame[2]: 'localVal3 = 12;'&quot;);
+            InspectorTest.sendCommand(&quot;Debugger.evaluateOnCallFrame&quot;, { callFrameId: callFrameId, expression: &quot;localVal3 = 12;&quot; }, function(responseObject) {
+                if (!dumpResponse(responseObject)) {
+                    resumeFromBreakpoint();
+                    return;
+                }
+                InspectorTest.log(&quot;Evaluating in DFG frame at frame[2]: 'localVal3'&quot;);
+                InspectorTest.sendCommand(&quot;Debugger.evaluateOnCallFrame&quot;, { callFrameId: callFrameId, expression: &quot;localVal3&quot; }, function(responseObject) {
+                    if (!dumpResponse(responseObject)) {
+                        resumeFromBreakpoint();
+                        return;
+                    }
+                    InspectorTest.sendCommand(&quot;Debugger.resume&quot;, {}, function(responseObject) {
+                        InspectorTest.log(&quot;Resumed from breakpoint&quot;);
+                    });
+                });
+            });
+        });
+    }
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Debugger.evaluateOnCallFrame in a DFG compiled function from a breakpoint in a non-DFG callee.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -1,3 +1,104 @@
</span><ins>+2014-11-21  Michael Saboff  &lt;msaboff@apple.com&gt;
+
+        Allocate local ScopeChain register
+        https://bugs.webkit.org/show_bug.cgi?id=138793
+
+        Reviewed by Geoffrey Garen.
+
+        Now we allocate the scope register as a local.  The allocated register is stored in the 
+        CodeBlock for use by other components.  Update the DFG to work with a local scope register.
+        Changed usage of JSStack::ScopeChain access to the CallFrame header to use the allocated
+        local register.
+
+        * bytecode/BytecodeUseDef.h:
+        (JSC::computeUsesForBytecodeOffset):
+        (JSC::computeDefsForBytecodeOffset):
+        Updated to properly represent the operand inputs and bytecode result.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::CodeBlock):
+        * bytecode/CodeBlock.h:
+        (JSC::CodeBlock::setScopeRegister):
+        (JSC::CodeBlock::scopeRegister):
+        * bytecode/UnlinkedCodeBlock.h:
+        (JSC::UnlinkedCodeBlock::setScopeRegister):
+        (JSC::UnlinkedCodeBlock::scopeRegister):
+        Added scope register member and accessors.
+
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::BytecodeGenerator):
+        (JSC::BytecodeGenerator::allocateAndEmitScope):
+        * bytecompiler/BytecodeGenerator.h:
+        (JSC::BytecodeGenerator::scopeRegister):
+        Change m_scopeRegister to an allocated register.  Added allocateAndEmitScope helper to
+        allocate the scope register, set the CodeBlock with its value and emit op_get_scope.
+
+        * debugger/DebuggerCallFrame.cpp:
+        (JSC::DebuggerCallFrame::scope): Changed to access the scope using the new convention.
+
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::get):
+        (JSC::DFG::ByteCodeParser::flush):
+        (JSC::DFG::ByteCodeParser::inlineCall):
+        (JSC::DFG::ByteCodeParser::parseBlock):
+        Changed op_create_lexical_environment to set the scope VirtualRegister operand.
+        Filled out op_get_scope processing to emit a GetScope node putting the result in
+        the scope VirtualRegister result operand.
+        Added Phantoms where appropriate to keep the Scope register alive in places where
+        it use is optimized away, but where the baseline JIT would need to use its value.
+        Eliminated uses of JSStack::ScopeChain.
+
+        * dfg/DFGStackLayoutPhase.cpp:
+        (JSC::DFG::StackLayoutPhase::run):
+        Make sure that the scope register stack location is allocated using the same place
+        that the codeBlock expects. 
+
+        * dfg/DFGStrengthReductionPhase.cpp:
+        (JSC::DFG::StrengthReductionPhase::handleNode):
+        Allow strength reduction of Flush to skip of GetScope nodes looking for a prior
+        corresponding SetLocal.
+
+        * interpreter/CallFrame.h:
+        (JSC::ExecState::scope):
+        (JSC::ExecState::setScope):
+        Added new scope() and setScope() helpers that take a VirtualRegister offset.
+
+        * interpreter/Interpreter.cpp:
+        (JSC::eval):
+        Changed eval() to get the scope from the caller's scope register instead of from the
+        temporary frame created for eval.
+
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::unwind):
+        Changed unwind() to manipulate the scope n the allocated register instead of from the
+        call frame slot.
+
+        * interpreter/StackVisitor.cpp:
+        (JSC::StackVisitor::readNonInlinedFrame):
+        (JSC::StackVisitor::readInlinedFrame):
+        * interpreter/StackVisitor.h:
+        (JSC::StackVisitor::Frame::callee):
+        (JSC::StackVisitor::Frame::scope): Deleted.
+        Eliminated the scope member as it needed to change and no StackVisitor users use it.
+
+        * jit/JITOperations.cpp:
+        (JSC::operationPushNameScope):
+        (JSC::operationPushWithScope):
+        * runtime/JSNameScope.h:
+        (JSC::JSNameScope::create):
+        * runtime/JSWithScope.h:
+        (JSC::JSWithScope::create): Deleted.
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        Deleted JSNameScope::create() and JSWithScope::create() flavors tht used the ScopeChain slot
+        in the CallFrame header.  Changed the only user of these function, op_push_name_scope and
+        op_push_with_scope helpers, to use the remaining create variants that require explicit scope.  
+        Those operations get the scope from the register pointed to by their scope operands.
+
+        * llint/LowLevelInterpreter32_64.asm:
+        * llint/LowLevelInterpreter64.asm:
+        Changed resolveScope to use the allocated register.
+
</ins><span class="cx"> 2014-11-21  Csaba Osztrogonác  &lt;ossy@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [JSC] Disable verifyHeap
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeUseDefh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -44,10 +44,7 @@
</span><span class="cx">     case op_new_array_buffer:
</span><span class="cx">     case op_throw_static_error:
</span><span class="cx">     case op_debug:
</span><del>-    case op_resolve_scope:
-    case op_pop_scope:
</del><span class="cx">     case op_jneq_ptr:
</span><del>-    case op_new_func_exp:
</del><span class="cx">     case op_loop_hint:
</span><span class="cx">     case op_jmp:
</span><span class="cx">     case op_new_object:
</span><span class="lines">@@ -57,16 +54,15 @@
</span><span class="cx">     case op_catch:
</span><span class="cx">     case op_touch_entry:
</span><span class="cx">         return;
</span><del>-    case op_new_func:
-    case op_create_lexical_environment: 
</del><ins>+    case op_create_lexical_environment:
</ins><span class="cx">     case op_get_scope:
</span><span class="cx">     case op_create_arguments:
</span><span class="cx">     case op_to_this:
</span><ins>+    case op_pop_scope:
</ins><span class="cx">     case op_profile_will_call:
</span><span class="cx">     case op_profile_did_call:
</span><span class="cx">     case op_profile_type:
</span><span class="cx">     case op_throw:
</span><del>-    case op_push_with_scope:
</del><span class="cx">     case op_end:
</span><span class="cx">     case op_ret:
</span><span class="cx">     case op_jtrue:
</span><span class="lines">@@ -78,6 +74,7 @@
</span><span class="cx">         functor(codeBlock, instruction, opcodeID, instruction[1].u.operand);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><ins>+    case op_new_func:
</ins><span class="cx">     case op_ret_object_or_this:
</span><span class="cx">     case op_jlesseq:
</span><span class="cx">     case op_jgreater:
</span><span class="lines">@@ -117,10 +114,13 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     case op_get_enumerable_length:
</span><ins>+    case op_new_func_exp:
</ins><span class="cx">     case op_to_index_string:
</span><span class="cx">     case op_init_global_const_nop:
</span><span class="cx">     case op_init_global_const:
</span><span class="cx">     case op_push_name_scope:
</span><ins>+    case op_push_with_scope:
+    case op_resolve_scope:
</ins><span class="cx">     case op_get_from_scope:
</span><span class="cx">     case op_to_primitive:
</span><span class="cx">     case op_get_by_id:
</span><span class="lines">@@ -244,10 +244,7 @@
</span><span class="cx">     // These don't define anything.
</span><span class="cx">     case op_init_global_const:
</span><span class="cx">     case op_init_global_const_nop:
</span><del>-    case op_push_name_scope:
-    case op_push_with_scope:
</del><span class="cx">     case op_put_to_scope:
</span><del>-    case op_pop_scope:
</del><span class="cx">     case op_end:
</span><span class="cx">     case op_profile_will_call:
</span><span class="cx">     case op_profile_did_call:
</span><span class="lines">@@ -301,6 +298,9 @@
</span><span class="cx">     case op_get_direct_pname:
</span><span class="cx">     case op_get_structure_property_enumerator:
</span><span class="cx">     case op_next_enumerator_pname:
</span><ins>+    case op_pop_scope:
+    case op_push_name_scope:
+    case op_push_with_scope:
</ins><span class="cx">     case op_resolve_scope:
</span><span class="cx">     case op_strcat:
</span><span class="cx">     case op_to_primitive:
</span><span class="lines">@@ -365,7 +365,6 @@
</span><span class="cx">     case op_to_this:
</span><span class="cx">     case op_get_callee:
</span><span class="cx">     case op_init_lazy_reg:
</span><del>-    case op_create_lexical_environment:
</del><span class="cx">     case op_get_scope:
</span><span class="cx">     case op_create_arguments:
</span><span class="cx">     case op_del_by_id:
</span><span class="lines">@@ -374,6 +373,11 @@
</span><span class="cx">         functor(codeBlock, instruction, opcodeID, instruction[1].u.operand);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><ins>+    case op_create_lexical_environment: {
+        functor(codeBlock, instruction, opcodeID, instruction[1].u.operand);
+        functor(codeBlock, instruction, opcodeID, instruction[2].u.operand);
+        return;
+    }
</ins><span class="cx">     case op_enter: {
</span><span class="cx">         for (unsigned i = codeBlock-&gt;m_numVars; i--;)
</span><span class="cx">             functor(codeBlock, instruction, opcodeID, virtualRegisterForLocal(i).offset());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -1630,6 +1630,7 @@
</span><span class="cx">     , m_vm(other.m_vm)
</span><span class="cx">     , m_instructions(other.m_instructions)
</span><span class="cx">     , m_thisRegister(other.m_thisRegister)
</span><ins>+    , m_scopeRegister(other.m_scopeRegister)
</ins><span class="cx">     , m_argumentsRegister(other.m_argumentsRegister)
</span><span class="cx">     , m_lexicalEnvironmentRegister(other.m_lexicalEnvironmentRegister)
</span><span class="cx">     , m_isStrictMode(other.m_isStrictMode)
</span><span class="lines">@@ -1689,6 +1690,7 @@
</span><span class="cx">     , m_ownerExecutable(m_globalObject-&gt;vm(), ownerExecutable, ownerExecutable)
</span><span class="cx">     , m_vm(unlinkedCodeBlock-&gt;vm())
</span><span class="cx">     , m_thisRegister(unlinkedCodeBlock-&gt;thisRegister())
</span><ins>+    , m_scopeRegister(unlinkedCodeBlock-&gt;scopeRegister())
</ins><span class="cx">     , m_argumentsRegister(unlinkedCodeBlock-&gt;argumentsRegister())
</span><span class="cx">     , m_lexicalEnvironmentRegister(unlinkedCodeBlock-&gt;activationRegister())
</span><span class="cx">     , m_isStrictMode(unlinkedCodeBlock-&gt;isStrictMode())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.h (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.h        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.h        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -323,6 +323,17 @@
</span><span class="cx"> 
</span><span class="cx">     bool usesEval() const { return m_unlinkedCode-&gt;usesEval(); }
</span><span class="cx"> 
</span><ins>+    void setScopeRegister(VirtualRegister scopeRegister)
+    {
+        m_scopeRegister = scopeRegister;
+    }
+
+    VirtualRegister scopeRegister() const
+    {
+        ASSERT(m_scopeRegister.isValid());
+        return m_scopeRegister;
+    }
+
</ins><span class="cx">     void setArgumentsRegister(VirtualRegister argumentsRegister)
</span><span class="cx">     {
</span><span class="cx">         ASSERT(argumentsRegister.isValid());
</span><span class="lines">@@ -340,6 +351,7 @@
</span><span class="cx">             return VirtualRegister();
</span><span class="cx">         return argumentsRegister();
</span><span class="cx">     }
</span><ins>+
</ins><span class="cx">     void setActivationRegister(VirtualRegister activationRegister)
</span><span class="cx">     {
</span><span class="cx">         m_lexicalEnvironmentRegister = activationRegister;
</span><span class="lines">@@ -1032,6 +1044,7 @@
</span><span class="cx">     RefCountedArray&lt;Instruction&gt; m_instructions;
</span><span class="cx">     WriteBarrier&lt;SymbolTable&gt; m_symbolTable;
</span><span class="cx">     VirtualRegister m_thisRegister;
</span><ins>+    VirtualRegister m_scopeRegister;
</ins><span class="cx">     VirtualRegister m_argumentsRegister;
</span><span class="cx">     VirtualRegister m_lexicalEnvironmentRegister;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -282,6 +282,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Special registers
</span><span class="cx">     void setThisRegister(VirtualRegister thisRegister) { m_thisRegister = thisRegister; }
</span><ins>+    void setScopeRegister(VirtualRegister scopeRegister) { m_scopeRegister = scopeRegister; }
</ins><span class="cx">     void setActivationRegister(VirtualRegister activationRegister) { m_lexicalEnvironmentRegister = activationRegister; }
</span><span class="cx"> 
</span><span class="cx">     void setArgumentsRegister(VirtualRegister argumentsRegister) { m_argumentsRegister = argumentsRegister; }
</span><span class="lines">@@ -429,6 +430,7 @@
</span><span class="cx">     CodeType codeType() const { return m_codeType; }
</span><span class="cx"> 
</span><span class="cx">     VirtualRegister thisRegister() const { return m_thisRegister; }
</span><ins>+    VirtualRegister scopeRegister() const { return m_scopeRegister; }
</ins><span class="cx">     VirtualRegister activationRegister() const { return m_lexicalEnvironmentRegister; }
</span><span class="cx">     bool hasActivationRegister() const { return m_lexicalEnvironmentRegister.isValid(); }
</span><span class="cx"> 
</span><span class="lines">@@ -520,6 +522,7 @@
</span><span class="cx"> 
</span><span class="cx">     VirtualRegister m_thisRegister;
</span><span class="cx">     VirtualRegister m_argumentsRegister;
</span><ins>+    VirtualRegister m_scopeRegister;
</ins><span class="cx">     VirtualRegister m_lexicalEnvironmentRegister;
</span><span class="cx">     VirtualRegister m_globalObjectRegister;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -164,7 +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><del>-    , m_scopeRegister(JSStack::ScopeChain)
</del><ins>+    , m_scopeRegister(0)
</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">@@ -190,7 +190,7 @@
</span><span class="cx"> 
</span><span class="cx">     emitOpcode(op_enter);
</span><span class="cx"> 
</span><del>-    emitGetScope();
</del><ins>+    allocateAndEmitScope();
</ins><span class="cx"> 
</span><span class="cx">     const VarStack&amp; varStack = programNode-&gt;varStack();
</span><span class="cx">     const FunctionStack&amp; functionStack = programNode-&gt;functionStack();
</span><span class="lines">@@ -212,7 +212,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><del>-    , m_scopeRegister(JSStack::ScopeChain)
</del><ins>+    , m_scopeRegister(0)
</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">@@ -251,7 +251,7 @@
</span><span class="cx"> 
</span><span class="cx">     emitOpcode(op_enter);
</span><span class="cx"> 
</span><del>-    emitGetScope();
</del><ins>+    allocateAndEmitScope();
</ins><span class="cx"> 
</span><span class="cx">     if (m_codeBlock-&gt;needsFullScopeChain() || m_shouldEmitDebugHooks) {
</span><span class="cx">         m_lexicalEnvironmentRegister = addVar();
</span><span class="lines">@@ -452,7 +452,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><del>-    , m_scopeRegister(JSStack::ScopeChain)
</del><ins>+    , m_scopeRegister(0)
</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">@@ -479,7 +479,7 @@
</span><span class="cx"> 
</span><span class="cx">     emitOpcode(op_enter);
</span><span class="cx"> 
</span><del>-    emitGetScope();
</del><ins>+    allocateAndEmitScope();
</ins><span class="cx"> 
</span><span class="cx">     const DeclarationStacks::FunctionStack&amp; functionStack = evalNode-&gt;functionStack();
</span><span class="cx">     for (size_t i = 0; i &lt; functionStack.size(); ++i)
</span><span class="lines">@@ -2218,6 +2218,14 @@
</span><span class="cx">     return LabelScopePtr::null();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void BytecodeGenerator::allocateAndEmitScope()
+{
+    m_scopeRegister = addVar();
+    m_scopeRegister-&gt;ref();
+    m_codeBlock-&gt;setScopeRegister(scopeRegister()-&gt;virtualRegister());
+    emitGetScope();
+}
+
</ins><span class="cx"> void BytecodeGenerator::emitComplexPopScopes(RegisterID* scope, ControlFlowContext* topScope, ControlFlowContext* bottomScope)
</span><span class="cx"> {
</span><span class="cx">     while (topScope &gt; bottomScope) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -290,7 +290,7 @@
</span><span class="cx">         // Returns the register storing &quot;this&quot;
</span><span class="cx">         RegisterID* thisRegister() { return &amp;m_thisRegister; }
</span><span class="cx">         
</span><del>-        RegisterID* scopeRegister() { return &amp;m_scopeRegister; }
</del><ins>+        RegisterID* scopeRegister() { return 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">@@ -594,6 +594,7 @@
</span><span class="cx">         ALWAYS_INLINE void rewindBinaryOp();
</span><span class="cx">         ALWAYS_INLINE void rewindUnaryOp();
</span><span class="cx"> 
</span><ins>+        void allocateAndEmitScope();
</ins><span class="cx">         void emitComplexPopScopes(RegisterID*, ControlFlowContext* topScope, ControlFlowContext* bottomScope);
</span><span class="cx"> 
</span><span class="cx">         typedef HashMap&lt;double, JSValue&gt; NumberMap;
</span><span class="lines">@@ -754,7 +755,7 @@
</span><span class="cx">         RegisterID m_ignoredResultRegister;
</span><span class="cx">         RegisterID m_thisRegister;
</span><span class="cx">         RegisterID m_calleeRegister;
</span><del>-        RegisterID m_scopeRegister;
</del><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="trunkSourceJavaScriptCoredebuggerDebuggerCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -143,15 +143,14 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_scope) {
</span><span class="cx">         VM&amp; vm = m_callFrame-&gt;vm();
</span><ins>+        JSScope* scope;
</ins><span class="cx">         CodeBlock* codeBlock = m_callFrame-&gt;codeBlock();
</span><del>-        if (codeBlock &amp;&amp; codeBlock-&gt;needsActivation() &amp;&amp; !m_callFrame-&gt;hasActivation()) {
-            ASSERT(!m_callFrame-&gt;scope()-&gt;isWithScope());
-            JSLexicalEnvironment* lexicalEnvironment = JSLexicalEnvironment::create(vm, m_callFrame, codeBlock);
-            m_callFrame-&gt;setActivation(lexicalEnvironment);
-            m_callFrame-&gt;setScope(lexicalEnvironment);
-        }
</del><ins>+        if (codeBlock &amp;&amp; codeBlock-&gt;scopeRegister().isValid())
+            scope = m_callFrame-&gt;scope(codeBlock-&gt;scopeRegister().offset());
+        else
+            scope = jsCast&lt;JSCallee*&gt;(m_callFrame-&gt;callee())-&gt;scope();
</ins><span class="cx"> 
</span><del>-        m_scope.set(vm, DebuggerScope::create(vm, m_callFrame-&gt;scope()));
</del><ins>+        m_scope.set(vm, DebuggerScope::create(vm, scope));
</ins><span class="cx">     }
</span><span class="cx">     return m_scope.get();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -262,13 +262,11 @@
</span><span class="cx">                 JSFunction* callee = inlineCallFrame()-&gt;calleeConstant();
</span><span class="cx">                 if (operand.offset() == JSStack::Callee)
</span><span class="cx">                     return weakJSConstant(callee);
</span><del>-                if (operand.offset() == JSStack::ScopeChain)
</del><ins>+                if (operand == m_inlineStackTop-&gt;m_codeBlock-&gt;scopeRegister())
</ins><span class="cx">                     return weakJSConstant(callee-&gt;scope());
</span><span class="cx">             }
</span><span class="cx">         } else if (operand.offset() == JSStack::Callee)
</span><span class="cx">             return addToGraph(GetCallee);
</span><del>-        else if (operand.offset() == JSStack::ScopeChain)
-            return addToGraph(GetMyScope);
</del><span class="cx">         
</span><span class="cx">         return getDirect(m_inlineStackTop-&gt;remapOperand(operand));
</span><span class="cx">     }
</span><span class="lines">@@ -526,10 +524,8 @@
</span><span class="cx">         int numArguments;
</span><span class="cx">         if (InlineCallFrame* inlineCallFrame = inlineStackEntry-&gt;m_inlineCallFrame) {
</span><span class="cx">             numArguments = inlineCallFrame-&gt;arguments.size();
</span><del>-            if (inlineCallFrame-&gt;isClosureCall) {
</del><ins>+            if (inlineCallFrame-&gt;isClosureCall)
</ins><span class="cx">                 flushDirect(inlineStackEntry-&gt;remapOperand(VirtualRegister(JSStack::Callee)));
</span><del>-                flushDirect(inlineStackEntry-&gt;remapOperand(VirtualRegister(JSStack::ScopeChain)));
-            }
</del><span class="cx">         } else
</span><span class="cx">             numArguments = inlineStackEntry-&gt;m_codeBlock-&gt;numParameters();
</span><span class="cx">         for (unsigned argument = numArguments; argument-- &gt; 1;)
</span><span class="lines">@@ -1262,11 +1258,8 @@
</span><span class="cx">     if (callee.isClosureCall()) {
</span><span class="cx">         VariableAccessData* calleeVariable =
</span><span class="cx">             set(VirtualRegister(JSStack::Callee), callTargetNode, ImmediateNakedSet)-&gt;variableAccessData();
</span><del>-        VariableAccessData* scopeVariable =
-            set(VirtualRegister(JSStack::ScopeChain), addToGraph(GetScope, callTargetNode), ImmediateNakedSet)-&gt;variableAccessData();
</del><span class="cx">         
</span><span class="cx">         calleeVariable-&gt;mergeShouldNeverUnbox(true);
</span><del>-        scopeVariable-&gt;mergeShouldNeverUnbox(true);
</del><span class="cx">         
</span><span class="cx">         inlineVariableData.calleeVariable = calleeVariable;
</span><span class="cx">     }
</span><span class="lines">@@ -3195,10 +3188,13 @@
</span><span class="cx">                 if (lexicalEnvironment
</span><span class="cx">                     &amp;&amp; lexicalEnvironment-&gt;symbolTable()-&gt;m_functionEnteredOnce.isStillValid()) {
</span><span class="cx">                     addToGraph(FunctionReentryWatchpoint, OpInfo(lexicalEnvironment-&gt;symbolTable()));
</span><ins>+                    addToGraph(Phantom, getDirect(m_inlineStackTop-&gt;remapOperand(VirtualRegister(currentInstruction[2].u.operand))));
</ins><span class="cx">                     set(VirtualRegister(dst), weakJSConstant(lexicalEnvironment));
</span><span class="cx">                     break;
</span><span class="cx">                 }
</span><span class="cx">                 set(VirtualRegister(dst), getScope(VirtualRegister(currentInstruction[2].u.operand), depth));
</span><ins>+                if (inlineCallFrame())
+                    addToGraph(Phantom, getDirect(m_inlineStackTop-&gt;remapOperand(VirtualRegister(currentInstruction[2].u.operand))));
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">             case Dynamic:
</span><span class="lines">@@ -3395,11 +3391,14 @@
</span><span class="cx">         }
</span><span class="cx">             
</span><span class="cx">         case op_create_lexical_environment: {
</span><del>-            set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(CreateActivation, get(VirtualRegister(currentInstruction[1].u.operand))));
</del><ins>+            Node* lexicalEnvironment = addToGraph(CreateActivation, get(VirtualRegister(currentInstruction[1].u.operand)));
+            set(VirtualRegister(currentInstruction[1].u.operand), lexicalEnvironment);
+            set(VirtualRegister(currentInstruction[2].u.operand), lexicalEnvironment);
</ins><span class="cx">             NEXT_OPCODE(op_create_lexical_environment);
</span><span class="cx">         }
</span><span class="cx">             
</span><span class="cx">         case op_get_scope: {
</span><ins>+            set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(GetScope, get(VirtualRegister(JSStack::Callee))));
</ins><span class="cx">             NEXT_OPCODE(op_get_scope);
</span><span class="cx">         }
</span><span class="cx">             
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGStackLayoutPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGStackLayoutPhase.cpp (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGStackLayoutPhase.cpp        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/dfg/DFGStackLayoutPhase.cpp        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -168,6 +168,11 @@
</span><span class="cx">                 virtualRegisterForLocal(allocation[codeBlock()-&gt;activationRegister().toLocal()]));
</span><span class="cx">         }
</span><span class="cx">         
</span><ins>+        if (codeBlock()-&gt;scopeRegister().isValid()) {
+            codeBlock()-&gt;setScopeRegister(
+                virtualRegisterForLocal(allocation[codeBlock()-&gt;scopeRegister().toLocal()]));
+        }
+
</ins><span class="cx">         for (unsigned i = m_graph.m_inlineVariableData.size(); i--;) {
</span><span class="cx">             InlineVariableData data = m_graph.m_inlineVariableData[i];
</span><span class="cx">             InlineCallFrame* inlineCallFrame = data.inlineCallFrame;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGStrengthReductionPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -255,6 +255,7 @@
</span><span class="cx">                     case JSConstant:
</span><span class="cx">                     case DoubleConstant:
</span><span class="cx">                     case Int52Constant:
</span><ins>+                    case GetScope:
</ins><span class="cx">                         break;
</span><span class="cx">                 
</span><span class="cx">                     default:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCallFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/CallFrame.h (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CallFrame.h        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/interpreter/CallFrame.h        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -51,6 +51,12 @@
</span><span class="cx">             return this[JSStack::ScopeChain].Register::scope();
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        JSScope* scope(int scopeRegisterOffset) const
+        {
+            ASSERT(this[scopeRegisterOffset].Register::scope());
+            return this[scopeRegisterOffset].Register::scope();
+        }
+
</ins><span class="cx">         bool hasActivation() const;
</span><span class="cx">         JSLexicalEnvironment* lexicalEnvironment() const;
</span><span class="cx">         JSValue uncheckedActivation() const;
</span><span class="lines">@@ -186,6 +192,7 @@
</span><span class="cx"> 
</span><span class="cx">         void setCallerFrame(CallFrame* frame) { callerFrameAndPC().callerFrame = frame; }
</span><span class="cx">         void setScope(JSScope* scope) { static_cast&lt;Register*&gt;(this)[JSStack::ScopeChain] = scope; }
</span><ins>+        void setScope(int scopeRegisterOffset, JSScope* scope) { static_cast&lt;Register*&gt;(this)[scopeRegisterOffset] = scope; }
</ins><span class="cx">         void setActivation(JSLexicalEnvironment*);
</span><span class="cx"> 
</span><span class="cx">         ALWAYS_INLINE void init(CodeBlock* codeBlock, Instruction* vPC, JSScope* scope,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx">     
</span><span class="cx">     CallFrame* callerFrame = callFrame-&gt;callerFrame();
</span><span class="cx">     CodeBlock* callerCodeBlock = callerFrame-&gt;codeBlock();
</span><del>-    JSScope* callerScopeChain = callerFrame-&gt;scope();
</del><ins>+    JSScope* callerScopeChain = callerFrame-&gt;uncheckedR(callerCodeBlock-&gt;scopeRegister().offset()).Register::scope();
</ins><span class="cx">     EvalExecutable* eval = callerCodeBlock-&gt;evalCodeCache().tryGet(callerCodeBlock-&gt;isStrictMode(), programSource, callerScopeChain);
</span><span class="cx"> 
</span><span class="cx">     if (!eval) {
</span><span class="lines">@@ -726,14 +726,16 @@
</span><span class="cx">     if (codeBlock-&gt;needsActivation() &amp;&amp; callFrame-&gt;hasActivation())
</span><span class="cx">         ++targetScopeDepth;
</span><span class="cx"> 
</span><del>-    JSScope* scope = callFrame-&gt;scope();
</del><ins>+    int scopeRegisterOffset = codeBlock-&gt;scopeRegister().offset();
+    JSScope* scope = callFrame-&gt;scope(scopeRegisterOffset);
</ins><span class="cx">     int scopeDelta = scope-&gt;depth() - targetScopeDepth;
</span><span class="cx">     RELEASE_ASSERT(scopeDelta &gt;= 0);
</span><span class="cx"> 
</span><span class="cx">     while (scopeDelta--)
</span><span class="cx">         scope = scope-&gt;next();
</span><del>-    callFrame-&gt;setScope(scope);
</del><span class="cx"> 
</span><ins>+    callFrame-&gt;setScope(scopeRegisterOffset, scope);
+
</ins><span class="cx">     return handler;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterStackVisitorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -121,7 +121,6 @@
</span><span class="cx">     m_frame.m_callerFrame = callFrame-&gt;callerFrame(m_frame.m_CallerVMEntryFrame);
</span><span class="cx">     m_frame.m_callerIsVMEntryFrame = m_frame.m_CallerVMEntryFrame != m_frame.m_VMEntryFrame;
</span><span class="cx">     m_frame.m_callee = callFrame-&gt;callee();
</span><del>-    m_frame.m_scope = callFrame-&gt;scope();
</del><span class="cx">     m_frame.m_codeBlock = callFrame-&gt;codeBlock();
</span><span class="cx">     m_frame.m_bytecodeOffset = !m_frame.codeBlock() ? 0
</span><span class="cx">         : codeOrigin ? codeOrigin-&gt;bytecodeIndex
</span><span class="lines">@@ -155,9 +154,7 @@
</span><span class="cx">         m_frame.m_bytecodeOffset = codeOrigin-&gt;bytecodeIndex;
</span><span class="cx"> 
</span><span class="cx">         JSFunction* callee = inlineCallFrame-&gt;calleeForCallFrame(callFrame);
</span><del>-        m_frame.m_scope = callee-&gt;scope();
</del><span class="cx">         m_frame.m_callee = callee;
</span><del>-        ASSERT(m_frame.scope());
</del><span class="cx">         ASSERT(m_frame.callee());
</span><span class="cx"> 
</span><span class="cx">         // The callerFrame just needs to be non-null to indicate that we
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterStackVisitorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/StackVisitor.h (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/StackVisitor.h        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/interpreter/StackVisitor.h        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -60,7 +60,6 @@
</span><span class="cx">         bool callerIsVMEntryFrame() const { return m_callerIsVMEntryFrame; }
</span><span class="cx">         CallFrame* callerFrame() const { return m_callerFrame; }
</span><span class="cx">         JSObject* callee() const { return m_callee; }
</span><del>-        JSScope* scope() const { return m_scope; }
</del><span class="cx">         CodeBlock* codeBlock() const { return m_codeBlock; }
</span><span class="cx">         unsigned bytecodeOffset() const { return m_bytecodeOffset; }
</span><span class="cx"> #if ENABLE(DFG_JIT)
</span><span class="lines">@@ -101,7 +100,6 @@
</span><span class="cx">         VMEntryFrame* m_CallerVMEntryFrame;
</span><span class="cx">         CallFrame* m_callerFrame;
</span><span class="cx">         JSObject* m_callee;
</span><del>-        JSScope* m_scope;
</del><span class="cx">         CodeBlock* m_codeBlock;
</span><span class="cx">         unsigned m_bytecodeOffset;
</span><span class="cx">         bool m_callerIsVMEntryFrame;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -1313,9 +1313,14 @@
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><span class="cx"> 
</span><ins>+    // FIXME: This won't work if this operation is called from the DFG or FTL.
+    // This should be changed to pass in the new scope.
+    JSScope* currentScope = exec-&gt;uncheckedR(dst).Register::scope();
</ins><span class="cx">     JSNameScope::Type scopeType = static_cast&lt;JSNameScope::Type&gt;(type);
</span><del>-    JSNameScope* scope = JSNameScope::create(exec, *identifier, JSValue::decode(encodedValue), attibutes, scopeType);
</del><ins>+    JSNameScope* scope = JSNameScope::create(exec, currentScope, *identifier, JSValue::decode(encodedValue), attibutes, scopeType);
</ins><span class="cx"> 
</span><ins>+    // FIXME: This won't work if this operation is called from the DFG or FTL.
+    // This should be changed to return the new scope.
</ins><span class="cx">     exec-&gt;uncheckedR(dst) = scope;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1340,7 +1345,10 @@
</span><span class="cx">     if (vm.exception())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    exec-&gt;uncheckedR(dst) = JSWithScope::create(exec, o);
</del><ins>+    // FIXME: This won't work if this operation is called from the DFG or FTL.
+    // This should be changed to pass in the old scope and return the new scope.
+    JSScope* currentScope = exec-&gt;uncheckedR(dst).Register::scope();
+    exec-&gt;uncheckedR(dst) = JSWithScope::create(exec, o, currentScope);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JIT_OPERATION operationPopScope(ExecState* exec, int32_t scopeReg)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -1235,7 +1235,8 @@
</span><span class="cx">     execCallee-&gt;setArgumentCountIncludingThis(pc[3].u.operand);
</span><span class="cx">     execCallee-&gt;setCallerFrame(exec);
</span><span class="cx">     execCallee-&gt;uncheckedR(JSStack::Callee) = calleeAsValue;
</span><del>-    execCallee-&gt;setScope(exec-&gt;scope());
</del><ins>+    JSScope* callerScope = exec-&gt;uncheckedR(exec-&gt;codeBlock()-&gt;scopeRegister().offset()).Register::scope();
+    execCallee-&gt;setScope(callerScope);
</ins><span class="cx">     execCallee-&gt;setReturnPC(LLInt::getCodePtr(llint_generic_return_point));
</span><span class="cx">     execCallee-&gt;setCodeBlock(0);
</span><span class="cx">     exec-&gt;setCurrentVPC(pc);
</span><span class="lines">@@ -1275,7 +1276,9 @@
</span><span class="cx">     JSObject* o = v.toObject(exec);
</span><span class="cx">     LLINT_CHECK_EXCEPTION();
</span><span class="cx"> 
</span><del>-    exec-&gt;uncheckedR(pc[1].u.operand) = JSWithScope::create(exec, o);
</del><ins>+    int scopeReg = pc[1].u.operand;
+    JSScope* currentScope = exec-&gt;uncheckedR(scopeReg).Register::scope();
+    exec-&gt;uncheckedR(scopeReg) = JSWithScope::create(exec, o, currentScope);
</ins><span class="cx">     
</span><span class="cx">     LLINT_END();
</span><span class="cx"> }
</span><span class="lines">@@ -1293,9 +1296,11 @@
</span><span class="cx"> {
</span><span class="cx">     LLINT_BEGIN();
</span><span class="cx">     CodeBlock* codeBlock = exec-&gt;codeBlock();
</span><ins>+    int scopeReg = pc[1].u.operand;
+    JSScope* currentScope = exec-&gt;uncheckedR(scopeReg).Register::scope();
</ins><span class="cx">     JSNameScope::Type type = static_cast&lt;JSNameScope::Type&gt;(pc[5].u.operand);
</span><del>-    JSNameScope* scope = JSNameScope::create(exec, codeBlock-&gt;identifier(pc[2].u.operand), LLINT_OP(3).jsValue(), pc[4].u.operand, type);
-    exec-&gt;uncheckedR(pc[1].u.operand) = scope;
</del><ins>+    JSNameScope* scope = JSNameScope::create(exec, currentScope, codeBlock-&gt;identifier(pc[2].u.operand), LLINT_OP(3).jsValue(), pc[4].u.operand, type);
+    exec-&gt;uncheckedR(scopeReg) = scope;
</ins><span class="cx">     LLINT_END();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreter32_64asm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -2171,7 +2171,8 @@
</span><span class="cx">     loadp CodeBlock[cfr], t0
</span><span class="cx">     loadisFromInstruction(5, t2)
</span><span class="cx"> 
</span><del>-    loadp ScopeChain + PayloadOffset[cfr], t0
</del><ins>+    loadisFromInstruction(2, t0)
+    loadp PayloadOffset[cfr, t0, 8], t0
</ins><span class="cx">     btiz t2, .resolveScopeLoopEnd
</span><span class="cx"> 
</span><span class="cx"> .resolveScopeLoop:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreter64asm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -2000,9 +2000,9 @@
</span><span class="cx"> end
</span><span class="cx"> 
</span><span class="cx"> macro resolveScope()
</span><del>-    loadp CodeBlock[cfr], t0
</del><span class="cx">     loadisFromInstruction(5, t2)
</span><del>-    loadp ScopeChain[cfr], t0
</del><ins>+    loadisFromInstruction(2, t0)
+    loadp [cfr, t0, 8], t0
</ins><span class="cx">     btiz t2, .resolveScopeLoopEnd
</span><span class="cx"> 
</span><span class="cx"> .resolveScopeLoop:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSNameScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSNameScope.h (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSNameScope.h        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/runtime/JSNameScope.h        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -41,10 +41,10 @@
</span><span class="cx">         FunctionNameScope
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    static JSNameScope* create(ExecState* exec, const Identifier&amp; identifier, JSValue value, unsigned attributes, Type type)
</del><ins>+    static JSNameScope* create(ExecState* exec, JSScope* currentScope, const Identifier&amp; identifier, JSValue value, unsigned attributes, Type type)
</ins><span class="cx">     {
</span><span class="cx">         VM&amp; vm = exec-&gt;vm();
</span><del>-        JSNameScope* scopeObject = new (NotNull, allocateCell&lt;JSNameScope&gt;(vm.heap)) JSNameScope(vm, exec-&gt;lexicalGlobalObject(), exec-&gt;scope(), type);
</del><ins>+        JSNameScope* scopeObject = new (NotNull, allocateCell&lt;JSNameScope&gt;(vm.heap)) JSNameScope(vm, exec-&gt;lexicalGlobalObject(), currentScope, type);
</ins><span class="cx">         scopeObject-&gt;finishCreation(vm, identifier, value, attributes);
</span><span class="cx">         return scopeObject;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSWithScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSWithScope.h (176478 => 176479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSWithScope.h        2014-11-21 23:39:16 UTC (rev 176478)
+++ trunk/Source/JavaScriptCore/runtime/JSWithScope.h        2014-11-21 23:41:26 UTC (rev 176479)
</span><span class="lines">@@ -34,13 +34,6 @@
</span><span class="cx"> public:
</span><span class="cx">     typedef JSScope Base;
</span><span class="cx"> 
</span><del>-    static JSWithScope* create(ExecState* exec, JSObject* object)
-    {
-        JSWithScope* withScope = new (NotNull, allocateCell&lt;JSWithScope&gt;(*exec-&gt;heap())) JSWithScope(exec, object);
-        withScope-&gt;finishCreation(exec-&gt;vm());
-        return withScope;
-    }
-
</del><span class="cx">     static JSWithScope* create(ExecState* exec, JSObject* object, JSScope* next)
</span><span class="cx">     {
</span><span class="cx">         JSWithScope* withScope = new (NotNull, allocateCell&lt;JSWithScope&gt;(*exec-&gt;heap())) JSWithScope(exec, object, next);
</span></span></pre>
</div>
</div>

</body>
</html>