<!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>[183789] 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/183789">183789</a></dd>
<dt>Author</dt> <dd>saambarati1@gmail.com</dd>
<dt>Date</dt> <dd>2015-05-04 20:27:09 -0700 (Mon, 04 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Global functions should be initialized as JSFunctions in byte code
https://bugs.webkit.org/show_bug.cgi?id=144178

Reviewed by Geoffrey Garen.

This patch makes the initialization of global functions more explicit by
moving initialization into bytecode. It also prepares JSC for having ES6
style lexical scoping because initializing global functions in bytecode
easily allows global functions to be initialized with the proper scope that
will have access to global lexical variables. Global lexical variables
should be visible to global functions but don't live on the global object.

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedProgramCodeBlock::visitChildren):
* bytecode/UnlinkedCodeBlock.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate):
(JSC::BytecodeGenerator::BytecodeGenerator):
* bytecompiler/BytecodeGenerator.h:
* runtime/Executable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::addGlobalVar):
(JSC::JSGlobalObject::addFunction):
* runtime/JSGlobalObject.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockcpp">trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp</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="#trunkSourceJavaScriptCoreruntimeExecutablecpp">trunk/Source/JavaScriptCore/runtime/Executable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjecth">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (183788 => 183789)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-05-05 03:22:35 UTC (rev 183788)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-05-05 03:27:09 UTC (rev 183789)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2015-05-04  Saam Barati  &lt;saambarati1@gmail.com&gt;
+
+        Global functions should be initialized as JSFunctions in byte code
+        https://bugs.webkit.org/show_bug.cgi?id=144178
+
+        Reviewed by Geoffrey Garen.
+
+        This patch makes the initialization of global functions more explicit by
+        moving initialization into bytecode. It also prepares JSC for having ES6
+        style lexical scoping because initializing global functions in bytecode
+        easily allows global functions to be initialized with the proper scope that
+        will have access to global lexical variables. Global lexical variables
+        should be visible to global functions but don't live on the global object.
+
+        * bytecode/UnlinkedCodeBlock.cpp:
+        (JSC::UnlinkedProgramCodeBlock::visitChildren):
+        * bytecode/UnlinkedCodeBlock.h:
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::generate):
+        (JSC::BytecodeGenerator::BytecodeGenerator):
+        * bytecompiler/BytecodeGenerator.h:
+        * runtime/Executable.cpp:
+        (JSC::ProgramExecutable::initializeGlobalProperties):
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::addGlobalVar):
+        (JSC::JSGlobalObject::addFunction):
+        * runtime/JSGlobalObject.h:
+
</ins><span class="cx"> 2015-05-04  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Large array shouldn't be slow
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp (183788 => 183789)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp        2015-05-05 03:22:35 UTC (rev 183788)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp        2015-05-05 03:27:09 UTC (rev 183789)
</span><span class="lines">@@ -471,8 +471,6 @@
</span><span class="cx">     UnlinkedProgramCodeBlock* thisObject = jsCast&lt;UnlinkedProgramCodeBlock*&gt;(cell);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
</span><span class="cx">     Base::visitChildren(thisObject, visitor);
</span><del>-    for (size_t i = 0, end = thisObject-&gt;m_functionDeclarations.size(); i != end; i++)
-        visitor.append(&amp;thisObject-&gt;m_functionDeclarations[i].second);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> UnlinkedCodeBlock::~UnlinkedCodeBlock()
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h (183788 => 183789)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2015-05-05 03:22:35 UTC (rev 183788)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2015-05-05 03:27:09 UTC (rev 183789)
</span><span class="lines">@@ -654,21 +654,14 @@
</span><span class="cx"> 
</span><span class="cx">     static void destroy(JSCell*);
</span><span class="cx"> 
</span><del>-    void addFunctionDeclaration(VM&amp; vm, const Identifier&amp; name, UnlinkedFunctionExecutable* functionExecutable)
-    {
-        m_functionDeclarations.append(std::make_pair(name, WriteBarrier&lt;UnlinkedFunctionExecutable&gt;(vm, this, functionExecutable)));
-    }
-
</del><span class="cx">     void addVariableDeclaration(const Identifier&amp; name, bool isConstant)
</span><span class="cx">     {
</span><span class="cx">         m_varDeclarations.append(std::make_pair(name, isConstant));
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     typedef Vector&lt;std::pair&lt;Identifier, bool&gt;&gt; VariableDeclations;
</span><del>-    typedef Vector&lt;std::pair&lt;Identifier, WriteBarrier&lt;UnlinkedFunctionExecutable&gt;&gt; &gt; FunctionDeclations;
</del><span class="cx"> 
</span><span class="cx">     const VariableDeclations&amp; variableDeclarations() const { return m_varDeclarations; }
</span><del>-    const FunctionDeclations&amp; functionDeclarations() const { return m_functionDeclarations; }
</del><span class="cx"> 
</span><span class="cx">     static void visitChildren(JSCell*, SlotVisitor&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -679,7 +672,6 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     VariableDeclations m_varDeclarations;
</span><del>-    FunctionDeclations m_functionDeclarations;
</del><span class="cx"> 
</span><span class="cx"> public:
</span><span class="cx">     static Structure* createStructure(VM&amp; vm, JSGlobalObject* globalObject, JSValue proto)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (183788 => 183789)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-05-05 03:22:35 UTC (rev 183788)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-05-05 03:27:09 UTC (rev 183789)
</span><span class="lines">@@ -77,9 +77,17 @@
</span><span class="cx"> 
</span><span class="cx">     {
</span><span class="cx">         RefPtr&lt;RegisterID&gt; temp = newTemporary();
</span><del>-        for (FunctionBodyNode* functionBody : m_functionsToInitialize) {
</del><ins>+        RefPtr&lt;RegisterID&gt; globalScope = scopeRegister(); // FIXME: With lexical scoping, this won't always be the global object: https://bugs.webkit.org/show_bug.cgi?id=142944 
+        for (auto functionPair : m_functionsToInitialize) {
+            FunctionBodyNode* functionBody = functionPair.first;
+            FunctionVariableType functionType = functionPair.second;
</ins><span class="cx">             emitNewFunction(temp.get(), functionBody);
</span><del>-            initializeVariable(variable(functionBody-&gt;ident()), temp.get());
</del><ins>+            if (functionType == NormalFunctionVariable)
+                initializeVariable(variable(functionBody-&gt;ident()) , temp.get());
+            else if (functionType == GlobalFunctionVariable)
+                emitPutToScope(globalScope.get(), Variable(functionBody-&gt;ident()), temp.get(), ThrowIfNotFound);
+            else
+                RELEASE_ASSERT_NOT_REACHED();
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -163,8 +171,7 @@
</span><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; functionStack.size(); ++i) {
</span><span class="cx">         FunctionBodyNode* function = functionStack[i];
</span><del>-        UnlinkedFunctionExecutable* unlinkedFunction = makeFunction(function);
-        codeBlock-&gt;addFunctionDeclaration(*m_vm, function-&gt;ident(), unlinkedFunction);
</del><ins>+        m_functionsToInitialize.append(std::make_pair(function, GlobalFunctionVariable));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; varStack.size(); ++i)
</span><span class="lines">@@ -384,7 +391,7 @@
</span><span class="cx">     for (FunctionBodyNode* function : functionNode-&gt;functionStack()) {
</span><span class="cx">         const Identifier&amp; ident = function-&gt;ident();
</span><span class="cx">         createVariable(ident, varKind(ident.impl()), IsVariable);
</span><del>-        m_functionsToInitialize.append(function);
</del><ins>+        m_functionsToInitialize.append(std::make_pair(function, NormalFunctionVariable));
</ins><span class="cx">     }
</span><span class="cx">     for (auto&amp; entry : functionNode-&gt;varStack()) {
</span><span class="cx">         ConstantMode constantMode = modeForIsConstant(entry.second &amp; DeclarationStacks::IsConstant);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (183788 => 183789)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-05-05 03:22:35 UTC (rev 183788)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-05-05 03:27:09 UTC (rev 183789)
</span><span class="lines">@@ -744,7 +744,8 @@
</span><span class="cx">         Vector&lt;std::unique_ptr&lt;ForInContext&gt;&gt; m_forInContextStack;
</span><span class="cx">         Vector&lt;TryContext&gt; m_tryContextStack;
</span><span class="cx">         Vector&lt;std::pair&lt;RefPtr&lt;RegisterID&gt;, const DeconstructionPatternNode*&gt;&gt; m_deconstructedParameters;
</span><del>-        Vector&lt;FunctionBodyNode*&gt; m_functionsToInitialize;
</del><ins>+        enum FunctionVariableType : uint8_t { NormalFunctionVariable, GlobalFunctionVariable };
+        Vector&lt;std::pair&lt;FunctionBodyNode*, FunctionVariableType&gt;&gt; m_functionsToInitialize;
</ins><span class="cx">         bool m_needToInitializeArguments { false };
</span><span class="cx">         
</span><span class="cx">         Vector&lt;TryRange&gt; m_tryRanges;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Executable.cpp (183788 => 183789)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Executable.cpp        2015-05-05 03:22:35 UTC (rev 183788)
+++ trunk/Source/JavaScriptCore/runtime/Executable.cpp        2015-05-05 03:27:09 UTC (rev 183789)
</span><span class="lines">@@ -510,12 +510,11 @@
</span><span class="cx">     BatchedTransitionOptimizer optimizer(vm, globalObject);
</span><span class="cx"> 
</span><span class="cx">     const UnlinkedProgramCodeBlock::VariableDeclations&amp; variableDeclarations = unlinkedCodeBlock-&gt;variableDeclarations();
</span><del>-    const UnlinkedProgramCodeBlock::FunctionDeclations&amp; functionDeclarations = unlinkedCodeBlock-&gt;functionDeclarations();
</del><span class="cx"> 
</span><del>-    for (size_t i = 0; i &lt; functionDeclarations.size(); ++i) {
-        UnlinkedFunctionExecutable* unlinkedFunctionExecutable = functionDeclarations[i].second.get();
-        JSValue value = JSFunction::create(vm, unlinkedFunctionExecutable-&gt;link(vm, m_source), scope);
-        globalObject-&gt;addFunction(callFrame, functionDeclarations[i].first, value);
</del><ins>+    for (size_t i = 0, numberOfFunctions = unlinkedCodeBlock-&gt;numberOfFunctionDecls(); i &lt; numberOfFunctions; ++i) {
+        UnlinkedFunctionExecutable* unlinkedFunctionExecutable = unlinkedCodeBlock-&gt;functionDecl(i);
+        ASSERT(!unlinkedFunctionExecutable-&gt;name().isEmpty());
+        globalObject-&gt;addFunction(callFrame, unlinkedFunctionExecutable-&gt;name());
</ins><span class="cx">         if (vm.typeProfiler() || vm.controlFlowProfiler()) {
</span><span class="cx">             vm.functionHasExecutedCache()-&gt;insertUnexecutedRange(sourceID(), 
</span><span class="cx">                 unlinkedFunctionExecutable-&gt;typeProfilingStartOffset(), 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (183788 => 183789)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2015-05-05 03:22:35 UTC (rev 183788)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2015-05-05 03:27:09 UTC (rev 183789)
</span><span class="lines">@@ -502,16 +502,12 @@
</span><span class="cx">     return Base::defineOwnProperty(thisObject, exec, propertyName, descriptor, shouldThrow);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSGlobalObject::NewGlobalVar JSGlobalObject::addGlobalVar(const Identifier&amp; ident, ConstantMode constantMode)
</del><ins>+void JSGlobalObject::addGlobalVar(const Identifier&amp; ident, ConstantMode constantMode)
</ins><span class="cx"> {
</span><span class="cx">     ConcurrentJITLocker locker(symbolTable()-&gt;m_lock);
</span><span class="cx">     SymbolTableEntry entry = symbolTable()-&gt;get(locker, ident.impl());
</span><del>-    if (!entry.isNull()) {
-        NewGlobalVar result;
-        result.offset = entry.scopeOffset();
-        result.set = entry.watchpointSet();
-        return result;
-    }
</del><ins>+    if (!entry.isNull())
+        return;
</ins><span class="cx">     
</span><span class="cx">     ScopeOffset offset = symbolTable()-&gt;takeNextScopeOffset(locker);
</span><span class="cx">     SymbolTableEntry newEntry(VarOffset(offset), (constantMode == IsConstant) ? ReadOnly : 0);
</span><span class="lines">@@ -523,21 +519,13 @@
</span><span class="cx">     
</span><span class="cx">     ScopeOffset offsetForAssert = addVariables(1);
</span><span class="cx">     RELEASE_ASSERT(offsetForAssert == offset);
</span><del>-
-    NewGlobalVar var;
-    var.offset = offset;
-    var.set = newEntry.watchpointSet();
-    return var;
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-void JSGlobalObject::addFunction(ExecState* exec, const Identifier&amp; propertyName, JSValue value)
</del><ins>+void JSGlobalObject::addFunction(ExecState* exec, const Identifier&amp; propertyName)
</ins><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     removeDirect(vm, propertyName); // Newly declared functions overwrite existing properties.
</span><del>-    NewGlobalVar var = addGlobalVar(propertyName, IsVariable);
-    variableAt(var.offset).set(exec-&gt;vm(), this, value);
-    if (var.set)
-        var.set-&gt;touch(VariableWriteFireDetail(this, propertyName));
</del><ins>+    addGlobalVar(propertyName, IsVariable);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline JSObject* lastInPrototypeChain(JSObject* object)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h (183788 => 183789)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2015-05-05 03:22:35 UTC (rev 183788)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2015-05-05 03:27:09 UTC (rev 183789)
</span><span class="lines">@@ -338,11 +338,7 @@
</span><span class="cx">         setGlobalThis(vm, thisValue);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    struct NewGlobalVar {
-        ScopeOffset offset;
-        WatchpointSet* set;
-    };
-    NewGlobalVar addGlobalVar(const Identifier&amp;, ConstantMode);
</del><ins>+    void addGlobalVar(const Identifier&amp;, ConstantMode);
</ins><span class="cx"> 
</span><span class="cx"> public:
</span><span class="cx">     JS_EXPORT_PRIVATE ~JSGlobalObject();
</span><span class="lines">@@ -374,7 +370,7 @@
</span><span class="cx">         if (!hasProperty(exec, propertyName))
</span><span class="cx">             addGlobalVar(propertyName, IsConstant);
</span><span class="cx">     }
</span><del>-    void addFunction(ExecState*, const Identifier&amp;, JSValue);
</del><ins>+    void addFunction(ExecState*, const Identifier&amp;);
</ins><span class="cx"> 
</span><span class="cx">     // The following accessors return pristine values, even if a script 
</span><span class="cx">     // replaces the global object's associated property.
</span></span></pre>
</div>
</div>

</body>
</html>