<!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>[180514] 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/180514">180514</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2015-02-23 13:54:15 -0800 (Mon, 23 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Scopes should always be created with a previously-created symbol table rather than creating one on the fly
https://bugs.webkit.org/show_bug.cgi?id=141915

Reviewed by Mark Lam.
        
The main effect of this change is that pushing name scopes no longer requires creating symbol
tables on the fly.
        
This also makes it so that JSEnvironmentRecords must always have an a priori symbol table.
        
JSSegmentedVariableObject still does a hack where it creates a blank symbol table on-demand.
This is needed because that's what JSGlobalObject and all of its many subclasses want. That's
harmless; I mainly needed a prior symbol tables for JSEnvironmentRecords anyway.

* bytecode/BytecodeList.json:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitPushFunctionNameScope):
(JSC::BytecodeGenerator::emitPushCatchScope):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArgumentsWithExecState):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_push_name_scope):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_push_name_scope):
* jit/JITOperations.cpp:
(JSC::pushNameScope):
* jit/JITOperations.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter.asm:
* runtime/Executable.cpp:
(JSC::ScriptExecutable::newCodeBlockFor):
* runtime/JSCatchScope.h:
(JSC::JSCatchScope::JSCatchScope):
(JSC::JSCatchScope::create):
* runtime/JSEnvironmentRecord.h:
(JSC::JSEnvironmentRecord::JSEnvironmentRecord):
* runtime/JSFunctionNameScope.h:
(JSC::JSFunctionNameScope::JSFunctionNameScope):
(JSC::JSFunctionNameScope::create):
* runtime/JSNameScope.cpp:
(JSC::JSNameScope::create):
* runtime/JSNameScope.h:
(JSC::JSNameScope::create):
(JSC::JSNameScope::finishCreation):
(JSC::JSNameScope::JSNameScope):
* runtime/JSSegmentedVariableObject.h:
(JSC::JSSegmentedVariableObject::finishCreation):
* runtime/JSSymbolTableObject.h:
(JSC::JSSymbolTableObject::JSSymbolTableObject):
(JSC::JSSymbolTableObject::finishCreation): Deleted.
* runtime/SymbolTable.h:
(JSC::SymbolTable::createNameScopeTable):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeListjson">trunk/Source/JavaScriptCore/bytecode/BytecodeList.json</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitCCallHelpersh">trunk/Source/JavaScriptCore/jit/CCallHelpers.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITh">trunk/Source/JavaScriptCore/jit/JIT.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITInlinesh">trunk/Source/JavaScriptCore/jit/JITInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOpcodescpp">trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOpcodes32_64cpp">trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationsh">trunk/Source/JavaScriptCore/jit/JITOperations.h</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreterasm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExecutablecpp">trunk/Source/JavaScriptCore/runtime/Executable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCatchScopeh">trunk/Source/JavaScriptCore/runtime/JSCatchScope.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSEnvironmentRecordh">trunk/Source/JavaScriptCore/runtime/JSEnvironmentRecord.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSFunctionNameScopeh">trunk/Source/JavaScriptCore/runtime/JSFunctionNameScope.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSNameScopecpp">trunk/Source/JavaScriptCore/runtime/JSNameScope.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSNameScopeh">trunk/Source/JavaScriptCore/runtime/JSNameScope.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSSegmentedVariableObjecth">trunk/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSSymbolTableObjecth">trunk/Source/JavaScriptCore/runtime/JSSymbolTableObject.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSymbolTableh">trunk/Source/JavaScriptCore/runtime/SymbolTable.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -1,5 +1,64 @@
</span><span class="cx"> 2015-02-23  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Scopes should always be created with a previously-created symbol table rather than creating one on the fly
+        https://bugs.webkit.org/show_bug.cgi?id=141915
+
+        Reviewed by Mark Lam.
+        
+        The main effect of this change is that pushing name scopes no longer requires creating symbol
+        tables on the fly.
+        
+        This also makes it so that JSEnvironmentRecords must always have an a priori symbol table.
+        
+        JSSegmentedVariableObject still does a hack where it creates a blank symbol table on-demand.
+        This is needed because that's what JSGlobalObject and all of its many subclasses want. That's
+        harmless; I mainly needed a prior symbol tables for JSEnvironmentRecords anyway.
+
+        * bytecode/BytecodeList.json:
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::emitPushFunctionNameScope):
+        (JSC::BytecodeGenerator::emitPushCatchScope):
+        * jit/CCallHelpers.h:
+        (JSC::CCallHelpers::setupArgumentsWithExecState):
+        * jit/JIT.h:
+        * jit/JITInlines.h:
+        (JSC::JIT::callOperation):
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emit_op_push_name_scope):
+        * jit/JITOpcodes32_64.cpp:
+        (JSC::JIT::emit_op_push_name_scope):
+        * jit/JITOperations.cpp:
+        (JSC::pushNameScope):
+        * jit/JITOperations.h:
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * llint/LowLevelInterpreter.asm:
+        * runtime/Executable.cpp:
+        (JSC::ScriptExecutable::newCodeBlockFor):
+        * runtime/JSCatchScope.h:
+        (JSC::JSCatchScope::JSCatchScope):
+        (JSC::JSCatchScope::create):
+        * runtime/JSEnvironmentRecord.h:
+        (JSC::JSEnvironmentRecord::JSEnvironmentRecord):
+        * runtime/JSFunctionNameScope.h:
+        (JSC::JSFunctionNameScope::JSFunctionNameScope):
+        (JSC::JSFunctionNameScope::create):
+        * runtime/JSNameScope.cpp:
+        (JSC::JSNameScope::create):
+        * runtime/JSNameScope.h:
+        (JSC::JSNameScope::create):
+        (JSC::JSNameScope::finishCreation):
+        (JSC::JSNameScope::JSNameScope):
+        * runtime/JSSegmentedVariableObject.h:
+        (JSC::JSSegmentedVariableObject::finishCreation):
+        * runtime/JSSymbolTableObject.h:
+        (JSC::JSSymbolTableObject::JSSymbolTableObject):
+        (JSC::JSSymbolTableObject::finishCreation): Deleted.
+        * runtime/SymbolTable.h:
+        (JSC::SymbolTable::createNameScopeTable):
+
+2015-02-23  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
</ins><span class="cx">         Add a comment to clarify that the test was taken from the bug report, in response to
</span><span class="cx">         feedback from Michael Saboff and Benjamin Poulain.
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeListjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeList.json (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx">             { &quot;name&quot; : &quot;op_put_to_scope&quot;, &quot;length&quot; : 7 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_push_with_scope&quot;, &quot;length&quot; : 3 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_pop_scope&quot;, &quot;length&quot; : 2 },
</span><del>-            { &quot;name&quot; : &quot;op_push_name_scope&quot;, &quot;length&quot; : 6 },
</del><ins>+            { &quot;name&quot; : &quot;op_push_name_scope&quot;, &quot;length&quot; : 5 },
</ins><span class="cx">             { &quot;name&quot; : &quot;op_catch&quot;, &quot;length&quot; : 2 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_throw&quot;, &quot;length&quot; : 2 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_throw_static_error&quot;, &quot;length&quot; : 3 },
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -2394,9 +2394,8 @@
</span><span class="cx"> {
</span><span class="cx">     emitOpcode(op_push_name_scope);
</span><span class="cx">     instructions().append(dst-&gt;index());
</span><del>-    instructions().append(addConstant(property));
</del><span class="cx">     instructions().append(value-&gt;index());
</span><del>-    instructions().append(attributes);
</del><ins>+    instructions().append(addConstantValue(SymbolTable::createNameScopeTable(*vm(), property, attributes))-&gt;index());
</ins><span class="cx">     instructions().append(JSNameScope::FunctionNameScope);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2409,9 +2408,8 @@
</span><span class="cx"> 
</span><span class="cx">     emitOpcode(op_push_name_scope);
</span><span class="cx">     instructions().append(dst-&gt;index());
</span><del>-    instructions().append(addConstant(property));
</del><span class="cx">     instructions().append(value-&gt;index());
</span><del>-    instructions().append(attributes);
</del><ins>+    instructions().append(addConstantValue(SymbolTable::createNameScopeTable(*vm(), property, attributes))-&gt;index());
</ins><span class="cx">     instructions().append(JSNameScope::CatchScope);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitCCallHelpersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/CCallHelpers.h (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/CCallHelpers.h        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/jit/CCallHelpers.h        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -436,6 +436,16 @@
</span><span class="cx">         addCallArgument(arg5);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm32 arg1, TrustedImmPtr arg2, GPRReg arg3, GPRReg arg4)
+    {
+        resetCallArguments();
+        addCallArgument(GPRInfo::callFrameRegister);
+        addCallArgument(arg1);
+        addCallArgument(arg2);
+        addCallArgument(arg3);
+        addCallArgument(arg4);
+    }
+
</ins><span class="cx">     ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm32 arg1, TrustedImmPtr arg2, GPRReg arg3, GPRReg arg4, TrustedImm32 arg5)
</span><span class="cx">     {
</span><span class="cx">         resetCallArguments();
</span><span class="lines">@@ -1619,6 +1629,12 @@
</span><span class="cx">         setupArgumentsWithExecState(arg1, arg2, arg3);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm32 arg1, TrustedImmPtr arg2, GPRReg arg3, GPRReg arg4)
+    {
+        poke(arg4, POKE_ARGUMENT_OFFSET);
+        setupArgumentsWithExecState(arg1, arg2, arg3);
+    }
+
</ins><span class="cx">     ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm32 arg1, TrustedImmPtr arg2, GPRReg arg3, GPRReg arg4, TrustedImm32 arg5)
</span><span class="cx">     {
</span><span class="cx">         poke(arg5, POKE_ARGUMENT_OFFSET + 1);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JIT.h (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JIT.h        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/jit/JIT.h        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -717,11 +717,7 @@
</span><span class="cx">         MacroAssembler::Call callOperation(V_JITOperation_ECC, RegisterID, RegisterID);
</span><span class="cx">         MacroAssembler::Call callOperation(V_JITOperation_ECICC, RegisterID, const Identifier*, RegisterID, RegisterID);
</span><span class="cx">         MacroAssembler::Call callOperation(J_JITOperation_EE, RegisterID);
</span><del>-#if USE(JSVALUE64)
-        MacroAssembler::Call callOperation(V_JITOperation_EZIdJZZ, int, const Identifier*, RegisterID, int32_t, int32_t);
-#else
-        MacroAssembler::Call callOperation(V_JITOperation_EZIdJZ, int, const Identifier*, RegisterID, int32_t);
-#endif
</del><ins>+        MacroAssembler::Call callOperation(V_JITOperation_EZSymtabJ, int, SymbolTable*, RegisterID);
</ins><span class="cx">         MacroAssembler::Call callOperation(V_JITOperation_EJ, RegisterID);
</span><span class="cx"> #if USE(JSVALUE64)
</span><span class="cx">         MacroAssembler::Call callOperationNoExceptionCheck(V_JITOperation_EJ, RegisterID);
</span><span class="lines">@@ -754,7 +750,7 @@
</span><span class="cx">         MacroAssembler::Call callOperation(P_JITOperation_EJS, GPRReg, GPRReg, size_t);
</span><span class="cx">         MacroAssembler::Call callOperation(S_JITOperation_EJ, RegisterID, RegisterID);
</span><span class="cx">         MacroAssembler::Call callOperation(S_JITOperation_EJJ, RegisterID, RegisterID, RegisterID, RegisterID);
</span><del>-        MacroAssembler::Call callOperation(V_JITOperation_EZIdJZ, int, const Identifier*, RegisterID, RegisterID, int32_t);
</del><ins>+        MacroAssembler::Call callOperation(V_JITOperation_EZSymtabJ, int, SymbolTable*, RegisterID, RegisterID);
</ins><span class="cx">         MacroAssembler::Call callOperation(V_JITOperation_EJ, RegisterID, RegisterID);
</span><span class="cx">         MacroAssembler::Call callOperation(V_JITOperation_EJJJ, RegisterID, RegisterID, RegisterID, RegisterID, RegisterID, RegisterID);
</span><span class="cx">         MacroAssembler::Call callOperation(V_JITOperation_EJZ, RegisterID, RegisterID, int32_t);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITInlines.h (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITInlines.h        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/jit/JITInlines.h        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2012, 2013, 2015 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">@@ -460,9 +460,9 @@
</span><span class="cx">     return appendCallWithExceptionCheck(operation);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EZIdJZZ operation, int op1, const Identifier* identOp2, RegisterID regOp3, int32_t op4, int32_t op5)
</del><ins>+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EZSymtabJ operation, int op1, SymbolTable* symbolTable, RegisterID regOp3)
</ins><span class="cx"> {
</span><del>-    setupArgumentsWithExecState(TrustedImm32(op1), TrustedImmPtr(identOp2), regOp3, TrustedImm32(op4), TrustedImm32(op5));
</del><ins>+    setupArgumentsWithExecState(TrustedImm32(op1), TrustedImmPtr(symbolTable), regOp3);
</ins><span class="cx">     return appendCallWithExceptionCheck(operation);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -594,9 +594,9 @@
</span><span class="cx">     return appendCallWithExceptionCheck(operation);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EZIdJZ operation, int32_t op1, const Identifier* identOp2, RegisterID regOp3Tag, RegisterID regOp3Payload, int32_t op4)
</del><ins>+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EZSymtabJ operation, int32_t op1, SymbolTable* symbolTable, RegisterID regOp3Tag, RegisterID regOp3Payload)
</ins><span class="cx"> {
</span><del>-    setupArgumentsWithExecState(TrustedImm32(op1), TrustedImmPtr(identOp2), EABI_32BIT_DUMMY_ARG regOp3Payload, regOp3Tag, TrustedImm32(op4));
</del><ins>+    setupArgumentsWithExecState(TrustedImm32(op1), TrustedImmPtr(symbolTable), EABI_32BIT_DUMMY_ARG regOp3Payload, regOp3Tag);
</ins><span class="cx">     return appendCallWithExceptionCheck(operation);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOpcodescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include &quot;JSArray.h&quot;
</span><span class="cx"> #include &quot;JSCell.h&quot;
</span><span class="cx"> #include &quot;JSFunction.h&quot;
</span><ins>+#include &quot;JSNameScope.h&quot;
</ins><span class="cx"> #include &quot;JSPropertyNameEnumerator.h&quot;
</span><span class="cx"> #include &quot;LinkBuffer.h&quot;
</span><span class="cx"> #include &quot;MaxFrameExtentForSlowPathCall.h&quot;
</span><span class="lines">@@ -486,8 +487,14 @@
</span><span class="cx"> void JIT::emit_op_push_name_scope(Instruction* currentInstruction)
</span><span class="cx"> {
</span><span class="cx">     int dst = currentInstruction[1].u.operand;
</span><del>-    emitGetVirtualRegister(currentInstruction[3].u.operand, regT0);
-    callOperation(operationPushNameScope, dst, &amp;m_codeBlock-&gt;identifier(currentInstruction[2].u.operand), regT0, currentInstruction[4].u.operand, currentInstruction[5].u.operand);
</del><ins>+    emitGetVirtualRegister(currentInstruction[2].u.operand, regT0);
+    if (currentInstruction[4].u.operand == JSNameScope::CatchScope) {
+        callOperation(operationPushCatchScope, dst, jsCast&lt;SymbolTable*&gt;(getConstantOperand(currentInstruction[3].u.operand)), regT0);
+        return;
+    }
+
+    RELEASE_ASSERT(currentInstruction[4].u.operand == JSNameScope::FunctionNameScope);
+    callOperation(operationPushFunctionNameScope, dst, jsCast&lt;SymbolTable*&gt;(getConstantOperand(currentInstruction[3].u.operand)), regT0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JIT::emit_op_catch(Instruction* currentInstruction)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOpcodes32_64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -779,14 +779,14 @@
</span><span class="cx"> void JIT::emit_op_push_name_scope(Instruction* currentInstruction)
</span><span class="cx"> {
</span><span class="cx">     int dst = currentInstruction[1].u.operand;
</span><del>-    emitLoad(currentInstruction[3].u.operand, regT1, regT0);
-    if (currentInstruction[5].u.operand == JSNameScope::CatchScope) {
-        callOperation(operationPushCatchScope, dst, &amp;m_codeBlock-&gt;identifier(currentInstruction[2].u.operand), regT1, regT0, currentInstruction[4].u.operand);
</del><ins>+    emitLoad(currentInstruction[2].u.operand, regT1, regT0);
+    if (currentInstruction[4].u.operand == JSNameScope::CatchScope) {
+        callOperation(operationPushCatchScope, dst, jsCast&lt;SymbolTable*&gt;(getConstantOperand(currentInstruction[3].u.operand)), regT1, regT0);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RELEASE_ASSERT(currentInstruction[5].u.operand == JSNameScope::FunctionNameScope);
-    callOperation(operationPushFunctionNameScope, dst, &amp;m_codeBlock-&gt;identifier(currentInstruction[2].u.operand), regT1, regT0, currentInstruction[4].u.operand);
</del><ins>+    RELEASE_ASSERT(currentInstruction[4].u.operand == JSNameScope::FunctionNameScope);
+    callOperation(operationPushFunctionNameScope, dst, jsCast&lt;SymbolTable*&gt;(getConstantOperand(currentInstruction[3].u.operand)), regT1, regT0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JIT::emit_op_catch(Instruction* currentInstruction)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -44,6 +44,8 @@
</span><span class="cx"> #include &quot;JIT.h&quot;
</span><span class="cx"> #include &quot;JITToDFGDeferredCompilationCallback.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><ins>+#include &quot;JSCatchScope.h&quot;
+#include &quot;JSFunctionNameScope.h&quot;
</ins><span class="cx"> #include &quot;JSGlobalObjectFunctions.h&quot;
</span><span class="cx"> #include &quot;JSNameScope.h&quot;
</span><span class="cx"> #include &quot;JSPropertyNameEnumerator.h&quot;
</span><span class="lines">@@ -59,6 +61,24 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><ins>+template&lt;typename ScopeType&gt;
+void pushNameScope(ExecState* exec, int32_t dst, SymbolTable* symbolTable, EncodedJSValue encodedValue)
+{
+    VM&amp; vm = exec-&gt;vm();
+    NativeCallFrameTracer tracer(&amp;vm, exec);
+    
+    ASSERT(!JITCode::isOptimizingJIT(exec-&gt;codeBlock()-&gt;jitType()));
+
+    // 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();
+    JSNameScope* scope = ScopeType::create(vm, exec-&gt;lexicalGlobalObject(), currentScope, symbolTable, JSValue::decode(encodedValue));
+
+    // FIXME: This won't work if this operation is called from the DFG or FTL.
+    // This should be changed to return the new scope.
+    exec-&gt;uncheckedR(dst) = scope;
+}
+
</ins><span class="cx"> extern &quot;C&quot; {
</span><span class="cx"> 
</span><span class="cx"> #if COMPILER(MSVC)
</span><span class="lines">@@ -1269,34 +1289,16 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void JIT_OPERATION operationPushNameScope(ExecState* exec, int32_t dst, Identifier* identifier, EncodedJSValue encodedValue, int32_t attibutes, int32_t type)
</del><ins>+void JIT_OPERATION operationPushCatchScope(ExecState* exec, int32_t dst, SymbolTable* symbolTable, EncodedJSValue encodedValue)
</ins><span class="cx"> {
</span><del>-    VM&amp; vm = exec-&gt;vm();
-    NativeCallFrameTracer tracer(&amp;vm, exec);
-
-    // 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();
-    JSNameScope::Type scopeType = static_cast&lt;JSNameScope::Type&gt;(type);
-    JSNameScope* scope = JSNameScope::create(vm, exec-&gt;lexicalGlobalObject(), currentScope, *identifier, JSValue::decode(encodedValue), attibutes, scopeType);
-
-    // FIXME: This won't work if this operation is called from the DFG or FTL.
-    // This should be changed to return the new scope.
-    exec-&gt;uncheckedR(dst) = scope;
</del><ins>+    pushNameScope&lt;JSCatchScope&gt;(exec, dst, symbolTable, encodedValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if USE(JSVALUE32_64)
-void JIT_OPERATION operationPushCatchScope(ExecState* exec, int32_t dst, Identifier* identifier, EncodedJSValue encodedValue, int32_t attibutes)
</del><ins>+void JIT_OPERATION operationPushFunctionNameScope(ExecState* exec, int32_t dst, SymbolTable* symbolTable, EncodedJSValue encodedValue)
</ins><span class="cx"> {
</span><del>-    operationPushNameScope(exec, dst, identifier, encodedValue, attibutes, JSNameScope::CatchScope);
</del><ins>+    pushNameScope&lt;JSFunctionNameScope&gt;(exec, dst, symbolTable, encodedValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void JIT_OPERATION operationPushFunctionNameScope(ExecState* exec, int32_t dst, Identifier* identifier, EncodedJSValue encodedValue, int32_t attibutes)
-{
-    operationPushNameScope(exec, dst, identifier, encodedValue, attibutes, JSNameScope::FunctionNameScope);
-}
-#endif
-
</del><span class="cx"> void JIT_OPERATION operationPushWithScope(ExecState* exec, int32_t dst, EncodedJSValue encodedValue)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.h (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.h        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.h        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2015 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">@@ -81,6 +81,7 @@
</span><span class="cx">     Sprt: SlowPathReturnType
</span><span class="cx">     Ssi: StructureStubInfo*
</span><span class="cx">     St: Structure*
</span><ins>+    Symtab: SymbolTable*
</ins><span class="cx">     V: void
</span><span class="cx">     Vm: VM*
</span><span class="cx">     Vws: VariableWatchpointSet*
</span><span class="lines">@@ -170,11 +171,7 @@
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_ECPSPS)(ExecState*, JSCell*, void*, size_t, void*, size_t);
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_ECZ)(ExecState*, JSCell*, int32_t);
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_ECC)(ExecState*, JSCell*, JSCell*);
</span><del>-#if USE(JSVALUE64)
-typedef void JIT_OPERATION (*V_JITOperation_EZIdJZZ)(ExecState*, int, Identifier*, EncodedJSValue, int32_t, int32_t);
-#else
-typedef void JIT_OPERATION (*V_JITOperation_EZIdJZ)(ExecState*, int, Identifier*, EncodedJSValue, int32_t);
-#endif
</del><ins>+typedef void JIT_OPERATION (*V_JITOperation_EZSymtabJ)(ExecState*, int32_t, SymbolTable*, EncodedJSValue);
</ins><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_EJ)(ExecState*, EncodedJSValue);
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_EJCI)(ExecState*, EncodedJSValue, JSCell*, StringImpl*);
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_EJIdJJ)(ExecState*, EncodedJSValue, Identifier*, EncodedJSValue, EncodedJSValue);
</span><span class="lines">@@ -288,10 +285,9 @@
</span><span class="cx"> void JIT_OPERATION operationPutGetterSetter(ExecState*, EncodedJSValue, Identifier*, EncodedJSValue, EncodedJSValue) WTF_INTERNAL;
</span><span class="cx"> #else
</span><span class="cx"> void JIT_OPERATION operationPutGetterSetter(ExecState*, JSCell*, Identifier*, JSCell*, JSCell*) WTF_INTERNAL;
</span><del>-void JIT_OPERATION operationPushCatchScope(ExecState*, int32_t, Identifier*, EncodedJSValue, int32_t) WTF_INTERNAL;
-void JIT_OPERATION operationPushFunctionNameScope(ExecState*, int32_t, Identifier*, EncodedJSValue, int32_t) WTF_INTERNAL;
</del><span class="cx"> #endif
</span><del>-void JIT_OPERATION operationPushNameScope(ExecState*, int32_t, Identifier*, EncodedJSValue, int32_t, int32_t) WTF_INTERNAL;
</del><ins>+void JIT_OPERATION operationPushCatchScope(ExecState*, int32_t, SymbolTable*, EncodedJSValue) WTF_INTERNAL;
+void JIT_OPERATION operationPushFunctionNameScope(ExecState*, int32_t, SymbolTable*, EncodedJSValue) WTF_INTERNAL;
</ins><span class="cx"> void JIT_OPERATION operationPushWithScope(ExecState*, int32_t, EncodedJSValue) WTF_INTERNAL;
</span><span class="cx"> void JIT_OPERATION operationPopScope(ExecState*, int32_t) WTF_INTERNAL;
</span><span class="cx"> void JIT_OPERATION operationProfileDidCall(ExecState*, EncodedJSValue) WTF_INTERNAL;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -1286,11 +1286,12 @@
</span><span class="cx"> LLINT_SLOW_PATH_DECL(slow_path_push_name_scope)
</span><span class="cx"> {
</span><span class="cx">     LLINT_BEGIN();
</span><del>-    CodeBlock* codeBlock = exec-&gt;codeBlock();
</del><span class="cx">     int scopeReg = pc[1].u.operand;
</span><span class="cx">     JSScope* currentScope = exec-&gt;uncheckedR(scopeReg).Register::scope();
</span><del>-    JSNameScope::Type type = static_cast&lt;JSNameScope::Type&gt;(pc[5].u.operand);
-    JSNameScope* scope = JSNameScope::create(vm, exec-&gt;lexicalGlobalObject(), currentScope, codeBlock-&gt;identifier(pc[2].u.operand), LLINT_OP(3).jsValue(), pc[4].u.operand, type);
</del><ins>+    JSValue value = LLINT_OP_C(2).jsValue();
+    SymbolTable* symbolTable = jsCast&lt;SymbolTable*&gt;(LLINT_OP_C(3).jsValue());
+    JSNameScope::Type type = static_cast&lt;JSNameScope::Type&gt;(pc[4].u.operand);
+    JSNameScope* scope = JSNameScope::create(vm, exec-&gt;lexicalGlobalObject(), currentScope, symbolTable, value, type);
</ins><span class="cx">     exec-&gt;uncheckedR(scopeReg) = scope;
</span><span class="cx">     LLINT_END();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -1256,7 +1256,7 @@
</span><span class="cx"> _llint_op_push_name_scope:
</span><span class="cx">     traceExecution()
</span><span class="cx">     callSlowPath(_llint_slow_path_push_name_scope)
</span><del>-    dispatch(6)
</del><ins>+    dispatch(5)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> _llint_op_throw:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Executable.cpp (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Executable.cpp        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/runtime/Executable.cpp        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -253,8 +253,10 @@
</span><span class="cx">         // We shouldn't have to do this. But we do, because bytecode linking requires a real scope
</span><span class="cx">         // chain.
</span><span class="cx">         // FIXME: https://bugs.webkit.org/show_bug.cgi?id=141885
</span><ins>+        SymbolTable* symbolTable =
+            SymbolTable::createNameScopeTable(*vm, executable-&gt;name(), ReadOnly | DontDelete);
</ins><span class="cx">         scope = JSFunctionNameScope::create(
</span><del>-            *vm, scope-&gt;globalObject(), scope, executable-&gt;name(), function, ReadOnly | DontDelete);
</del><ins>+            *vm, scope-&gt;globalObject(), scope, symbolTable, function);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     SourceProvider* provider = executable-&gt;source().provider();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCatchScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCatchScope.h (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCatchScope.h        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/runtime/JSCatchScope.h        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -37,15 +37,15 @@
</span><span class="cx"> private:
</span><span class="cx">     friend class JSNameScope;
</span><span class="cx">     
</span><del>-    JSCatchScope(VM&amp; vm, JSGlobalObject* globalObject, JSScope* next)
-        : Base(vm, globalObject-&gt;catchScopeStructure(), next)
</del><ins>+    JSCatchScope(VM&amp; vm, JSGlobalObject* globalObject, JSScope* next, SymbolTable* symbolTable)
+        : Base(vm, globalObject-&gt;catchScopeStructure(), next, symbolTable)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx"> public:
</span><del>-    static JSCatchScope* create(VM&amp; vm, JSGlobalObject* globalObject, JSScope* currentScope, const Identifier&amp; identifier, JSValue value, unsigned attributes)
</del><ins>+    static JSCatchScope* create(VM&amp; vm, JSGlobalObject* globalObject, JSScope* currentScope, SymbolTable* symbolTable, JSValue value)
</ins><span class="cx">     {
</span><del>-        return Base::create&lt;JSCatchScope&gt;(vm, globalObject, currentScope, identifier, value, attributes);
</del><ins>+        return Base::create&lt;JSCatchScope&gt;(vm, globalObject, currentScope, symbolTable, value);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     static Structure* createStructure(VM&amp; vm, JSGlobalObject* globalObject, JSValue proto)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSEnvironmentRecordh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSEnvironmentRecord.h (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSEnvironmentRecord.h        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/runtime/JSEnvironmentRecord.h        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007, 2008, 2012, 2015 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">         Structure* structure,
</span><span class="cx">         Register* registers,
</span><span class="cx">         JSScope* scope,
</span><del>-        SymbolTable* symbolTable = 0)
</del><ins>+        SymbolTable* symbolTable)
</ins><span class="cx">         : Base(vm, structure, scope, symbolTable)
</span><span class="cx">         , m_registers(reinterpret_cast&lt;WriteBarrierBase&lt;Unknown&gt;*&gt;(registers))
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSFunctionNameScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSFunctionNameScope.h (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSFunctionNameScope.h        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/runtime/JSFunctionNameScope.h        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -37,15 +37,15 @@
</span><span class="cx"> private:
</span><span class="cx">     friend class JSNameScope;
</span><span class="cx">     
</span><del>-    JSFunctionNameScope(VM&amp; vm, JSGlobalObject* globalObject, JSScope* next)
-        : Base(vm, globalObject-&gt;catchScopeStructure(), next)
</del><ins>+    JSFunctionNameScope(VM&amp; vm, JSGlobalObject* globalObject, JSScope* next, SymbolTable* symbolTable)
+        : Base(vm, globalObject-&gt;catchScopeStructure(), next, symbolTable)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx"> public:
</span><del>-    static JSFunctionNameScope* create(VM&amp; vm, JSGlobalObject* globalObject, JSScope* currentScope, const Identifier&amp; identifier, JSValue value, unsigned attributes)
</del><ins>+    static JSFunctionNameScope* create(VM&amp; vm, JSGlobalObject* globalObject, JSScope* currentScope, SymbolTable* symbolTable, JSValue value)
</ins><span class="cx">     {
</span><del>-        return Base::create&lt;JSFunctionNameScope&gt;(vm, globalObject, currentScope, identifier, value, attributes);
</del><ins>+        return Base::create&lt;JSFunctionNameScope&gt;(vm, globalObject, currentScope, symbolTable, value);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     static Structure* createStructure(VM&amp; vm, JSGlobalObject* globalObject, JSValue proto)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSNameScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSNameScope.cpp (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSNameScope.cpp        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/runtime/JSNameScope.cpp        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -35,13 +35,13 @@
</span><span class="cx"> 
</span><span class="cx"> const ClassInfo JSNameScope::s_info = { &quot;NameScope&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSNameScope) };
</span><span class="cx"> 
</span><del>-JSNameScope* JSNameScope::create(VM&amp; vm, JSGlobalObject* globalObject, JSScope* currentScope, const Identifier&amp; identifier, JSValue value, unsigned attributes, Type type)
</del><ins>+JSNameScope* JSNameScope::create(VM&amp; vm, JSGlobalObject* globalObject, JSScope* currentScope, SymbolTable* symbolTable, JSValue value, Type type)
</ins><span class="cx"> {
</span><span class="cx">     switch (type) {
</span><span class="cx">     case CatchScope:
</span><del>-        return JSCatchScope::create(vm, globalObject, currentScope, identifier, value, attributes);
</del><ins>+        return JSCatchScope::create(vm, globalObject, currentScope, symbolTable, value);
</ins><span class="cx">     case FunctionNameScope:
</span><del>-        return JSFunctionNameScope::create(vm, globalObject, currentScope, identifier, value, attributes);
</del><ins>+        return JSFunctionNameScope::create(vm, globalObject, currentScope, symbolTable, value);
</ins><span class="cx">     }
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx">     return nullptr;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSNameScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSNameScope.h (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSNameScope.h        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/runtime/JSNameScope.h        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -42,14 +42,14 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     template&lt;typename T&gt;
</span><del>-    static T* create(VM&amp; vm, JSGlobalObject* globalObject, JSScope* currentScope, const Identifier&amp; identifier, JSValue value, unsigned attributes)
</del><ins>+    static T* create(VM&amp; vm, JSGlobalObject* globalObject, JSScope* currentScope, SymbolTable* symbolTable, JSValue value)
</ins><span class="cx">     {
</span><del>-        T* scopeObject = new (NotNull, allocateCell&lt;T&gt;(vm.heap)) T(vm, globalObject, currentScope);
-        scopeObject-&gt;finishCreation(vm, identifier, value, attributes);
</del><ins>+        T* scopeObject = new (NotNull, allocateCell&lt;T&gt;(vm.heap)) T(vm, globalObject, currentScope, symbolTable);
+        scopeObject-&gt;finishCreation(vm, value);
</ins><span class="cx">         return scopeObject;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    static JSNameScope* create(VM&amp;, JSGlobalObject*, JSScope* currentScope, const Identifier&amp;, JSValue, unsigned attributes, Type);
</del><ins>+    static JSNameScope* create(VM&amp;, JSGlobalObject*, JSScope* currentScope, SymbolTable*, JSValue, Type);
</ins><span class="cx"> 
</span><span class="cx">     static void visitChildren(JSCell*, SlotVisitor&amp;);
</span><span class="cx">     static JSValue toThis(JSCell*, ExecState*, ECMAMode);
</span><span class="lines">@@ -61,22 +61,16 @@
</span><span class="cx">     JSValue value() const { return m_registerStore.get(); }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    void finishCreation(VM&amp; vm, const Identifier&amp; identifier, JSValue value, unsigned attributes)
</del><ins>+    void finishCreation(VM&amp; vm, JSValue value)
</ins><span class="cx">     {
</span><span class="cx">         Base::finishCreation(vm);
</span><span class="cx">         m_registerStore.set(vm, this, value);
</span><del>-        symbolTable()-&gt;add(identifier.impl(), SymbolTableEntry(-1, attributes));
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static const unsigned StructureFlags = OverridesGetOwnPropertySlot | Base::StructureFlags;
</span><span class="cx"> 
</span><del>-    JSNameScope(VM&amp; vm, Structure* structure, JSScope* next)
-        : Base(
-            vm,
-            structure,
-            reinterpret_cast&lt;Register*&gt;(&amp;m_registerStore + 1),
-            next
-        )
</del><ins>+    JSNameScope(VM&amp; vm, Structure* structure, JSScope* next, SymbolTable* symbolTable)
+        : Base(vm, structure, reinterpret_cast&lt;Register*&gt;(&amp;m_registerStore + 1), next, symbolTable)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSSegmentedVariableObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h        2015-02-23 21:54:15 UTC (rev 180514)
</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, 2015 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">@@ -87,6 +87,7 @@
</span><span class="cx">     void finishCreation(VM&amp; vm)
</span><span class="cx">     {
</span><span class="cx">         Base::finishCreation(vm);
</span><ins>+        m_symbolTable.set(vm, this, SymbolTable::create(vm));
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     SegmentedVector&lt;WriteBarrier&lt;Unknown&gt;, 16&gt; m_registers;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSSymbolTableObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSSymbolTableObject.h (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSSymbolTableObject.h        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/runtime/JSSymbolTableObject.h        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012, 2014, 2015 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">@@ -50,18 +50,16 @@
</span><span class="cx"> protected:
</span><span class="cx">     static const unsigned StructureFlags = IsEnvironmentRecord | OverridesGetPropertyNames | Base::StructureFlags;
</span><span class="cx">     
</span><del>-    JSSymbolTableObject(VM&amp; vm, Structure* structure, JSScope* scope, SymbolTable* symbolTable = 0)
</del><ins>+    JSSymbolTableObject(VM&amp; vm, Structure* structure, JSScope* scope)
</ins><span class="cx">         : Base(vm, structure, scope)
</span><span class="cx">     {
</span><del>-        if (symbolTable)
-            m_symbolTable.set(vm, this, symbolTable);
</del><span class="cx">     }
</span><del>-
-    void finishCreation(VM&amp; vm)
</del><ins>+    
+    JSSymbolTableObject(VM&amp; vm, Structure* structure, JSScope* scope, SymbolTable* symbolTable)
+        : Base(vm, structure, scope)
</ins><span class="cx">     {
</span><del>-        Base::finishCreation(vm);
-        if (!m_symbolTable)
-            m_symbolTable.set(vm, this, SymbolTable::create(vm));
</del><ins>+        ASSERT(symbolTable);
+        m_symbolTable.set(vm, this, symbolTable);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static void visitChildren(JSCell*, SlotVisitor&amp;);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSymbolTableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SymbolTable.h (180513 => 180514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SymbolTable.h        2015-02-23 21:26:15 UTC (rev 180513)
+++ trunk/Source/JavaScriptCore/runtime/SymbolTable.h        2015-02-23 21:54:15 UTC (rev 180514)
</span><span class="lines">@@ -347,6 +347,14 @@
</span><span class="cx">         symbolTable-&gt;finishCreation(vm);
</span><span class="cx">         return symbolTable;
</span><span class="cx">     }
</span><ins>+    
+    static SymbolTable* createNameScopeTable(VM&amp; vm, const Identifier&amp; ident, unsigned attributes)
+    {
+        SymbolTable* result = create(vm);
+        result-&gt;add(ident.impl(), SymbolTableEntry(-1, attributes));
+        return result;
+    }
+    
</ins><span class="cx">     static const bool needsDestruction = true;
</span><span class="cx">     static const bool hasImmortalStructure = true;
</span><span class="cx">     static void destroy(JSCell*);
</span></span></pre>
</div>
</div>

</body>
</html>