<!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>[163223] 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/163223">163223</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2014-01-31 17:24:39 -0800 (Fri, 31 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Avoid eagerly creating the JSActivation when the debugger is attached.
&lt;https://webkit.org/b/127910&gt;

Reviewed by Oliver Hunt.

Octane scores for this patch:
    baseline w/o WebInspector: 11621
    patched  w/o WebInspector: 11801
    baseline w/ WebInspector:  3295
    patched  w/ WebInspector:  7070   2.1x improvement

1. Because debugger can potentially create a closure from any call frame,
   we need every function to allocate an activation register and check for
   the need to tear off the activation (if needed) on return.

   However, we do not need to eagerly create the activation object.
   This patch implements the optimization to defer creation of the
   activation object until we actually need it i.e. when:

   1. We encounter a &quot;eval&quot;, &quot;with&quot;, or &quot;catch&quot; statement.
   2. We've paused in the debugger, and called DebuggerCallFrame::scope().

2. The UnlinkedCodeBlock provides a needsFullScopeChain flag that is used
   to indicate whether the linked CodeBlock will need an activation
   object or not. Under normal circumstances, needsFullScopeChain and
   needsActivation are synonymous. However, with a debugger attached, we
   want the CodeBlock to always allocate an activationRegister even if
   it does not need a &quot;full scope chain&quot;.

   Hence, we apply the following definitions to the &quot;flags&quot;:

   1. UnlinkedCodeBlock::needsFullScopeChain() - this flag indicates that
      the parser discovered JS artifacts (e.g. use of &quot;eval&quot;, &quot;with&quot;, etc.)
      that requires an activation.

      BytecodeGenerator's destinationForAssignResult() and leftHandSideNeedsCopy()
      checks needsFullScopeChain().

   2. UnlinkedCodeBlock::hasActivationRegister() - this flag indicates that
      an activation register was created for the UnlinkedCodeBlock either
      because it needsFullScopeChain() or because the debugger is attached.

   3. CodeBlock::needsActivation() reflects UnlinkedCodeBlock's
      hasActivationRegister().

3. Introduced BytecodeGenerator::emitPushFunctionNameScope() and
   BytecodeGenerator::emitPushCatchScope() because the JSNameScope
   pushed for a function name cannot be popped unlike the JSNameScope
   pushed for a &quot;catch&quot;. Hence, we have 2 functions to handle the 2 cases
   differently.

4. Removed DebuggerCallFrame::evaluateWithCallFrame() and require that all
   debugger evaluations go through the DebuggerCallFrame::evaluate(). This
   ensures that debugger evaluations require a DebuggerCallFrame.

   DebuggerCallFrame::evaluateWithCallFrame() was used previously because
   we didn't want to instantiate a DebuggerCallFrame on every debug hook
   callback. However, we now only call the debug hooks when needed, and
   this no longer poses a performance problem.

   In addition, when the debug hook does an eval to test a breakpoint
   condition, it is incorrect to evaluate it without a DebuggerCallFrame
   anyway.

5. Added some utility functions to the CallFrame to make it easier to work
   with the activation register in the frame (if present). These utility
   functions should only be called if the CodeBlock::needsActivation() is
   true (which indicates the presence of the activation register). The
   utlity functions are:

   1. CallFrame::hasActivation()
      - checks if the frame's activation object has been created.

   2. CallFrame::activation()
      - returns the frame's activation object.

   3. CallFrame::uncheckedActivation()
      - returns the JSValue in the frame's activation register. May be null.

   4. CallFrame::setActivation()
      - sets the frame's activation object.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
- added symbollic dumping of ResolveMode and ResolveType values for some
  bytecodes.
(JSC::CodeBlock::CodeBlock):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::activationRegister):
(JSC::CodeBlock::uncheckedActivationRegister):
(JSC::CodeBlock::needsActivation):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::needsFullScopeChain):
(JSC::UnlinkedCodeBlock::hasActivationRegister):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::resolveCallee):
(JSC::BytecodeGenerator::createActivationIfNecessary):
(JSC::BytecodeGenerator::emitCallEval):
(JSC::BytecodeGenerator::emitReturn):
(JSC::BytecodeGenerator::emitPushWithScope):
(JSC::BytecodeGenerator::emitPushFunctionNameScope):
(JSC::BytecodeGenerator::emitPushCatchScope):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::TryNode::emitBytecode):
* debugger/Debugger.cpp:
(JSC::Debugger::hasBreakpoint):
(JSC::Debugger::pauseIfNeeded):
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::scope):
(JSC::DebuggerCallFrame::evaluate):
* debugger/DebuggerCallFrame.h:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseCodeBlock):
* dfg/DFGGraph.h:
- Removed an unused function DFGGraph::needsActivation().
* interpreter/CallFrame.cpp:
(JSC::CallFrame::activation):
(JSC::CallFrame::setActivation):
* interpreter/CallFrame.h:
(JSC::ExecState::hasActivation):
(JSC::ExecState::registers):
* interpreter/CallFrameInlines.h:
(JSC::CallFrame::uncheckedActivation):
* interpreter/Interpreter.cpp:
(JSC::unwindCallFrame):
(JSC::Interpreter::unwind):
* jit/JITOperations.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):

* runtime/JSScope.cpp:
* runtime/JSScope.h:
(JSC::resolveModeName):
(JSC::resolveTypeName):
- utility functions for decoding names of the ResolveMode and ResolveType.
  These are used in CodeBlock::dumpBytecode().</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</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="#trunkSourceJavaScriptCorebytecompilerNodesCodegencpp">trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggercpp">trunk/Source/JavaScriptCore/debugger/Debugger.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggerCallFramecpp">trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggerCallFrameh">trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp">trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGGraphh">trunk/Source/JavaScriptCore/dfg/DFGGraph.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterCallFramecpp">trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterCallFrameh">trunk/Source/JavaScriptCore/interpreter/CallFrame.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterCallFrameInlinesh">trunk/Source/JavaScriptCore/interpreter/CallFrameInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterInterpretercpp">trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp</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="#trunkSourceJavaScriptCoreruntimeCommonSlowPathscpp">trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSScopecpp">trunk/Source/JavaScriptCore/runtime/JSScope.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSScopeh">trunk/Source/JavaScriptCore/runtime/JSScope.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -1,3 +1,146 @@
</span><ins>+2014-01-31  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Avoid eagerly creating the JSActivation when the debugger is attached.
+        &lt;https://webkit.org/b/127910&gt;
+
+        Reviewed by Oliver Hunt.
+
+        Octane scores for this patch:
+            baseline w/o WebInspector: 11621
+            patched  w/o WebInspector: 11801
+            baseline w/ WebInspector:  3295
+            patched  w/ WebInspector:  7070   2.1x improvement
+
+        1. Because debugger can potentially create a closure from any call frame,
+           we need every function to allocate an activation register and check for
+           the need to tear off the activation (if needed) on return.
+
+           However, we do not need to eagerly create the activation object.
+           This patch implements the optimization to defer creation of the
+           activation object until we actually need it i.e. when:
+
+           1. We encounter a &quot;eval&quot;, &quot;with&quot;, or &quot;catch&quot; statement.
+           2. We've paused in the debugger, and called DebuggerCallFrame::scope().
+
+        2. The UnlinkedCodeBlock provides a needsFullScopeChain flag that is used
+           to indicate whether the linked CodeBlock will need an activation
+           object or not. Under normal circumstances, needsFullScopeChain and
+           needsActivation are synonymous. However, with a debugger attached, we
+           want the CodeBlock to always allocate an activationRegister even if
+           it does not need a &quot;full scope chain&quot;.
+
+           Hence, we apply the following definitions to the &quot;flags&quot;:
+
+           1. UnlinkedCodeBlock::needsFullScopeChain() - this flag indicates that
+              the parser discovered JS artifacts (e.g. use of &quot;eval&quot;, &quot;with&quot;, etc.)
+              that requires an activation.
+
+              BytecodeGenerator's destinationForAssignResult() and leftHandSideNeedsCopy()
+              checks needsFullScopeChain().
+
+           2. UnlinkedCodeBlock::hasActivationRegister() - this flag indicates that
+              an activation register was created for the UnlinkedCodeBlock either
+              because it needsFullScopeChain() or because the debugger is attached.
+
+           3. CodeBlock::needsActivation() reflects UnlinkedCodeBlock's
+              hasActivationRegister().
+
+        3. Introduced BytecodeGenerator::emitPushFunctionNameScope() and
+           BytecodeGenerator::emitPushCatchScope() because the JSNameScope
+           pushed for a function name cannot be popped unlike the JSNameScope
+           pushed for a &quot;catch&quot;. Hence, we have 2 functions to handle the 2 cases
+           differently.
+
+        4. Removed DebuggerCallFrame::evaluateWithCallFrame() and require that all
+           debugger evaluations go through the DebuggerCallFrame::evaluate(). This
+           ensures that debugger evaluations require a DebuggerCallFrame.
+
+           DebuggerCallFrame::evaluateWithCallFrame() was used previously because
+           we didn't want to instantiate a DebuggerCallFrame on every debug hook
+           callback. However, we now only call the debug hooks when needed, and
+           this no longer poses a performance problem.
+
+           In addition, when the debug hook does an eval to test a breakpoint
+           condition, it is incorrect to evaluate it without a DebuggerCallFrame
+           anyway.
+
+        5. Added some utility functions to the CallFrame to make it easier to work
+           with the activation register in the frame (if present). These utility
+           functions should only be called if the CodeBlock::needsActivation() is
+           true (which indicates the presence of the activation register). The
+           utlity functions are:
+
+           1. CallFrame::hasActivation()
+              - checks if the frame's activation object has been created.
+
+           2. CallFrame::activation()
+              - returns the frame's activation object.
+
+           3. CallFrame::uncheckedActivation()
+              - returns the JSValue in the frame's activation register. May be null.
+
+           4. CallFrame::setActivation()
+              - sets the frame's activation object.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::dumpBytecode):
+        - added symbollic dumping of ResolveMode and ResolveType values for some
+          bytecodes.
+        (JSC::CodeBlock::CodeBlock):
+        * bytecode/CodeBlock.h:
+        (JSC::CodeBlock::activationRegister):
+        (JSC::CodeBlock::uncheckedActivationRegister):
+        (JSC::CodeBlock::needsActivation):
+        * bytecode/UnlinkedCodeBlock.h:
+        (JSC::UnlinkedCodeBlock::needsFullScopeChain):
+        (JSC::UnlinkedCodeBlock::hasActivationRegister):
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::BytecodeGenerator):
+        (JSC::BytecodeGenerator::resolveCallee):
+        (JSC::BytecodeGenerator::createActivationIfNecessary):
+        (JSC::BytecodeGenerator::emitCallEval):
+        (JSC::BytecodeGenerator::emitReturn):
+        (JSC::BytecodeGenerator::emitPushWithScope):
+        (JSC::BytecodeGenerator::emitPushFunctionNameScope):
+        (JSC::BytecodeGenerator::emitPushCatchScope):
+        * bytecompiler/BytecodeGenerator.h:
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::TryNode::emitBytecode):
+        * debugger/Debugger.cpp:
+        (JSC::Debugger::hasBreakpoint):
+        (JSC::Debugger::pauseIfNeeded):
+        * debugger/DebuggerCallFrame.cpp:
+        (JSC::DebuggerCallFrame::scope):
+        (JSC::DebuggerCallFrame::evaluate):
+        * debugger/DebuggerCallFrame.h:
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::parseCodeBlock):
+        * dfg/DFGGraph.h:
+        - Removed an unused function DFGGraph::needsActivation().
+        * interpreter/CallFrame.cpp:
+        (JSC::CallFrame::activation):
+        (JSC::CallFrame::setActivation):
+        * interpreter/CallFrame.h:
+        (JSC::ExecState::hasActivation):
+        (JSC::ExecState::registers):
+        * interpreter/CallFrameInlines.h:
+        (JSC::CallFrame::uncheckedActivation):
+        * interpreter/Interpreter.cpp:
+        (JSC::unwindCallFrame):
+        (JSC::Interpreter::unwind):
+        * jit/JITOperations.cpp:
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * runtime/CommonSlowPaths.cpp:
+        (JSC::SLOW_PATH_DECL):
+
+        * runtime/JSScope.cpp:
+        * runtime/JSScope.h:
+        (JSC::resolveModeName):
+        (JSC::resolveTypeName):
+        - utility functions for decoding names of the ResolveMode and ResolveType.
+          These are used in CodeBlock::dumpBytecode().
+
</ins><span class="cx"> 2014-01-31  Michael Saboff  &lt;msaboff@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION: Crash in sanitizeStackForVMImpl when scrolling @ lifehacker.com.au
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -532,7 +532,7 @@
</span><span class="cx">             argumentsRegister().offset(),
</span><span class="cx">             unmodifiedArgumentsRegister(argumentsRegister()).offset());
</span><span class="cx">     }
</span><del>-    if (needsFullScopeChain() &amp;&amp; codeType() == FunctionCode)
</del><ins>+    if (needsActivation() &amp;&amp; codeType() == FunctionCode)
</ins><span class="cx">         out.printf(&quot;; activation in r%d&quot;, activationRegister().offset());
</span><span class="cx">     out.printf(&quot;\n&quot;);
</span><span class="cx">     
</span><span class="lines">@@ -1382,10 +1382,12 @@
</span><span class="cx">         case op_resolve_scope: {
</span><span class="cx">             int r0 = (++it)-&gt;u.operand;
</span><span class="cx">             int id0 = (++it)-&gt;u.operand;
</span><del>-            int resolveModeAndType = (++it)-&gt;u.operand;
-            ++it; // depth
</del><ins>+            ResolveModeAndType modeAndType = ResolveModeAndType((++it)-&gt;u.operand);
+            int depth = (++it)-&gt;u.operand;
</ins><span class="cx">             printLocationAndOp(out, exec, location, it, &quot;resolve_scope&quot;);
</span><del>-            out.printf(&quot;%s, %s, %d&quot;, registerName(r0).data(), idName(id0, identifier(id0)).data(), resolveModeAndType);
</del><ins>+            out.printf(&quot;%s, %s, %u&lt;%s|%s&gt;, %d&quot;, registerName(r0).data(), idName(id0, identifier(id0)).data(),
+                modeAndType.operand(), resolveModeName(modeAndType.mode()), resolveTypeName(modeAndType.type()),
+                depth);
</ins><span class="cx">             ++it;
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="lines">@@ -1393,23 +1395,29 @@
</span><span class="cx">             int r0 = (++it)-&gt;u.operand;
</span><span class="cx">             int r1 = (++it)-&gt;u.operand;
</span><span class="cx">             int id0 = (++it)-&gt;u.operand;
</span><del>-            int resolveModeAndType = (++it)-&gt;u.operand;
</del><ins>+            ResolveModeAndType modeAndType = ResolveModeAndType((++it)-&gt;u.operand);
</ins><span class="cx">             ++it; // Structure
</span><del>-            ++it; // Operand
</del><ins>+            int operand = (++it)-&gt;u.operand; // Operand
</ins><span class="cx">             ++it; // Skip value profile.
</span><span class="cx">             printLocationAndOp(out, exec, location, it, &quot;get_from_scope&quot;);
</span><del>-            out.printf(&quot;%s, %s, %s, %d&quot;, registerName(r0).data(), registerName(r1).data(), idName(id0, identifier(id0)).data(), resolveModeAndType);
</del><ins>+            out.printf(&quot;%s, %s, %s, %u&lt;%s|%s&gt;, &lt;structure&gt;, %d&quot;,
+                registerName(r0).data(), registerName(r1).data(), idName(id0, identifier(id0)).data(),
+                modeAndType.operand(), resolveModeName(modeAndType.mode()), resolveTypeName(modeAndType.type()),
+                operand);
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case op_put_to_scope: {
</span><span class="cx">             int r0 = (++it)-&gt;u.operand;
</span><span class="cx">             int id0 = (++it)-&gt;u.operand;
</span><span class="cx">             int r1 = (++it)-&gt;u.operand;
</span><del>-            int resolveModeAndType = (++it)-&gt;u.operand;
</del><ins>+            ResolveModeAndType modeAndType = ResolveModeAndType((++it)-&gt;u.operand);
</ins><span class="cx">             ++it; // Structure
</span><del>-            ++it; // Operand
</del><ins>+            int operand = (++it)-&gt;u.operand; // Operand
</ins><span class="cx">             printLocationAndOp(out, exec, location, it, &quot;put_to_scope&quot;);
</span><del>-            out.printf(&quot;%s, %s, %s, %d&quot;, registerName(r0).data(), idName(id0, identifier(id0)).data(), registerName(r1).data(), resolveModeAndType);
</del><ins>+            out.printf(&quot;%s, %s, %s, %u&lt;%s|%s&gt;, &lt;structure&gt;, %d&quot;,
+                registerName(r0).data(), idName(id0, identifier(id0)).data(), registerName(r1).data(),
+                modeAndType.operand(), resolveModeName(modeAndType.mode()), resolveTypeName(modeAndType.type()),
+                operand);
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx"> #if ENABLE(LLINT_C_LOOP)
</span><span class="lines">@@ -1542,7 +1550,7 @@
</span><span class="cx">     , m_argumentsRegister(unlinkedCodeBlock-&gt;argumentsRegister())
</span><span class="cx">     , m_activationRegister(unlinkedCodeBlock-&gt;activationRegister())
</span><span class="cx">     , m_isStrictMode(unlinkedCodeBlock-&gt;isStrictMode())
</span><del>-    , m_needsActivation(unlinkedCodeBlock-&gt;needsFullScopeChain() &amp;&amp; unlinkedCodeBlock-&gt;codeType() == FunctionCode)
</del><ins>+    , m_needsActivation(unlinkedCodeBlock-&gt;hasActivationRegister() &amp;&amp; unlinkedCodeBlock-&gt;codeType() == FunctionCode)
</ins><span class="cx">     , m_source(sourceProvider)
</span><span class="cx">     , m_sourceOffset(sourceOffset)
</span><span class="cx">     , m_firstLineColumnOffset(firstLineColumnOffset)
</span><span class="lines">@@ -1867,7 +1875,6 @@
</span><span class="cx"> 
</span><span class="cx">     if (Options::dumpGeneratedBytecodes())
</span><span class="cx">         dumpBytecode();
</span><del>-
</del><span class="cx">     
</span><span class="cx">     m_heap-&gt;m_codeBlocks.add(this);
</span><span class="cx">     m_heap-&gt;reportExtraMemoryCost(sizeof(CodeBlock) + m_instructions.size() * sizeof(Instruction));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.h (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.h        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.h        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -305,7 +305,6 @@
</span><span class="cx">     void setThisRegister(VirtualRegister thisRegister) { m_thisRegister = thisRegister; }
</span><span class="cx">     VirtualRegister thisRegister() const { return m_thisRegister; }
</span><span class="cx"> 
</span><del>-    bool needsFullScopeChain() const { return m_unlinkedCode-&gt;needsFullScopeChain(); }
</del><span class="cx">     bool usesEval() const { return m_unlinkedCode-&gt;usesEval(); }
</span><span class="cx"> 
</span><span class="cx">     void setArgumentsRegister(VirtualRegister argumentsRegister)
</span><span class="lines">@@ -332,21 +331,20 @@
</span><span class="cx"> 
</span><span class="cx">     VirtualRegister activationRegister() const
</span><span class="cx">     {
</span><del>-        ASSERT(needsFullScopeChain());
</del><ins>+        ASSERT(m_activationRegister.isValid());
</ins><span class="cx">         return m_activationRegister;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     VirtualRegister uncheckedActivationRegister()
</span><span class="cx">     {
</span><del>-        if (!needsFullScopeChain())
-            return VirtualRegister();
-        return activationRegister();
</del><ins>+        return m_activationRegister;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool usesArguments() const { return m_argumentsRegister.isValid(); }
</span><span class="cx"> 
</span><span class="cx">     bool needsActivation() const
</span><span class="cx">     {
</span><ins>+        ASSERT(m_activationRegister.isValid() == m_needsActivation);
</ins><span class="cx">         return m_needsActivation;
</span><span class="cx">     }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012, 2013 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2012, 2013, 2014 Apple Inc. All Rights Reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -269,7 +269,6 @@
</span><span class="cx">     bool usesEval() const { return m_usesEval; }
</span><span class="cx"> 
</span><span class="cx">     bool needsFullScopeChain() const { return m_needsFullScopeChain; }
</span><del>-    void setNeedsFullScopeChain(bool needsFullScopeChain) { m_needsFullScopeChain = needsFullScopeChain; }
</del><span class="cx"> 
</span><span class="cx">     void addExpressionInfo(unsigned instructionOffset, int divot,
</span><span class="cx">         int startOffset, int endOffset, unsigned line, unsigned column);
</span><span class="lines">@@ -425,8 +424,8 @@
</span><span class="cx"> 
</span><span class="cx">     VirtualRegister thisRegister() const { return m_thisRegister; }
</span><span class="cx">     VirtualRegister activationRegister() const { return m_activationRegister; }
</span><ins>+    bool hasActivationRegister() const { return m_activationRegister.isValid(); }
</ins><span class="cx"> 
</span><del>-
</del><span class="cx">     void addPropertyAccessInstruction(unsigned propertyAccessInstruction)
</span><span class="cx">     {
</span><span class="cx">         m_propertyAccessInstructions.append(propertyAccessInstruction);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -157,6 +157,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_activationRegister(0)
</ins><span class="cx">     , m_emptyValueRegister(0)
</span><span class="cx">     , m_globalObjectRegister(0)
</span><span class="cx">     , m_finallyDepth(0)
</span><span class="lines">@@ -164,7 +165,6 @@
</span><span class="cx">     , m_codeType(GlobalCode)
</span><span class="cx">     , m_nextConstantOffset(0)
</span><span class="cx">     , m_globalConstantIndex(0)
</span><del>-    , m_hasCreatedActivation(true)
</del><span class="cx">     , m_firstLazyFunction(0)
</span><span class="cx">     , m_lastLazyFunction(0)
</span><span class="cx">     , m_staticPropertyAnalyzer(&amp;m_instructions)
</span><span class="lines">@@ -177,9 +177,6 @@
</span><span class="cx">     , m_expressionTooDeep(false)
</span><span class="cx">     , m_isBuiltinFunction(false)
</span><span class="cx"> {
</span><del>-    if (m_shouldEmitDebugHooks)
-        m_codeBlock-&gt;setNeedsFullScopeChain(true);
-
</del><span class="cx">     m_codeBlock-&gt;setNumParameters(1); // Allocate space for &quot;this&quot;
</span><span class="cx"> 
</span><span class="cx">     emitOpcode(op_enter);
</span><span class="lines">@@ -212,7 +209,6 @@
</span><span class="cx">     , m_codeType(FunctionCode)
</span><span class="cx">     , m_nextConstantOffset(0)
</span><span class="cx">     , m_globalConstantIndex(0)
</span><del>-    , m_hasCreatedActivation(false)
</del><span class="cx">     , m_firstLazyFunction(0)
</span><span class="cx">     , m_lastLazyFunction(0)
</span><span class="cx">     , m_staticPropertyAnalyzer(&amp;m_instructions)
</span><span class="lines">@@ -230,9 +226,6 @@
</span><span class="cx">         m_shouldEmitDebugHooks = false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_shouldEmitDebugHooks)
-        m_codeBlock-&gt;setNeedsFullScopeChain(true);
-
</del><span class="cx">     m_symbolTable-&gt;setUsesNonStrictEval(codeBlock-&gt;usesEval() &amp;&amp; !codeBlock-&gt;isStrictMode());
</span><span class="cx">     Vector&lt;Identifier&gt; boundParameterProperties;
</span><span class="cx">     FunctionParameters&amp; parameters = *functionBody-&gt;parameters();
</span><span class="lines">@@ -246,7 +239,7 @@
</span><span class="cx">     m_symbolTable-&gt;setParameterCountIncludingThis(functionBody-&gt;parameters()-&gt;size() + 1);
</span><span class="cx"> 
</span><span class="cx">     emitOpcode(op_enter);
</span><del>-    if (m_codeBlock-&gt;needsFullScopeChain()) {
</del><ins>+    if (m_codeBlock-&gt;needsFullScopeChain() || m_shouldEmitDebugHooks) {
</ins><span class="cx">         m_activationRegister = addVar();
</span><span class="cx">         emitInitLazyRegister(m_activationRegister);
</span><span class="cx">         m_codeBlock-&gt;setActivationRegister(m_activationRegister-&gt;virtualRegister());
</span><span class="lines">@@ -315,17 +308,11 @@
</span><span class="cx"> 
</span><span class="cx">     // Captured variables and functions go first so that activations don't have
</span><span class="cx">     // to step over the non-captured locals to mark them.
</span><del>-    m_hasCreatedActivation = false;
</del><span class="cx">     if (functionBody-&gt;hasCapturedVariables()) {
</span><span class="cx">         for (size_t i = 0; i &lt; functionStack.size(); ++i) {
</span><span class="cx">             FunctionBodyNode* function = functionStack[i];
</span><span class="cx">             const Identifier&amp; ident = function-&gt;ident();
</span><span class="cx">             if (functionBody-&gt;captures(ident)) {
</span><del>-                if (!m_hasCreatedActivation) {
-                    m_hasCreatedActivation = true;
-                    emitOpcode(op_create_activation);
-                    instructions().append(m_activationRegister-&gt;index());
-                }
</del><span class="cx">                 m_functions.add(ident.impl());
</span><span class="cx">                 emitNewFunction(addVar(ident, IsVariable, IsWatchable), IsCaptured, function);
</span><span class="cx">             }
</span><span class="lines">@@ -336,15 +323,10 @@
</span><span class="cx">                 addVar(ident, (varStack[i].second &amp; DeclarationStacks::IsConstant) ? IsConstant : IsVariable, IsWatchable);
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    bool canLazilyCreateFunctions = !functionBody-&gt;needsActivationForMoreThanVariables() &amp;&amp; !m_shouldEmitDebugHooks;
-    if (!canLazilyCreateFunctions &amp;&amp; !m_hasCreatedActivation) {
-        m_hasCreatedActivation = true;
-        emitOpcode(op_create_activation);
-        instructions().append(m_activationRegister-&gt;index());
-    }
</del><span class="cx"> 
</span><span class="cx">     m_symbolTable-&gt;setCaptureEnd(virtualRegisterForLocal(codeBlock-&gt;m_numVars).offset());
</span><span class="cx"> 
</span><ins>+    bool canLazilyCreateFunctions = !functionBody-&gt;needsActivationForMoreThanVariables() &amp;&amp; !m_shouldEmitDebugHooks;
</ins><span class="cx">     m_firstLazyFunction = codeBlock-&gt;m_numVars;
</span><span class="cx">     for (size_t i = 0; i &lt; functionStack.size(); ++i) {
</span><span class="cx">         FunctionBodyNode* function = functionStack[i];
</span><span class="lines">@@ -427,6 +409,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_activationRegister(0)
</ins><span class="cx">     , m_emptyValueRegister(0)
</span><span class="cx">     , m_globalObjectRegister(0)
</span><span class="cx">     , m_finallyDepth(0)
</span><span class="lines">@@ -434,7 +417,6 @@
</span><span class="cx">     , m_codeType(EvalCode)
</span><span class="cx">     , m_nextConstantOffset(0)
</span><span class="cx">     , m_globalConstantIndex(0)
</span><del>-    , m_hasCreatedActivation(true)
</del><span class="cx">     , m_firstLazyFunction(0)
</span><span class="cx">     , m_lastLazyFunction(0)
</span><span class="cx">     , m_staticPropertyAnalyzer(&amp;m_instructions)
</span><span class="lines">@@ -447,8 +429,6 @@
</span><span class="cx">     , m_expressionTooDeep(false)
</span><span class="cx">     , m_isBuiltinFunction(false)
</span><span class="cx"> {
</span><del>-    m_codeBlock-&gt;setNeedsFullScopeChain(true);
-
</del><span class="cx">     m_symbolTable-&gt;setUsesNonStrictEval(codeBlock-&gt;usesEval() &amp;&amp; !codeBlock-&gt;isStrictMode());
</span><span class="cx">     m_codeBlock-&gt;setNumParameters(1);
</span><span class="cx"> 
</span><span class="lines">@@ -491,7 +471,7 @@
</span><span class="cx"> 
</span><span class="cx">     // If non-strict eval is in play, we use a separate object in the scope chain for the callee's name.
</span><span class="cx">     if (m_codeBlock-&gt;usesEval() &amp;&amp; !m_codeBlock-&gt;isStrictMode())
</span><del>-        emitPushNameScope(functionBodyNode-&gt;ident(), &amp;m_calleeRegister, ReadOnly | DontDelete);
</del><ins>+        emitPushFunctionNameScope(functionBodyNode-&gt;ident(), &amp;m_calleeRegister, ReadOnly | DontDelete);
</ins><span class="cx"> 
</span><span class="cx">     if (!functionBodyNode-&gt;captures(functionBodyNode-&gt;ident()))
</span><span class="cx">         return &amp;m_calleeRegister;
</span><span class="lines">@@ -1642,16 +1622,15 @@
</span><span class="cx"> 
</span><span class="cx"> void BytecodeGenerator::createActivationIfNecessary()
</span><span class="cx"> {
</span><del>-    if (m_hasCreatedActivation)
</del><ins>+    if (!m_activationRegister)
</ins><span class="cx">         return;
</span><del>-    if (!m_codeBlock-&gt;needsFullScopeChain())
-        return;
</del><span class="cx">     emitOpcode(op_create_activation);
</span><span class="cx">     instructions().append(m_activationRegister-&gt;index());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RegisterID* BytecodeGenerator::emitCallEval(RegisterID* dst, RegisterID* func, CallArguments&amp; callArguments, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd)
</span><span class="cx"> {
</span><ins>+    createActivationIfNecessary();
</ins><span class="cx">     return emitCall(op_call_eval, dst, func, NoExpectedFunction, callArguments, divot, divotStart, divotEnd);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1824,7 +1803,7 @@
</span><span class="cx"> 
</span><span class="cx"> RegisterID* BytecodeGenerator::emitReturn(RegisterID* src)
</span><span class="cx"> {
</span><del>-    if (m_codeBlock-&gt;needsFullScopeChain()) {
</del><ins>+    if (m_activationRegister) {
</ins><span class="cx">         emitOpcode(op_tear_off_activation);
</span><span class="cx">         instructions().append(m_activationRegister-&gt;index());
</span><span class="cx">     }
</span><span class="lines">@@ -1932,6 +1911,7 @@
</span><span class="cx">     m_scopeContextStack.append(context);
</span><span class="cx">     m_localScopeDepth++;
</span><span class="cx"> 
</span><ins>+    createActivationIfNecessary();
</ins><span class="cx">     return emitUnaryNoDstOp(op_push_with_scope, scope);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2274,8 +2254,18 @@
</span><span class="cx">     instructions().append(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::emitPushNameScope(const Identifier&amp; property, RegisterID* value, unsigned attributes)
</del><ins>+void BytecodeGenerator::emitPushFunctionNameScope(const Identifier&amp; property, RegisterID* value, unsigned attributes)
</ins><span class="cx"> {
</span><ins>+    emitOpcode(op_push_name_scope);
+    instructions().append(addConstant(property));
+    instructions().append(value-&gt;index());
+    instructions().append(attributes);
+}
+
+void BytecodeGenerator::emitPushCatchScope(const Identifier&amp; property, RegisterID* value, unsigned attributes)
+{
+    createActivationIfNecessary();
+
</ins><span class="cx">     ControlFlowContext context;
</span><span class="cx">     context.isFinallyBlock = false;
</span><span class="cx">     m_scopeContextStack.append(context);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2009, 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2009, 2012, 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008 Cameron Zwarich &lt;cwzwarich@uwaterloo.ca&gt;
</span><span class="cx">  * Copyright (C) 2012 Igalia, S.L.
</span><span class="cx">  *
</span><span class="lines">@@ -425,7 +425,8 @@
</span><span class="cx"> 
</span><span class="cx">         void emitThrowReferenceError(const String&amp; message);
</span><span class="cx"> 
</span><del>-        void emitPushNameScope(const Identifier&amp; property, RegisterID* value, unsigned attributes);
</del><ins>+        void emitPushFunctionNameScope(const Identifier&amp; property, RegisterID* value, unsigned attributes);
+        void emitPushCatchScope(const Identifier&amp; property, RegisterID* value, unsigned attributes);
</ins><span class="cx"> 
</span><span class="cx">         RegisterID* emitPushWithScope(RegisterID* scope);
</span><span class="cx">         void emitPopScope();
</span><span class="lines">@@ -655,7 +656,6 @@
</span><span class="cx"> 
</span><span class="cx">         int m_globalVarStorageOffset;
</span><span class="cx"> 
</span><del>-        bool m_hasCreatedActivation;
</del><span class="cx">         int m_firstLazyFunction;
</span><span class="cx">         int m_lastLazyFunction;
</span><span class="cx">         HashMap&lt;unsigned int, FunctionBodyNode*, WTF::IntHash&lt;unsigned int&gt;, WTF::UnsignedWithZeroKeyHashTraits&lt;unsigned int&gt;&gt; m_lazyFunctions;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerNodesCodegencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -2216,7 +2216,7 @@
</span><span class="cx">             tryData = generator.pushTry(here.get());
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        generator.emitPushNameScope(m_exceptionIdent, exceptionRegister.get(), DontDelete);
</del><ins>+        generator.emitPushCatchScope(m_exceptionIdent, exceptionRegister.get(), DontDelete);
</ins><span class="cx">         generator.emitNode(dst, m_catchBlock);
</span><span class="cx">         generator.emitPopScope();
</span><span class="cx">         generator.emitLabel(catchEndLabel.get());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/Debugger.cpp (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -453,7 +453,8 @@
</span><span class="cx">     TemporaryPausedState pausedState(*this);
</span><span class="cx"> 
</span><span class="cx">     JSValue exception;
</span><del>-    JSValue result = DebuggerCallFrame::evaluateWithCallFrame(m_currentCallFrame, breakpoints[i].condition, exception);
</del><ins>+    DebuggerCallFrame* debuggerCallFrame = currentDebuggerCallFrame();
+    JSValue result = debuggerCallFrame-&gt;evaluate(breakpoints[i].condition, exception);
</ins><span class="cx"> 
</span><span class="cx">     // We can lose the debugger while executing JavaScript.
</span><span class="cx">     if (!m_currentCallFrame)
</span><span class="lines">@@ -621,6 +622,8 @@
</span><span class="cx">     bool pauseNow = m_pauseOnNextStatement;
</span><span class="cx">     pauseNow |= (m_pauseOnCallFrame == m_currentCallFrame);
</span><span class="cx"> 
</span><ins>+    DebuggerCallFrameScope debuggerCallFrameScope(*this);
+
</ins><span class="cx">     intptr_t sourceID = DebuggerCallFrame::sourceIDForCallFrame(m_currentCallFrame);
</span><span class="cx">     TextPosition position = DebuggerCallFrame::positionForCallFrame(m_currentCallFrame);
</span><span class="cx">     pauseNow |= didHitBreakpoint = hasBreakpoint(sourceID, position, &amp;breakpoint);
</span><span class="lines">@@ -628,8 +631,6 @@
</span><span class="cx">     if (!pauseNow)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    DebuggerCallFrameScope debuggerCallFrameScope(*this);
-
</del><span class="cx">     // Make sure we are not going to pause again on breakpoint actions by
</span><span class="cx">     // reseting the pause state before executing any breakpoint actions.
</span><span class="cx">     TemporaryPausedState pausedState(*this);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggerCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,9 +29,11 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;DebuggerCallFrame.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;JSFunction.h&quot;
</del><ins>+#include &quot;CallFrameInlines.h&quot;
</ins><span class="cx"> #include &quot;CodeBlock.h&quot;
</span><span class="cx"> #include &quot;Interpreter.h&quot;
</span><ins>+#include &quot;JSActivation.h&quot;
+#include &quot;JSFunction.h&quot;
</ins><span class="cx"> #include &quot;Operations.h&quot;
</span><span class="cx"> #include &quot;Parser.h&quot;
</span><span class="cx"> #include &quot;StackVisitor.h&quot;
</span><span class="lines">@@ -110,6 +112,14 @@
</span><span class="cx">     ASSERT(isValid());
</span><span class="cx">     if (!isValid())
</span><span class="cx">         return 0;
</span><ins>+
+    CodeBlock* codeBlock = m_callFrame-&gt;codeBlock();
+    if (codeBlock &amp;&amp; codeBlock-&gt;needsActivation() &amp;&amp; !m_callFrame-&gt;hasActivation()) {
+        JSActivation* activation = JSActivation::create(*codeBlock-&gt;vm(), m_callFrame, codeBlock);
+        m_callFrame-&gt;setActivation(activation);
+        m_callFrame-&gt;setScope(activation);
+    }
+
</ins><span class="cx">     return m_callFrame-&gt;scope();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -132,14 +142,10 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Evaluate some JavaScript code in the scope of this frame.
</span><del>-JSValue DebuggerCallFrame::evaluate(const String&amp; script, JSValue&amp; exception) const
</del><ins>+JSValue DebuggerCallFrame::evaluate(const String&amp; script, JSValue&amp; exception)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isValid());
</span><del>-    return evaluateWithCallFrame(m_callFrame, script, exception);
-}
-
-JSValue DebuggerCallFrame::evaluateWithCallFrame(CallFrame* callFrame, const String&amp; script, JSValue&amp; exception)
-{
</del><ins>+    CallFrame* callFrame = m_callFrame;
</ins><span class="cx">     if (!callFrame)
</span><span class="cx">         return jsNull();
</span><span class="cx"> 
</span><span class="lines">@@ -157,7 +163,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSValue thisValue = thisValueForCallFrame(callFrame);
</span><del>-    JSValue result = vm.interpreter-&gt;execute(eval, callFrame, thisValue, callFrame-&gt;scope());
</del><ins>+    JSValue result = vm.interpreter-&gt;execute(eval, callFrame, thisValue, scope());
</ins><span class="cx">     if (vm.exception()) {
</span><span class="cx">         exception = vm.exception();
</span><span class="cx">         vm.clearException();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggerCallFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.h (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.h        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.h        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     JS_EXPORT_PRIVATE String functionName() const;
</span><span class="cx">     JS_EXPORT_PRIVATE Type type() const;
</span><span class="cx">     JS_EXPORT_PRIVATE JSValue thisValue() const;
</span><del>-    JS_EXPORT_PRIVATE JSValue evaluate(const String&amp;, JSValue&amp; exception) const;
</del><ins>+    JSValue evaluate(const String&amp;, JSValue&amp; exception);
</ins><span class="cx"> 
</span><span class="cx">     bool isValid() const { return !!m_callFrame; }
</span><span class="cx">     JS_EXPORT_PRIVATE void invalidate();
</span><span class="lines">@@ -70,7 +70,6 @@
</span><span class="cx">     // The following are only public for the Debugger's use only. They will be
</span><span class="cx">     // made private soon. Other clients should not use these.
</span><span class="cx"> 
</span><del>-    JS_EXPORT_PRIVATE static JSValue evaluateWithCallFrame(CallFrame*, const String&amp; script, JSValue&amp; exception);
</del><span class="cx">     JS_EXPORT_PRIVATE static TextPosition positionForCallFrame(CallFrame*);
</span><span class="cx">     JS_EXPORT_PRIVATE static SourceID sourceIDForCallFrame(CallFrame*);
</span><span class="cx">     static JSValue thisValueForCallFrame(CallFrame*);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -3620,8 +3620,7 @@
</span><span class="cx">         }
</span><span class="cx">         dataLog(
</span><span class="cx">             &quot;: captureCount = &quot;, codeBlock-&gt;symbolTable() ? codeBlock-&gt;symbolTable()-&gt;captureCount() : 0,
</span><del>-            &quot;, needsFullScopeChain = &quot;, codeBlock-&gt;needsFullScopeChain(),
-            &quot;, needsActivation = &quot;, codeBlock-&gt;ownerExecutable()-&gt;needsActivation(),
</del><ins>+            &quot;, needsActivation = &quot;, codeBlock-&gt;needsActivation(),
</ins><span class="cx">             &quot;, isStrictMode = &quot;, codeBlock-&gt;ownerExecutable()-&gt;isStrictMode(), &quot;\n&quot;);
</span><span class="cx">         codeBlock-&gt;baselineVersion()-&gt;dumpBytecode();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGGraphh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGGraph.h (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGGraph.h        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/dfg/DFGGraph.h        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011, 2012, 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -571,11 +571,6 @@
</span><span class="cx">         return MethodOfGettingAValueProfile(valueProfileFor(node));
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    bool needsActivation() const
-    {
-        return m_codeBlock-&gt;needsFullScopeChain() &amp;&amp; m_codeBlock-&gt;codeType() != GlobalCode;
-    }
-    
</del><span class="cx">     bool usesArguments() const
</span><span class="cx">     {
</span><span class="cx">         return m_codeBlock-&gt;usesArguments();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2013 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2008, 2013, 2014 Apple Inc. All Rights Reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;CallFrameInlines.h&quot;
</span><span class="cx"> #include &quot;CodeBlock.h&quot;
</span><span class="cx"> #include &quot;Interpreter.h&quot;
</span><ins>+#include &quot;JSActivation.h&quot;
</ins><span class="cx"> #include &quot;Operations.h&quot;
</span><span class="cx"> #include &quot;VMEntryScope.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -134,4 +135,20 @@
</span><span class="cx">     return vm().entryScope-&gt;globalObject();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSActivation* CallFrame::activation() const
+{
+    CodeBlock* codeBlock = this-&gt;codeBlock();
+    RELEASE_ASSERT(codeBlock-&gt;needsActivation());
+    VirtualRegister activationRegister = codeBlock-&gt;activationRegister();
+    return registers()[activationRegister.offset()].Register::activation();
+}
+
+void CallFrame::setActivation(JSActivation* activation)
+{
+    CodeBlock* codeBlock = this-&gt;codeBlock();
+    RELEASE_ASSERT(codeBlock-&gt;needsActivation());
+    VirtualRegister activationRegister = codeBlock-&gt;activationRegister();
+    registers()[activationRegister.offset()] = activation;
+}
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCallFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/CallFrame.h (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CallFrame.h        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/interpreter/CallFrame.h        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
</span><span class="cx">  *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
</span><del>- *  Copyright (C) 2003, 2007, 2008, 2011, 2013 Apple Inc. All rights reserved.
</del><ins>+ *  Copyright (C) 2003, 2007, 2008, 2011, 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  *  This library is free software; you can redistribute it and/or
</span><span class="cx">  *  modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -50,6 +50,10 @@
</span><span class="cx">             return this[JSStack::ScopeChain].Register::scope();
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        bool hasActivation() const { return !!uncheckedActivation(); }
+        JSActivation* activation() const;
+        inline JSValue uncheckedActivation() const;
+
</ins><span class="cx">         // Global object in which execution began.
</span><span class="cx">         JS_EXPORT_PRIVATE JSGlobalObject* vmEntryGlobalObject();
</span><span class="cx"> 
</span><span class="lines">@@ -108,6 +112,7 @@
</span><span class="cx"> 
</span><span class="cx">         static CallFrame* create(Register* callFrameBase) { return static_cast&lt;CallFrame*&gt;(callFrameBase); }
</span><span class="cx">         Register* registers() { return this; }
</span><ins>+        const Register* registers() const { return this; }
</ins><span class="cx"> 
</span><span class="cx">         CallFrame&amp; operator=(const Register&amp; r) { *static_cast&lt;Register*&gt;(this) = r; return *this; }
</span><span class="cx"> 
</span><span class="lines">@@ -201,6 +206,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 setActivation(JSActivation*);
</ins><span class="cx"> 
</span><span class="cx">         ALWAYS_INLINE void init(CodeBlock* codeBlock, Instruction* vPC, JSScope* scope,
</span><span class="cx">             CallFrame* callerFrame, int argc, JSObject* callee)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCallFrameInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/CallFrameInlines.h (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CallFrameInlines.h        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/interpreter/CallFrameInlines.h        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #define CallFrameInlines_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CallFrame.h&quot;
</span><ins>+#include &quot;CodeBlock.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC  {
</span><span class="cx"> 
</span><span class="lines">@@ -138,6 +139,14 @@
</span><span class="cx">     return Location::decode(locationAsRawBits());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline JSValue CallFrame::uncheckedActivation() const
+{
+    CodeBlock* codeBlock = this-&gt;codeBlock();
+    RELEASE_ASSERT(codeBlock-&gt;needsActivation());
+    VirtualRegister activationRegister = codeBlock-&gt;activationRegister();
+    return registers()[activationRegister.offset()].jsValue();
+}
+
</ins><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><span class="cx"> #endif // CallFrameInlines_h
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Arguments.h&quot;
</span><span class="cx"> #include &quot;BatchedTransitionOptimizer.h&quot;
</span><del>-#include &quot;CallFrame.h&quot;
</del><span class="cx"> #include &quot;CallFrameClosure.h&quot;
</span><span class="cx"> #include &quot;CallFrameInlines.h&quot;
</span><span class="cx"> #include &quot;CodeBlock.h&quot;
</span><span class="lines">@@ -428,7 +427,7 @@
</span><span class="cx"> #if ENABLE(DFG_JIT)
</span><span class="cx">         RELEASE_ASSERT(!visitor-&gt;isInlinedFrame());
</span><span class="cx"> #endif
</span><del>-        activation = callFrame-&gt;uncheckedR(codeBlock-&gt;activationRegister().offset()).jsValue();
</del><ins>+        activation = callFrame-&gt;uncheckedActivation();
</ins><span class="cx">         if (activation)
</span><span class="cx">             jsCast&lt;JSActivation*&gt;(activation)-&gt;tearOff(*scope-&gt;vm());
</span><span class="cx">     }
</span><span class="lines">@@ -712,7 +711,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Unwind the scope chain within the exception handler's call frame.
</span><span class="cx">     int targetScopeDepth = handler-&gt;scopeDepth;
</span><del>-    if (codeBlock-&gt;needsActivation() &amp;&amp; callFrame-&gt;uncheckedR(codeBlock-&gt;activationRegister().offset()).jsValue())
</del><ins>+    if (codeBlock-&gt;needsActivation() &amp;&amp; callFrame-&gt;hasActivation())
</ins><span class="cx">         ++targetScopeDepth;
</span><span class="cx"> 
</span><span class="cx">     JSScope* scope = callFrame-&gt;scope();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -615,8 +615,8 @@
</span><span class="cx"> EncodedJSValue JIT_OPERATION operationCallEval(ExecState* exec, ExecState* execCallee)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(exec-&gt;codeBlock()-&gt;codeType() != FunctionCode
</span><del>-        || !exec-&gt;codeBlock()-&gt;needsFullScopeChain()
-        || exec-&gt;uncheckedR(exec-&gt;codeBlock()-&gt;activationRegister().offset()).jsValue());
</del><ins>+        || !exec-&gt;codeBlock()-&gt;needsActivation()
+        || exec-&gt;hasActivation());
</ins><span class="cx"> 
</span><span class="cx">     execCallee-&gt;setScope(exec-&gt;scope());
</span><span class="cx">     execCallee-&gt;setCodeBlock(0);
</span><span class="lines">@@ -1520,7 +1520,7 @@
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><span class="cx"> 
</span><del>-    ASSERT(exec-&gt;codeBlock()-&gt;needsFullScopeChain());
</del><ins>+    ASSERT(exec-&gt;codeBlock()-&gt;needsActivation());
</ins><span class="cx">     jsCast&lt;JSActivation*&gt;(activationCell)-&gt;tearOff(vm);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -982,9 +982,7 @@
</span><span class="cx"> {
</span><span class="cx">     LLINT_BEGIN();
</span><span class="cx">     CodeBlock* codeBlock = exec-&gt;codeBlock();
</span><del>-    ASSERT(codeBlock-&gt;codeType() != FunctionCode
-           || !codeBlock-&gt;needsFullScopeChain()
-           || exec-&gt;uncheckedR(codeBlock-&gt;activationRegister().offset()).jsValue());
</del><ins>+    ASSERT(codeBlock-&gt;codeType() != FunctionCode || !codeBlock-&gt;needsActivation() || exec-&gt;hasActivation());
</ins><span class="cx"> #if LLINT_SLOW_PATH_TRACING
</span><span class="cx">     dataLogF(&quot;Creating function!\n&quot;);
</span><span class="cx"> #endif
</span><span class="lines">@@ -1210,7 +1208,7 @@
</span><span class="cx"> LLINT_SLOW_PATH_DECL(slow_path_tear_off_activation)
</span><span class="cx"> {
</span><span class="cx">     LLINT_BEGIN();
</span><del>-    ASSERT(exec-&gt;codeBlock()-&gt;needsFullScopeChain());
</del><ins>+    ASSERT(exec-&gt;codeBlock()-&gt;needsActivation());
</ins><span class="cx">     jsCast&lt;JSActivation*&gt;(LLINT_OP(1).jsValue())-&gt;tearOff(vm);
</span><span class="cx">     LLINT_END();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -270,10 +270,7 @@
</span><span class="cx"> {
</span><span class="cx">     BEGIN();
</span><span class="cx">     CodeBlock* codeBlock = exec-&gt;codeBlock();
</span><del>-    ASSERT(
-        codeBlock-&gt;codeType() != FunctionCode
-        || !codeBlock-&gt;needsFullScopeChain()
-        || exec-&gt;uncheckedR(codeBlock-&gt;activationRegister().offset()).jsValue());
</del><ins>+    ASSERT(codeBlock-&gt;codeType() != FunctionCode || !codeBlock-&gt;needsActivation() || exec-&gt;hasActivation());
</ins><span class="cx">     JSValue value = JSFunction::create(vm, codeBlock-&gt;functionDecl(pc[2].u.operand), exec-&gt;scope());
</span><span class="cx">     if (VariableWatchpointSet* set = pc[3].u.watchpointSet)
</span><span class="cx">         set-&gt;notifyWrite(value);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSScope.cpp (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSScope.cpp        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/runtime/JSScope.cpp        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012, 2013 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2012, 2013, 2014 Apple Inc. All Rights Reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -157,4 +157,28 @@
</span><span class="cx">     return op;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const char* resolveModeName(ResolveMode mode)
+{
+    static const char* const names[] = {
+        &quot;ThrowIfNotFound&quot;,
+        &quot;DoNotThrowIfNotFound&quot;
+    };
+    return names[mode];
+}
+
+const char* resolveTypeName(ResolveType type)
+{
+    static const char* const names[] = {
+        &quot;GlobalProperty&quot;,
+        &quot;GlobalVar&quot;,
+        &quot;ClosureVar&quot;,
+        &quot;GlobalPropertyWithVarInjectionChecks&quot;,
+        &quot;GlobalVarWithVarInjectionChecks&quot;,
+        &quot;ClosureVarWithVarInjectionChecks&quot;,
+        &quot;Dynamic&quot;
+    };
+    ASSERT(type &lt; sizeof(names) / sizeof(names[0]));
+    return names[type];
+}
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSScope.h (163222 => 163223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSScope.h        2014-02-01 01:14:47 UTC (rev 163222)
+++ trunk/Source/JavaScriptCore/runtime/JSScope.h        2014-02-01 01:24:39 UTC (rev 163223)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012, 2013 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2012, 2013, 2014 Apple Inc. All Rights Reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -54,6 +54,9 @@
</span><span class="cx">     Dynamic
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+const char* resolveModeName(ResolveMode mode);
+const char* resolveTypeName(ResolveType type);
+
</ins><span class="cx"> inline ResolveType makeType(ResolveType type, bool needsVarInjectionChecks)
</span><span class="cx"> {
</span><span class="cx">     if (!needsVarInjectionChecks)
</span></span></pre>
</div>
</div>

</body>
</html>