<!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>[209196] 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/209196">209196</a></dd>
<dt>Author</dt> <dd>ggaren@apple.com</dd>
<dt>Date</dt> <dd>2016-12-01 13:23:27 -0800 (Thu, 01 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Removed some unnecessary indirection in code generation
https://bugs.webkit.org/show_bug.cgi?id=165264

Reviewed by Keith Miller.

There's no need to route through JSGlobalObject when producing code --
it just made the code harder to read.

This patch moves functions from JSGlobalObject to their singleton
call sites.

* runtime/CodeCache.cpp:
(JSC::CodeCache::getUnlinkedEvalCodeBlock):
(JSC::CodeCache::getUnlinkedGlobalEvalCodeBlock): Deleted.
* runtime/CodeCache.h:
* runtime/DirectEvalExecutable.cpp:
(JSC::DirectEvalExecutable::create):
* runtime/IndirectEvalExecutable.cpp:
(JSC::IndirectEvalExecutable::create):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::createProgramCodeBlock): Deleted.
(JSC::JSGlobalObject::createLocalEvalCodeBlock): Deleted.
(JSC::JSGlobalObject::createGlobalEvalCodeBlock): Deleted.
(JSC::JSGlobalObject::createModuleProgramCodeBlock): Deleted.
* runtime/JSGlobalObject.h:
* runtime/ModuleProgramExecutable.cpp:
(JSC::ModuleProgramExecutable::create):
* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):
* runtime/ProgramExecutable.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCodeCachecpp">trunk/Source/JavaScriptCore/runtime/CodeCache.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCodeCacheh">trunk/Source/JavaScriptCore/runtime/CodeCache.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeDirectEvalExecutablecpp">trunk/Source/JavaScriptCore/runtime/DirectEvalExecutable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIndirectEvalExecutablecpp">trunk/Source/JavaScriptCore/runtime/IndirectEvalExecutable.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>
<li><a href="#trunkSourceJavaScriptCoreruntimeModuleProgramExecutablecpp">trunk/Source/JavaScriptCore/runtime/ModuleProgramExecutable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeProgramExecutablecpp">trunk/Source/JavaScriptCore/runtime/ProgramExecutable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeProgramExecutableh">trunk/Source/JavaScriptCore/runtime/ProgramExecutable.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (209195 => 209196)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-12-01 21:22:07 UTC (rev 209195)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-12-01 21:23:27 UTC (rev 209196)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-12-01  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        Removed some unnecessary indirection in code generation
+        https://bugs.webkit.org/show_bug.cgi?id=165264
+
+        Reviewed by Keith Miller.
+
+        There's no need to route through JSGlobalObject when producing code --
+        it just made the code harder to read.
+
+        This patch moves functions from JSGlobalObject to their singleton
+        call sites.
+
+        * runtime/CodeCache.cpp:
+        (JSC::CodeCache::getUnlinkedEvalCodeBlock):
+        (JSC::CodeCache::getUnlinkedGlobalEvalCodeBlock): Deleted.
+        * runtime/CodeCache.h:
+        * runtime/DirectEvalExecutable.cpp:
+        (JSC::DirectEvalExecutable::create):
+        * runtime/IndirectEvalExecutable.cpp:
+        (JSC::IndirectEvalExecutable::create):
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::createProgramCodeBlock): Deleted.
+        (JSC::JSGlobalObject::createLocalEvalCodeBlock): Deleted.
+        (JSC::JSGlobalObject::createGlobalEvalCodeBlock): Deleted.
+        (JSC::JSGlobalObject::createModuleProgramCodeBlock): Deleted.
+        * runtime/JSGlobalObject.h:
+        * runtime/ModuleProgramExecutable.cpp:
+        (JSC::ModuleProgramExecutable::create):
+        * runtime/ProgramExecutable.cpp:
+        (JSC::ProgramExecutable::initializeGlobalProperties):
+        * runtime/ProgramExecutable.h:
+
</ins><span class="cx"> 2016-11-30  JF Bastien  &lt;jfbastien@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebAssembly: update binary format to 0xD version
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCodeCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CodeCache.cpp (209195 => 209196)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CodeCache.cpp        2016-12-01 21:22:07 UTC (rev 209195)
+++ trunk/Source/JavaScriptCore/runtime/CodeCache.cpp        2016-12-01 21:23:27 UTC (rev 209196)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx">     return getUnlinkedGlobalCodeBlock&lt;UnlinkedProgramCodeBlock&gt;(vm, executable, source, strictMode, JSParserScriptMode::Classic, debuggerMode, error, EvalContextType::None);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-UnlinkedEvalCodeBlock* CodeCache::getUnlinkedGlobalEvalCodeBlock(VM&amp; vm, IndirectEvalExecutable* executable, const SourceCode&amp; source, JSParserStrictMode strictMode, DebuggerMode debuggerMode, ParserError&amp; error, EvalContextType evalContextType)
</del><ins>+UnlinkedEvalCodeBlock* CodeCache::getUnlinkedEvalCodeBlock(VM&amp; vm, IndirectEvalExecutable* executable, const SourceCode&amp; source, JSParserStrictMode strictMode, DebuggerMode debuggerMode, ParserError&amp; error, EvalContextType evalContextType)
</ins><span class="cx"> {
</span><span class="cx">     return getUnlinkedGlobalCodeBlock&lt;UnlinkedEvalCodeBlock&gt;(vm, executable, source, strictMode, JSParserScriptMode::Classic, debuggerMode, error, evalContextType);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCodeCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CodeCache.h (209195 => 209196)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CodeCache.h        2016-12-01 21:22:07 UTC (rev 209195)
+++ trunk/Source/JavaScriptCore/runtime/CodeCache.h        2016-12-01 21:23:27 UTC (rev 209196)
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx">     UnlinkedProgramCodeBlock* getUnlinkedProgramCodeBlock(VM&amp;, ProgramExecutable*, const SourceCode&amp;, JSParserStrictMode, DebuggerMode, ParserError&amp;);
</span><del>-    UnlinkedEvalCodeBlock* getUnlinkedGlobalEvalCodeBlock(VM&amp;, IndirectEvalExecutable*, const SourceCode&amp;, JSParserStrictMode, DebuggerMode, ParserError&amp;, EvalContextType);
</del><ins>+    UnlinkedEvalCodeBlock* getUnlinkedEvalCodeBlock(VM&amp;, IndirectEvalExecutable*, const SourceCode&amp;, JSParserStrictMode, DebuggerMode, ParserError&amp;, EvalContextType);
</ins><span class="cx">     UnlinkedModuleProgramCodeBlock* getUnlinkedModuleProgramCodeBlock(VM&amp;, ModuleProgramExecutable*, const SourceCode&amp;, DebuggerMode, ParserError&amp;);
</span><span class="cx">     UnlinkedFunctionExecutable* getUnlinkedGlobalFunctionExecutable(VM&amp;, const Identifier&amp;, const SourceCode&amp;, DebuggerMode, ParserError&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeDirectEvalExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/DirectEvalExecutable.cpp (209195 => 209196)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/DirectEvalExecutable.cpp        2016-12-01 21:22:07 UTC (rev 209195)
+++ trunk/Source/JavaScriptCore/runtime/DirectEvalExecutable.cpp        2016-12-01 21:23:27 UTC (rev 209196)
</span><span class="lines">@@ -26,9 +26,12 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;DirectEvalExecutable.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;CodeCache.h&quot;
+#include &quot;Debugger.h&quot;
</ins><span class="cx"> #include &quot;Error.h&quot;
</span><span class="cx"> #include &quot;HeapInlines.h&quot;
</span><span class="cx"> #include &quot;JSCJSValueInlines.h&quot;
</span><ins>+#include &quot;ParserError.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -46,11 +49,22 @@
</span><span class="cx">     auto* executable = new (NotNull, allocateCell&lt;DirectEvalExecutable&gt;(*exec-&gt;heap())) DirectEvalExecutable(exec, source, isInStrictContext, derivedContextType, isArrowFunctionContext, evalContextType);
</span><span class="cx">     executable-&gt;finishCreation(vm);
</span><span class="cx"> 
</span><del>-    UnlinkedEvalCodeBlock* unlinkedEvalCode = globalObject-&gt;createLocalEvalCodeBlock(exec, executable, variablesUnderTDZ);
-    ASSERT(!!scope.exception() == !unlinkedEvalCode);
-    if (!unlinkedEvalCode)
-        return 0;
</del><ins>+    ParserError error;
+    JSParserStrictMode strictMode = executable-&gt;isStrictMode() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
+    DebuggerMode debuggerMode = globalObject-&gt;hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
</ins><span class="cx"> 
</span><ins>+    // We don't bother with CodeCache here because direct eval uses a specialized EvalCodeCache.
+    UnlinkedEvalCodeBlock* unlinkedEvalCode = generateUnlinkedCodeBlock&lt;UnlinkedEvalCodeBlock&gt;(
+        vm, executable, executable-&gt;source(), strictMode, JSParserScriptMode::Classic, debuggerMode, error, evalContextType, variablesUnderTDZ);
+
+    if (globalObject-&gt;hasDebugger())
+        globalObject-&gt;debugger()-&gt;sourceParsed(exec, executable-&gt;source().provider(), error.line(), error.message());
+
+    if (error.isValid()) {
+        throwVMError(exec, scope, error.toErrorObject(globalObject, executable-&gt;source()));
+        return nullptr;
+    }
+
</ins><span class="cx">     executable-&gt;m_unlinkedEvalCodeBlock.set(vm, executable, unlinkedEvalCode);
</span><span class="cx"> 
</span><span class="cx">     return executable;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIndirectEvalExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IndirectEvalExecutable.cpp (209195 => 209196)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IndirectEvalExecutable.cpp        2016-12-01 21:22:07 UTC (rev 209195)
+++ trunk/Source/JavaScriptCore/runtime/IndirectEvalExecutable.cpp        2016-12-01 21:23:27 UTC (rev 209196)
</span><span class="lines">@@ -26,9 +26,12 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;IndirectEvalExecutable.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;CodeCache.h&quot;
+#include &quot;Debugger.h&quot;
</ins><span class="cx"> #include &quot;Error.h&quot;
</span><span class="cx"> #include &quot;HeapInlines.h&quot;
</span><span class="cx"> #include &quot;JSCJSValueInlines.h&quot;
</span><ins>+#include &quot;ParserError.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -46,11 +49,21 @@
</span><span class="cx">     auto* executable = new (NotNull, allocateCell&lt;IndirectEvalExecutable&gt;(*exec-&gt;heap())) IndirectEvalExecutable(exec, source, isInStrictContext, derivedContextType, isArrowFunctionContext, evalContextType);
</span><span class="cx">     executable-&gt;finishCreation(vm);
</span><span class="cx"> 
</span><del>-    UnlinkedEvalCodeBlock* unlinkedEvalCode = globalObject-&gt;createGlobalEvalCodeBlock(exec, executable);
-    ASSERT(!!scope.exception() == !unlinkedEvalCode);
-    if (!unlinkedEvalCode)
-        return 0;
</del><ins>+    ParserError error;
+    JSParserStrictMode strictMode = executable-&gt;isStrictMode() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
+    DebuggerMode debuggerMode = globalObject-&gt;hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
+    
+    UnlinkedEvalCodeBlock* unlinkedEvalCode = vm.codeCache()-&gt;getUnlinkedEvalCodeBlock(
+        vm, executable, executable-&gt;source(), strictMode, debuggerMode, error, evalContextType);
</ins><span class="cx"> 
</span><ins>+    if (globalObject-&gt;hasDebugger())
+        globalObject-&gt;debugger()-&gt;sourceParsed(exec, executable-&gt;source().provider(), error.line(), error.message());
+
+    if (error.isValid()) {
+        throwVMError(exec, scope, error.toErrorObject(globalObject, executable-&gt;source()));
+        return nullptr;
+    }
+
</ins><span class="cx">     executable-&gt;m_unlinkedEvalCodeBlock.set(vm, executable, unlinkedEvalCode);
</span><span class="cx"> 
</span><span class="cx">     return executable;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (209195 => 209196)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-12-01 21:22:07 UTC (rev 209195)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-12-01 21:23:27 UTC (rev 209196)
</span><span class="lines">@@ -1332,96 +1332,6 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(globalObject, JSGlobalObject::info());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-UnlinkedProgramCodeBlock* JSGlobalObject::createProgramCodeBlock(CallFrame* callFrame, ProgramExecutable* executable, JSObject** exception)
-{
-    ParserError error;
-    JSParserStrictMode strictMode = executable-&gt;isStrictMode() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
-    DebuggerMode debuggerMode = hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
-    UnlinkedProgramCodeBlock* unlinkedCodeBlock = vm().codeCache()-&gt;getUnlinkedProgramCodeBlock(
-        vm(), executable, executable-&gt;source(), strictMode, 
-        debuggerMode, error);
-
-    if (hasDebugger())
-        debugger()-&gt;sourceParsed(callFrame, executable-&gt;source().provider(), error.line(), error.message());
-
-    if (error.isValid()) {
-        *exception = error.toErrorObject(this, executable-&gt;source());
-        return nullptr;
-    }
-    
-    return unlinkedCodeBlock;
-}
-
-UnlinkedEvalCodeBlock* JSGlobalObject::createLocalEvalCodeBlock(CallFrame* callFrame, DirectEvalExecutable* executable, const VariableEnvironment* variablesUnderTDZ)
-{
-    VM&amp; vm = this-&gt;vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    ParserError error;
-    JSParserStrictMode strictMode = executable-&gt;isStrictMode() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
-    DebuggerMode debuggerMode = hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
-    EvalContextType evalContextType = executable-&gt;executableInfo().evalContextType();
-
-    // We don't bother with CodeCache here because local eval uses a specialized EvalCodeCache.
-    UnlinkedEvalCodeBlock* unlinkedCodeBlock = generateUnlinkedCodeBlock&lt;UnlinkedEvalCodeBlock&gt;(
-        vm, executable, executable-&gt;source(), strictMode, JSParserScriptMode::Classic, debuggerMode, error, evalContextType, variablesUnderTDZ);
-
-    if (hasDebugger())
-        debugger()-&gt;sourceParsed(callFrame, executable-&gt;source().provider(), error.line(), error.message());
-
-    if (error.isValid()) {
-        throwVMError(callFrame, scope, error.toErrorObject(this, executable-&gt;source()));
-        return nullptr;
-    }
-
-    return unlinkedCodeBlock;
-}
-
-UnlinkedEvalCodeBlock* JSGlobalObject::createGlobalEvalCodeBlock(CallFrame* callFrame, IndirectEvalExecutable* executable)
-{
-    VM&amp; vm = this-&gt;vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    ParserError error;
-    JSParserStrictMode strictMode = executable-&gt;isStrictMode() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
-    DebuggerMode debuggerMode = hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
-    EvalContextType evalContextType = executable-&gt;executableInfo().evalContextType();
-    
-    UnlinkedEvalCodeBlock* unlinkedCodeBlock = vm.codeCache()-&gt;getUnlinkedGlobalEvalCodeBlock(
-        vm, executable, executable-&gt;source(), strictMode, debuggerMode, error, evalContextType);
-
-    if (hasDebugger())
-        debugger()-&gt;sourceParsed(callFrame, executable-&gt;source().provider(), error.line(), error.message());
-
-    if (error.isValid()) {
-        throwVMError(callFrame, scope, error.toErrorObject(this, executable-&gt;source()));
-        return nullptr;
-    }
-
-    return unlinkedCodeBlock;
-}
-
-UnlinkedModuleProgramCodeBlock* JSGlobalObject::createModuleProgramCodeBlock(CallFrame* callFrame, ModuleProgramExecutable* executable)
-{
-    VM&amp; vm = this-&gt;vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    ParserError error;
-    DebuggerMode debuggerMode = hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
-    UnlinkedModuleProgramCodeBlock* unlinkedCodeBlock = vm.codeCache()-&gt;getUnlinkedModuleProgramCodeBlock(
-        vm, executable, executable-&gt;source(), debuggerMode, error);
-
-    if (hasDebugger())
-        debugger()-&gt;sourceParsed(callFrame, executable-&gt;source().provider(), error.line(), error.message());
-
-    if (error.isValid()) {
-        throwVMError(callFrame, scope, error.toErrorObject(this, executable-&gt;source()));
-        return nullptr;
-    }
-
-    return unlinkedCodeBlock;
-}
-
</del><span class="cx"> void JSGlobalObject::setRemoteDebuggingEnabled(bool enabled)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h (209195 => 209196)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-12-01 21:22:07 UTC (rev 209195)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-12-01 21:23:27 UTC (rev 209196)
</span><span class="lines">@@ -834,11 +834,6 @@
</span><span class="cx">     unsigned weakRandomInteger() { return m_weakRandom.getUint32(); }
</span><span class="cx">     WeakRandom&amp; weakRandom() { return m_weakRandom; }
</span><span class="cx"> 
</span><del>-    UnlinkedProgramCodeBlock* createProgramCodeBlock(CallFrame*, ProgramExecutable*, JSObject** exception);
-    UnlinkedEvalCodeBlock* createLocalEvalCodeBlock(CallFrame*, DirectEvalExecutable*, const VariableEnvironment*);
-    UnlinkedEvalCodeBlock* createGlobalEvalCodeBlock(CallFrame*, IndirectEvalExecutable*);
-    UnlinkedModuleProgramCodeBlock* createModuleProgramCodeBlock(CallFrame*, ModuleProgramExecutable*);
-
</del><span class="cx">     bool needsSiteSpecificQuirks() const { return m_needsSiteSpecificQuirks; }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeModuleProgramExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ModuleProgramExecutable.cpp (209195 => 209196)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ModuleProgramExecutable.cpp        2016-12-01 21:22:07 UTC (rev 209195)
+++ trunk/Source/JavaScriptCore/runtime/ModuleProgramExecutable.cpp        2016-12-01 21:23:27 UTC (rev 209196)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;BatchedTransitionOptimizer.h&quot;
</span><span class="cx"> #include &quot;CodeBlock.h&quot;
</span><ins>+#include &quot;CodeCache.h&quot;
</ins><span class="cx"> #include &quot;Debugger.h&quot;
</span><span class="cx"> #include &quot;JIT.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="lines">@@ -53,13 +54,26 @@
</span><span class="cx"> 
</span><span class="cx"> ModuleProgramExecutable* ModuleProgramExecutable::create(ExecState* exec, const SourceCode&amp; source)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSGlobalObject* globalObject = exec-&gt;lexicalGlobalObject();
</span><span class="cx">     ModuleProgramExecutable* executable = new (NotNull, allocateCell&lt;ModuleProgramExecutable&gt;(*exec-&gt;heap())) ModuleProgramExecutable(exec, source);
</span><span class="cx">     executable-&gt;finishCreation(exec-&gt;vm());
</span><span class="cx"> 
</span><del>-    UnlinkedModuleProgramCodeBlock* unlinkedModuleProgramCode = globalObject-&gt;createModuleProgramCodeBlock(exec, executable);
-    if (!unlinkedModuleProgramCode)
</del><ins>+    ParserError error;
+    DebuggerMode debuggerMode = globalObject-&gt;hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
+    UnlinkedModuleProgramCodeBlock* unlinkedModuleProgramCode = vm.codeCache()-&gt;getUnlinkedModuleProgramCodeBlock(
+        vm, executable, executable-&gt;source(), debuggerMode, error);
+
+    if (globalObject-&gt;hasDebugger())
+        globalObject-&gt;debugger()-&gt;sourceParsed(exec, executable-&gt;source().provider(), error.line(), error.message());
+
+    if (error.isValid()) {
+        throwVMError(exec, scope, error.toErrorObject(globalObject, executable-&gt;source()));
</ins><span class="cx">         return nullptr;
</span><ins>+    }
+
</ins><span class="cx">     executable-&gt;m_unlinkedModuleProgramCodeBlock.set(exec-&gt;vm(), executable, unlinkedModuleProgramCode);
</span><span class="cx"> 
</span><span class="cx">     executable-&gt;m_moduleEnvironmentSymbolTable.set(exec-&gt;vm(), executable, jsCast&lt;SymbolTable*&gt;(unlinkedModuleProgramCode-&gt;constantRegister(unlinkedModuleProgramCode-&gt;moduleEnvironmentSymbolTableConstantRegisterOffset()).get())-&gt;cloneScopePart(exec-&gt;vm()));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeProgramExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ProgramExecutable.cpp (209195 => 209196)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ProgramExecutable.cpp        2016-12-01 21:22:07 UTC (rev 209195)
+++ trunk/Source/JavaScriptCore/runtime/ProgramExecutable.cpp        2016-12-01 21:23:27 UTC (rev 209196)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;BatchedTransitionOptimizer.h&quot;
</span><span class="cx"> #include &quot;CodeBlock.h&quot;
</span><ins>+#include &quot;CodeCache.h&quot;
</ins><span class="cx"> #include &quot;Debugger.h&quot;
</span><span class="cx"> #include &quot;Exception.h&quot;
</span><span class="cx"> #include &quot;JIT.h&quot;
</span><span class="lines">@@ -79,6 +80,19 @@
</span><span class="cx">     RELEASE_ASSERT(globalObject);
</span><span class="cx">     ASSERT(&amp;globalObject-&gt;vm() == &amp;vm);
</span><span class="cx"> 
</span><ins>+    ParserError error;
+    JSParserStrictMode strictMode = isStrictMode() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
+    DebuggerMode debuggerMode = globalObject-&gt;hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
+
+    UnlinkedProgramCodeBlock* unlinkedCodeBlock = vm.codeCache()-&gt;getUnlinkedProgramCodeBlock(
+        vm, this, source(), strictMode, debuggerMode, error);
+
+    if (globalObject-&gt;hasDebugger())
+        globalObject-&gt;debugger()-&gt;sourceParsed(callFrame, source().provider(), error.line(), error.message());
+
+    if (error.isValid())
+        return error.toErrorObject(globalObject, source());
+
</ins><span class="cx">     JSValue nextPrototype = globalObject-&gt;getPrototypeDirect();
</span><span class="cx">     while (nextPrototype &amp;&amp; nextPrototype.isObject()) {
</span><span class="cx">         if (UNLIKELY(asObject(nextPrototype)-&gt;type() == ProxyObjectType)) {
</span><span class="lines">@@ -88,11 +102,6 @@
</span><span class="cx">         nextPrototype = asObject(nextPrototype)-&gt;getPrototypeDirect();
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    JSObject* exception = nullptr;
-    UnlinkedProgramCodeBlock* unlinkedCodeBlock = globalObject-&gt;createProgramCodeBlock(callFrame, this, &amp;exception);
-    if (UNLIKELY(exception))
-        return exception;
-
</del><span class="cx">     JSGlobalLexicalEnvironment* globalLexicalEnvironment = globalObject-&gt;globalLexicalEnvironment();
</span><span class="cx">     const VariableEnvironment&amp; variableDeclarations = unlinkedCodeBlock-&gt;variableDeclarations();
</span><span class="cx">     const VariableEnvironment&amp; lexicalDeclarations = unlinkedCodeBlock-&gt;lexicalDeclarations();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeProgramExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ProgramExecutable.h (209195 => 209196)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ProgramExecutable.h        2016-12-01 21:22:07 UTC (rev 209195)
+++ trunk/Source/JavaScriptCore/runtime/ProgramExecutable.h        2016-12-01 21:23:27 UTC (rev 209196)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx">         return executable;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-
</del><span class="cx">     JSObject* initializeGlobalProperties(VM&amp;, CallFrame*, JSScope*);
</span><span class="cx"> 
</span><span class="cx">     static void destroy(JSCell*);
</span></span></pre>
</div>
</div>

</body>
</html>