<!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>[243365] 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/243365">243365</a></dd>
<dt>Author</dt> <dd>ysuzuki@apple.com</dd>
<dt>Date</dt> <dd>2019-03-22 00:14:43 -0700 (Fri, 22 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[JSC] Shrink sizeof(FunctionExecutable) by 16bytes
https://bugs.webkit.org/show_bug.cgi?id=196122

Reviewed by Saam Barati.

This patch reduces sizeof(FunctionExecutable) by 16 bytes.

1. ScriptExecutable::m_numParametersForCall and ScriptExecutable::m_numParametersForConstruct are not used in a meaningful way. Removed them.
2. ScriptExecutable::m_lastLine and ScriptExecutable::m_endColumn can be calculated from UnlinkedFunctionExecutable. So FunctionExecutable does not need to hold it.
   This patch adds GlobalExecutable, which are non-function ScriptExecutables, and move m_lastLine and m_endColumn to this class.
3. FunctionExecutable still needs to have the feature overriding m_lastLine and m_endColumn. We move overridden data in FunctionExecutable::RareData.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::link):
* runtime/EvalExecutable.cpp:
(JSC::EvalExecutable::EvalExecutable):
* runtime/EvalExecutable.h:
* runtime/FunctionExecutable.cpp:
(JSC::FunctionExecutable::FunctionExecutable):
(JSC::FunctionExecutable::ensureRareDataSlow):
(JSC::FunctionExecutable::overrideInfo):
* runtime/FunctionExecutable.h:
* runtime/GlobalExecutable.cpp: Copied from Source/JavaScriptCore/tools/FunctionOverrides.h.
* runtime/GlobalExecutable.h: Copied from Source/JavaScriptCore/tools/FunctionOverrides.h.
(JSC::GlobalExecutable::lastLine const):
(JSC::GlobalExecutable::endColumn const):
(JSC::GlobalExecutable::recordParse):
(JSC::GlobalExecutable::GlobalExecutable):
* runtime/ModuleProgramExecutable.cpp:
(JSC::ModuleProgramExecutable::ModuleProgramExecutable):
* runtime/ModuleProgramExecutable.h:
* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::ProgramExecutable):
* runtime/ProgramExecutable.h:
* runtime/ScriptExecutable.cpp:
(JSC::ScriptExecutable::clearCode):
(JSC::ScriptExecutable::installCode):
(JSC::ScriptExecutable::hasClearableCode const):
(JSC::ScriptExecutable::newCodeBlockFor):
(JSC::ScriptExecutable::typeProfilingEndOffset const):
(JSC::ScriptExecutable::recordParse):
(JSC::ScriptExecutable::lastLine const):
(JSC::ScriptExecutable::endColumn const):
* runtime/ScriptExecutable.h:
(JSC::ScriptExecutable::hasJITCodeForCall const):
(JSC::ScriptExecutable::hasJITCodeForConstruct const):
(JSC::ScriptExecutable::recordParse):
(JSC::ScriptExecutable::lastLine const): Deleted.
(JSC::ScriptExecutable::endColumn const): Deleted.
* tools/FunctionOverrides.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreSourcestxt">trunk/Source/JavaScriptCore/Sources.txt</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutablecpp">trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeEvalExecutablecpp">trunk/Source/JavaScriptCore/runtime/EvalExecutable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeEvalExecutableh">trunk/Source/JavaScriptCore/runtime/EvalExecutable.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeFunctionExecutablecpp">trunk/Source/JavaScriptCore/runtime/FunctionExecutable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeFunctionExecutableh">trunk/Source/JavaScriptCore/runtime/FunctionExecutable.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeModuleProgramExecutablecpp">trunk/Source/JavaScriptCore/runtime/ModuleProgramExecutable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeModuleProgramExecutableh">trunk/Source/JavaScriptCore/runtime/ModuleProgramExecutable.h</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>
<li><a href="#trunkSourceJavaScriptCoreruntimeScriptExecutablecpp">trunk/Source/JavaScriptCore/runtime/ScriptExecutable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeScriptExecutableh">trunk/Source/JavaScriptCore/runtime/ScriptExecutable.h</a></li>
<li><a href="#trunkSourceJavaScriptCoretoolsFunctionOverridesh">trunk/Source/JavaScriptCore/tools/FunctionOverrides.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreruntimeGlobalExecutablecpp">trunk/Source/JavaScriptCore/runtime/GlobalExecutable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeGlobalExecutableh">trunk/Source/JavaScriptCore/runtime/GlobalExecutable.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt       2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt  2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -803,6 +803,7 @@
</span><span class="cx">     runtime/GenericTypedArrayView.h
</span><span class="cx">     runtime/GenericTypedArrayViewInlines.h
</span><span class="cx">     runtime/GetPutInfo.h
</span><ins>+    runtime/GlobalExecutable.h
</ins><span class="cx">     runtime/HashMapImpl.h
</span><span class="cx">     runtime/Identifier.h
</span><span class="cx">     runtime/IdentifierInlines.h
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/ChangeLog       2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -1,5 +1,61 @@
</span><span class="cx"> 2019-03-21  Yusuke Suzuki  <ysuzuki@apple.com>
</span><span class="cx"> 
</span><ins>+        [JSC] Shrink sizeof(FunctionExecutable) by 16bytes
+        https://bugs.webkit.org/show_bug.cgi?id=196122
+
+        Reviewed by Saam Barati.
+
+        This patch reduces sizeof(FunctionExecutable) by 16 bytes.
+
+        1. ScriptExecutable::m_numParametersForCall and ScriptExecutable::m_numParametersForConstruct are not used in a meaningful way. Removed them.
+        2. ScriptExecutable::m_lastLine and ScriptExecutable::m_endColumn can be calculated from UnlinkedFunctionExecutable. So FunctionExecutable does not need to hold it.
+           This patch adds GlobalExecutable, which are non-function ScriptExecutables, and move m_lastLine and m_endColumn to this class.
+        3. FunctionExecutable still needs to have the feature overriding m_lastLine and m_endColumn. We move overridden data in FunctionExecutable::RareData.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * Sources.txt:
+        * bytecode/UnlinkedFunctionExecutable.cpp:
+        (JSC::UnlinkedFunctionExecutable::link):
+        * runtime/EvalExecutable.cpp:
+        (JSC::EvalExecutable::EvalExecutable):
+        * runtime/EvalExecutable.h:
+        * runtime/FunctionExecutable.cpp:
+        (JSC::FunctionExecutable::FunctionExecutable):
+        (JSC::FunctionExecutable::ensureRareDataSlow):
+        (JSC::FunctionExecutable::overrideInfo):
+        * runtime/FunctionExecutable.h:
+        * runtime/GlobalExecutable.cpp: Copied from Source/JavaScriptCore/tools/FunctionOverrides.h.
+        * runtime/GlobalExecutable.h: Copied from Source/JavaScriptCore/tools/FunctionOverrides.h.
+        (JSC::GlobalExecutable::lastLine const):
+        (JSC::GlobalExecutable::endColumn const):
+        (JSC::GlobalExecutable::recordParse):
+        (JSC::GlobalExecutable::GlobalExecutable):
+        * runtime/ModuleProgramExecutable.cpp:
+        (JSC::ModuleProgramExecutable::ModuleProgramExecutable):
+        * runtime/ModuleProgramExecutable.h:
+        * runtime/ProgramExecutable.cpp:
+        (JSC::ProgramExecutable::ProgramExecutable):
+        * runtime/ProgramExecutable.h:
+        * runtime/ScriptExecutable.cpp:
+        (JSC::ScriptExecutable::clearCode):
+        (JSC::ScriptExecutable::installCode):
+        (JSC::ScriptExecutable::hasClearableCode const):
+        (JSC::ScriptExecutable::newCodeBlockFor):
+        (JSC::ScriptExecutable::typeProfilingEndOffset const):
+        (JSC::ScriptExecutable::recordParse):
+        (JSC::ScriptExecutable::lastLine const):
+        (JSC::ScriptExecutable::endColumn const):
+        * runtime/ScriptExecutable.h:
+        (JSC::ScriptExecutable::hasJITCodeForCall const):
+        (JSC::ScriptExecutable::hasJITCodeForConstruct const):
+        (JSC::ScriptExecutable::recordParse):
+        (JSC::ScriptExecutable::lastLine const): Deleted.
+        (JSC::ScriptExecutable::endColumn const): Deleted.
+        * tools/FunctionOverrides.h:
+
+2019-03-21  Yusuke Suzuki  <ysuzuki@apple.com>
+
</ins><span class="cx">         [JSC] Shrink sizeof(RegExpObject)
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=196130
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj     2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -1766,6 +1766,7 @@
</span><span class="cx">          E350708A1DC49BBF0089BCD6 /* DOMJITSignature.h in Headers */ = {isa = PBXBuildFile; fileRef = E35070891DC49BB60089BCD6 /* DOMJITSignature.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          E354622B1B6065D100545386 /* ConstructAbility.h in Headers */ = {isa = PBXBuildFile; fileRef = E354622A1B6065D100545386 /* ConstructAbility.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          E3555B8A1DAE03A500F36921 /* DOMJITCallDOMGetterSnippet.h in Headers */ = {isa = PBXBuildFile; fileRef = E3555B891DAE03A200F36921 /* DOMJITCallDOMGetterSnippet.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+               E355D38F22446877008F1AD6 /* GlobalExecutable.h in Headers */ = {isa = PBXBuildFile; fileRef = E355D38D2244686B008F1AD6 /* GlobalExecutable.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           E35A0B9D220AD87A00AC4474 /* ExecutableBaseInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = E35A0B9C220AD87A00AC4474 /* ExecutableBaseInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          E35CA1541DBC3A5C00F83516 /* DOMJITHeapRange.h in Headers */ = {isa = PBXBuildFile; fileRef = E35CA1521DBC3A5600F83516 /* DOMJITHeapRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          E35CA1561DBC3A5F00F83516 /* DOMJITAbstractHeap.h in Headers */ = {isa = PBXBuildFile; fileRef = E35CA1501DBC3A5600F83516 /* DOMJITAbstractHeap.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -4716,6 +4717,8 @@
</span><span class="cx">          E35070891DC49BB60089BCD6 /* DOMJITSignature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMJITSignature.h; sourceTree = "<group>"; };
</span><span class="cx">          E354622A1B6065D100545386 /* ConstructAbility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstructAbility.h; sourceTree = "<group>"; };
</span><span class="cx">          E3555B891DAE03A200F36921 /* DOMJITCallDOMGetterSnippet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMJITCallDOMGetterSnippet.h; sourceTree = "<group>"; };
</span><ins>+               E355D38D2244686B008F1AD6 /* GlobalExecutable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GlobalExecutable.h; sourceTree = "<group>"; };
+               E355D38E2244686C008F1AD6 /* GlobalExecutable.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GlobalExecutable.cpp; sourceTree = "<group>"; };
</ins><span class="cx">           E35A0B9C220AD87A00AC4474 /* ExecutableBaseInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecutableBaseInlines.h; sourceTree = "<group>"; };
</span><span class="cx">          E35CA14F1DBC3A5600F83516 /* DOMJITAbstractHeap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMJITAbstractHeap.cpp; sourceTree = "<group>"; };
</span><span class="cx">          E35CA1501DBC3A5600F83516 /* DOMJITAbstractHeap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMJITAbstractHeap.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -6806,6 +6809,8 @@
</span><span class="cx">                          796465681B952FF0003059EE /* GetPutInfo.h */,
</span><span class="cx">                          BC02E9B80E184545000F9297 /* GetterSetter.cpp */,
</span><span class="cx">                          BC337BDE0E1AF0B80076918A /* GetterSetter.h */,
</span><ins>+                               E355D38E2244686C008F1AD6 /* GlobalExecutable.cpp */,
+                               E355D38D2244686B008F1AD6 /* GlobalExecutable.h */,
</ins><span class="cx">                           79A0907D1D768465008B889B /* HashMapImpl.cpp */,
</span><span class="cx">                          79A0907E1D768465008B889B /* HashMapImpl.h */,
</span><span class="cx">                          79DFCBDA1D88C59600527D03 /* HasOwnPropertyCache.h */,
</span><span class="lines">@@ -9126,6 +9131,7 @@
</span><span class="cx">                          534E03581E53BF2F00213F64 /* GetterSetterAccessCase.h in Headers */,
</span><span class="cx">                          0FEC3C5B1F33A48900F59B6C /* GigacageAlignedMemoryAllocator.h in Headers */,
</span><span class="cx">                          14AD910E1DCA92940014F9FE /* GlobalCodeBlock.h in Headers */,
</span><ins>+                               E355D38F22446877008F1AD6 /* GlobalExecutable.h in Headers */,
</ins><span class="cx">                           0F24E54417EA9F5900ABB217 /* GPRInfo.h in Headers */,
</span><span class="cx">                          142E3134134FF0A600AFADB5 /* Handle.h in Headers */,
</span><span class="cx">                          C283190016FE4B7D00157BFD /* HandleBlock.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/Sources.txt (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/Sources.txt  2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/Sources.txt     2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -768,6 +768,7 @@
</span><span class="cx"> runtime/GeneratorPrototype.cpp
</span><span class="cx"> runtime/GetPutInfo.cpp
</span><span class="cx"> runtime/GetterSetter.cpp
</span><ins>+runtime/GlobalExecutable.cpp
</ins><span class="cx"> runtime/HashMapImpl.cpp
</span><span class="cx"> runtime/Identifier.cpp
</span><span class="cx"> runtime/IndexingType.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp      2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp 2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -158,31 +158,17 @@
</span><span class="cx"> FunctionExecutable* UnlinkedFunctionExecutable::link(VM& vm, const SourceCode& passedParentSource, Optional<int> overrideLineNumber, Intrinsic intrinsic)
</span><span class="cx"> {
</span><span class="cx">     SourceCode source = linkedSourceCode(passedParentSource);
</span><del>-    unsigned firstLine = source.firstLine().oneBasedInt();
-    unsigned lineCount = m_lineCount;
-    unsigned endColumn = linkedEndColumn(source.startColumn().oneBasedInt());
</del><span class="cx">     FunctionOverrides::OverrideInfo overrideInfo;
</span><span class="cx">     bool hasFunctionOverride = false;
</span><del>-    if (UNLIKELY(Options::functionOverrides())) {
</del><ins>+    if (UNLIKELY(Options::functionOverrides()))
</ins><span class="cx">         hasFunctionOverride = FunctionOverrides::initializeOverrideFor(source, overrideInfo);
</span><del>-        if (UNLIKELY(hasFunctionOverride)) {
-            firstLine = overrideInfo.firstLine;
-            lineCount = overrideInfo.lineCount;
-            endColumn = overrideInfo.endColumn;
-            source = overrideInfo.sourceCode;
-        }
-    }
</del><span class="cx"> 
</span><del>-    FunctionExecutable* result = FunctionExecutable::create(vm, source, this, firstLine + lineCount, endColumn, intrinsic);
</del><ins>+    FunctionExecutable* result = FunctionExecutable::create(vm, source, this, intrinsic);
</ins><span class="cx">     if (overrideLineNumber)
</span><span class="cx">         result->setOverrideLineNumber(*overrideLineNumber);
</span><span class="cx"> 
</span><del>-    if (UNLIKELY(hasFunctionOverride)) {
-        result->overrideParameterAndTypeProfilingStartEndOffsets(
-            overrideInfo.parametersStartOffset,
-            overrideInfo.typeProfilingStartOffset,
-            overrideInfo.typeProfilingEndOffset);
-    }
</del><ins>+    if (UNLIKELY(hasFunctionOverride))
+        result->overrideInfo(overrideInfo);
</ins><span class="cx"> 
</span><span class="cx">     return result;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeEvalExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/EvalExecutable.cpp (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/EvalExecutable.cpp   2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/runtime/EvalExecutable.cpp      2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -31,10 +31,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-const ClassInfo EvalExecutable::s_info = { "EvalExecutable", &ScriptExecutable::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(EvalExecutable) };
</del><ins>+const ClassInfo EvalExecutable::s_info = { "EvalExecutable", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(EvalExecutable) };
</ins><span class="cx"> 
</span><span class="cx"> EvalExecutable::EvalExecutable(ExecState* exec, const SourceCode& source, bool inStrictContext, DerivedContextType derivedContextType, bool isArrowFunctionContext, EvalContextType evalContextType)
</span><del>-    : ScriptExecutable(exec->vm().evalExecutableStructure.get(), exec->vm(), source, inStrictContext, derivedContextType, isArrowFunctionContext, evalContextType, NoIntrinsic)
</del><ins>+    : Base(exec->vm().evalExecutableStructure.get(), exec->vm(), source, inStrictContext, derivedContextType, isArrowFunctionContext, evalContextType, NoIntrinsic)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(source.provider()->sourceType() == SourceProviderSourceType::Program);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeEvalExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/EvalExecutable.h (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/EvalExecutable.h     2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/runtime/EvalExecutable.h        2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -26,15 +26,15 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "ExecutableToCodeBlockEdge.h"
</span><del>-#include "ScriptExecutable.h"
</del><ins>+#include "GlobalExecutable.h"
</ins><span class="cx"> #include "UnlinkedEvalCodeBlock.h"
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-class EvalExecutable : public ScriptExecutable {
</del><ins>+class EvalExecutable : public GlobalExecutable {
</ins><span class="cx">     friend class LLIntOffsetsExtractor;
</span><span class="cx"> public:
</span><del>-    typedef ScriptExecutable Base;
</del><ins>+    using Base = GlobalExecutable;
</ins><span class="cx">     static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
</span><span class="cx"> 
</span><span class="cx">     static void destroy(JSCell*);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeFunctionExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/FunctionExecutable.cpp (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/FunctionExecutable.cpp       2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/runtime/FunctionExecutable.cpp  2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include "CodeBlock.h"
</span><span class="cx"> #include "Debugger.h"
</span><span class="cx"> #include "FunctionCodeBlock.h"
</span><ins>+#include "FunctionOverrides.h"
</ins><span class="cx"> #include "JIT.h"
</span><span class="cx"> #include "JSCInlines.h"
</span><span class="cx"> #include "LLIntEntrypoint.h"
</span><span class="lines">@@ -41,15 +42,14 @@
</span><span class="cx"> 
</span><span class="cx"> const ClassInfo FunctionExecutable::s_info = { "FunctionExecutable", &ScriptExecutable::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(FunctionExecutable) };
</span><span class="cx"> 
</span><del>-FunctionExecutable::FunctionExecutable(VM& vm, const SourceCode& source, UnlinkedFunctionExecutable* unlinkedExecutable, unsigned lastLine, unsigned endColumn, Intrinsic intrinsic)
</del><ins>+static_assert(sizeof(FunctionExecutable) <= 128, "FunctionExecutable should fit in a 128-byte cell since it is so frequently allocated.");
+
+FunctionExecutable::FunctionExecutable(VM& vm, const SourceCode& source, UnlinkedFunctionExecutable* unlinkedExecutable, Intrinsic intrinsic)
</ins><span class="cx">     : ScriptExecutable(vm.functionExecutableStructure.get(), vm, source, unlinkedExecutable->isInStrictContext(), unlinkedExecutable->derivedContextType(), false, EvalContextType::None, intrinsic)
</span><span class="cx">     , m_unlinkedExecutable(vm, this, unlinkedExecutable)
</span><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(!source.isNull());
</span><span class="cx">     ASSERT(source.length());
</span><del>-    m_lastLine = lastLine;
-    ASSERT(endColumn != UINT_MAX);
-    m_endColumn = endColumn;
</del><span class="cx">     if (VM::canUseJIT())
</span><span class="cx">         new (&m_singletonFunction) WriteBarrier<InferredValue>();
</span><span class="cx">     else
</span><span class="lines">@@ -111,11 +111,25 @@
</span><span class="cx"> FunctionExecutable::RareData& FunctionExecutable::ensureRareDataSlow()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_rareData);
</span><del>-    m_rareData = std::make_unique<RareData>();
-    m_rareData->m_parametersStartOffset = m_unlinkedExecutable->parametersStartOffset();
-    m_rareData->m_typeProfilingStartOffset = m_unlinkedExecutable->typeProfilingStartOffset();
-    m_rareData->m_typeProfilingEndOffset = m_unlinkedExecutable->typeProfilingEndOffset();
</del><ins>+    auto rareData = std::make_unique<RareData>();
+    rareData->m_lineCount = lineCount();
+    rareData->m_endColumn = endColumn();
+    rareData->m_parametersStartOffset = parametersStartOffset();
+    rareData->m_typeProfilingStartOffset = typeProfilingStartOffset();
+    rareData->m_typeProfilingEndOffset = typeProfilingEndOffset();
+    m_rareData = WTFMove(rareData);
</ins><span class="cx">     return *m_rareData;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void FunctionExecutable::overrideInfo(const FunctionOverrideInfo& overrideInfo)
+{
+    auto& rareData = ensureRareData();
+    m_source = overrideInfo.sourceCode;
+    rareData.m_lineCount = overrideInfo.lineCount;
+    rareData.m_endColumn = overrideInfo.endColumn;
+    rareData.m_parametersStartOffset = overrideInfo.parametersStartOffset;
+    rareData.m_typeProfilingStartOffset = overrideInfo.typeProfilingStartOffset;
+    rareData.m_typeProfilingEndOffset = overrideInfo.typeProfilingEndOffset;
+}
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeFunctionExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/FunctionExecutable.h (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/FunctionExecutable.h 2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/runtime/FunctionExecutable.h    2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -33,6 +33,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><ins>+struct FunctionOverrideInfo;
+
</ins><span class="cx"> class FunctionExecutable final : public ScriptExecutable {
</span><span class="cx">     friend class JIT;
</span><span class="cx">     friend class LLIntOffsetsExtractor;
</span><span class="lines">@@ -46,11 +48,9 @@
</span><span class="cx">         return &vm.functionExecutableSpace.space;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static FunctionExecutable* create(
-        VM& vm, const SourceCode& source, UnlinkedFunctionExecutable* unlinkedExecutable, 
-        unsigned lastLine, unsigned endColumn, Intrinsic intrinsic)
</del><ins>+    static FunctionExecutable* create(VM& vm, const SourceCode& source, UnlinkedFunctionExecutable* unlinkedExecutable, Intrinsic intrinsic)
</ins><span class="cx">     {
</span><del>-        FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(vm.heap)) FunctionExecutable(vm, source, unlinkedExecutable, lastLine, endColumn, intrinsic);
</del><ins>+        FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(vm.heap)) FunctionExecutable(vm, source, unlinkedExecutable, intrinsic);
</ins><span class="cx">         executable->finishCreation(vm);
</span><span class="cx">         return executable;
</span><span class="cx">     }
</span><span class="lines">@@ -190,8 +190,37 @@
</span><span class="cx">         return WTF::nullopt;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    int lineCount() const
+    {
+        if (UNLIKELY(m_rareData))
+            return m_rareData->m_lineCount;
+        return m_unlinkedExecutable->lineCount();
+    }
+
+    int endColumn() const
+    {
+        if (UNLIKELY(m_rareData))
+            return m_rareData->m_endColumn;
+        return m_unlinkedExecutable->linkedEndColumn(m_source.startColumn().oneBasedInt());
+    }
+
+    int firstLine() const
+    {
+        return source().firstLine().oneBasedInt();
+    }
+
+    int lastLine() const
+    {
+        return firstLine() + lineCount();
+    }
+
</ins><span class="cx">     unsigned typeProfilingStartOffset(VM&) const
</span><span class="cx">     {
</span><ins>+        return typeProfilingStartOffset();
+    }
+
+    unsigned typeProfilingStartOffset() const
+    {
</ins><span class="cx">         if (UNLIKELY(m_rareData))
</span><span class="cx">             return m_rareData->m_typeProfilingStartOffset;
</span><span class="cx">         return m_unlinkedExecutable->typeProfilingStartOffset();
</span><span class="lines">@@ -199,6 +228,11 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned typeProfilingEndOffset(VM&) const
</span><span class="cx">     {
</span><ins>+        return typeProfilingEndOffset();
+    }
+
+    unsigned typeProfilingEndOffset() const
+    {
</ins><span class="cx">         if (UNLIKELY(m_rareData))
</span><span class="cx">             return m_rareData->m_typeProfilingEndOffset;
</span><span class="cx">         return m_unlinkedExecutable->typeProfilingEndOffset();
</span><span class="lines">@@ -211,13 +245,7 @@
</span><span class="cx">         return m_unlinkedExecutable->parametersStartOffset();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void overrideParameterAndTypeProfilingStartEndOffsets(unsigned parametersStartOffset, unsigned typeProfilingStartOffset, unsigned typeProfilingEndOffset)
-    {
-        auto& rareData = ensureRareData();
-        rareData.m_parametersStartOffset = parametersStartOffset;
-        rareData.m_typeProfilingStartOffset = typeProfilingStartOffset;
-        rareData.m_typeProfilingEndOffset = typeProfilingEndOffset;
-    }
</del><ins>+    void overrideInfo(const FunctionOverrideInfo&);
</ins><span class="cx"> 
</span><span class="cx">     DECLARE_INFO;
</span><span class="cx"> 
</span><span class="lines">@@ -268,9 +296,7 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class ExecutableBase;
</span><del>-    FunctionExecutable(
-        VM&, const SourceCode&, UnlinkedFunctionExecutable*,
-        unsigned lastLine, unsigned endColumn, Intrinsic);
</del><ins>+    FunctionExecutable(VM&, const SourceCode&, UnlinkedFunctionExecutable*, Intrinsic);
</ins><span class="cx">     
</span><span class="cx">     void finishCreation(VM&);
</span><span class="cx"> 
</span><span class="lines">@@ -278,11 +304,13 @@
</span><span class="cx"> 
</span><span class="cx">     struct RareData {
</span><span class="cx">         WTF_MAKE_STRUCT_FAST_ALLOCATED;
</span><ins>+        RefPtr<TypeSet> m_returnStatementTypeSet;
+        unsigned m_lineCount;
+        unsigned m_endColumn;
</ins><span class="cx">         Markable<int, IntegralMarkableTraits<int, -1>> m_overrideLineNumber;
</span><span class="cx">         unsigned m_parametersStartOffset { 0 };
</span><span class="cx">         unsigned m_typeProfilingStartOffset { UINT_MAX };
</span><span class="cx">         unsigned m_typeProfilingEndOffset { UINT_MAX };
</span><del>-        RefPtr<TypeSet> m_returnStatementTypeSet;
</del><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     RareData& ensureRareData()
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeGlobalExecutablecppfromrev243364trunkSourceJavaScriptCoretoolsFunctionOverridesh"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/runtime/GlobalExecutable.cpp (from rev 243364, trunk/Source/JavaScriptCore/tools/FunctionOverrides.h) (0 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/GlobalExecutable.cpp                         (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/GlobalExecutable.cpp    2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "GlobalExecutable.h"
+
+namespace JSC {
+
+const ClassInfo GlobalExecutable::s_info = { "GlobalExecutable", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(GlobalExecutable) };
+
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeGlobalExecutablehfromrev243364trunkSourceJavaScriptCoretoolsFunctionOverridesh"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/runtime/GlobalExecutable.h (from rev 243364, trunk/Source/JavaScriptCore/tools/FunctionOverrides.h) (0 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/GlobalExecutable.h                           (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/GlobalExecutable.h      2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "ExecutableToCodeBlockEdge.h"
+#include "ScriptExecutable.h"
+
+namespace JSC {
+
+class GlobalExecutable : public ScriptExecutable {
+public:
+    using Base = ScriptExecutable;
+    static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
+
+    DECLARE_INFO;
+
+    unsigned lastLine() const { return m_lastLine; }
+    unsigned endColumn() const { return m_endColumn; }
+
+    void recordParse(CodeFeatures features, bool hasCapturedVariables, int lastLine, unsigned endColumn)
+    {
+        Base::recordParse(features, hasCapturedVariables);
+        m_lastLine = lastLine;
+        m_endColumn = endColumn;
+        ASSERT(endColumn != UINT_MAX);
+    }
+
+protected:
+    GlobalExecutable(Structure* structure, VM& vm, const SourceCode& sourceCode, bool isInStrictContext, DerivedContextType derivedContextType, bool isInArrowFunctionContext, EvalContextType evalContextType, Intrinsic intrinsic)
+        : Base(structure, vm, sourceCode, isInStrictContext, derivedContextType, isInArrowFunctionContext, evalContextType, intrinsic)
+    {
+    }
+
+    int m_lastLine { -1 };
+    unsigned m_endColumn { UINT_MAX };
+};
+
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeModuleProgramExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ModuleProgramExecutable.cpp (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ModuleProgramExecutable.cpp  2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/runtime/ModuleProgramExecutable.cpp     2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -40,10 +40,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-const ClassInfo ModuleProgramExecutable::s_info = { "ModuleProgramExecutable", &ScriptExecutable::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(ModuleProgramExecutable) };
</del><ins>+const ClassInfo ModuleProgramExecutable::s_info = { "ModuleProgramExecutable", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(ModuleProgramExecutable) };
</ins><span class="cx"> 
</span><span class="cx"> ModuleProgramExecutable::ModuleProgramExecutable(ExecState* exec, const SourceCode& source)
</span><del>-    : ScriptExecutable(exec->vm().moduleProgramExecutableStructure.get(), exec->vm(), source, false, DerivedContextType::None, false, EvalContextType::None, NoIntrinsic)
</del><ins>+    : Base(exec->vm().moduleProgramExecutableStructure.get(), exec->vm(), source, false, DerivedContextType::None, false, EvalContextType::None, NoIntrinsic)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(source.provider()->sourceType() == SourceProviderSourceType::Module);
</span><span class="cx">     VM& vm = exec->vm();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeModuleProgramExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ModuleProgramExecutable.h (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ModuleProgramExecutable.h    2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/runtime/ModuleProgramExecutable.h       2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -26,14 +26,14 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "ExecutableToCodeBlockEdge.h"
</span><del>-#include "ScriptExecutable.h"
</del><ins>+#include "GlobalExecutable.h"
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-class ModuleProgramExecutable final : public ScriptExecutable {
</del><ins>+class ModuleProgramExecutable final : public GlobalExecutable {
</ins><span class="cx">     friend class LLIntOffsetsExtractor;
</span><span class="cx"> public:
</span><del>-    typedef ScriptExecutable Base;
</del><ins>+    using Base = GlobalExecutable;
</ins><span class="cx">     static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
</span><span class="cx"> 
</span><span class="cx">     template<typename CellType, SubspaceAccess mode>
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeProgramExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ProgramExecutable.cpp (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ProgramExecutable.cpp        2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/runtime/ProgramExecutable.cpp   2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -41,10 +41,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-const ClassInfo ProgramExecutable::s_info = { "ProgramExecutable", &ScriptExecutable::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(ProgramExecutable) };
</del><ins>+const ClassInfo ProgramExecutable::s_info = { "ProgramExecutable", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(ProgramExecutable) };
</ins><span class="cx"> 
</span><span class="cx"> ProgramExecutable::ProgramExecutable(ExecState* exec, const SourceCode& source)
</span><del>-    : ScriptExecutable(exec->vm().programExecutableStructure.get(), exec->vm(), source, false, DerivedContextType::None, false, EvalContextType::None, NoIntrinsic)
</del><ins>+    : Base(exec->vm().programExecutableStructure.get(), exec->vm(), source, false, DerivedContextType::None, false, EvalContextType::None, NoIntrinsic)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(source.provider()->sourceType() == SourceProviderSourceType::Program);
</span><span class="cx">     VM& vm = exec->vm();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeProgramExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ProgramExecutable.h (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ProgramExecutable.h  2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/runtime/ProgramExecutable.h     2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -26,14 +26,14 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "ExecutableToCodeBlockEdge.h"
</span><del>-#include "ScriptExecutable.h"
</del><ins>+#include "GlobalExecutable.h"
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-class ProgramExecutable final : public ScriptExecutable {
</del><ins>+class ProgramExecutable final : public GlobalExecutable {
</ins><span class="cx">     friend class LLIntOffsetsExtractor;
</span><span class="cx"> public:
</span><del>-    typedef ScriptExecutable Base;
</del><ins>+    using Base = GlobalExecutable;
</ins><span class="cx">     static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
</span><span class="cx"> 
</span><span class="cx">     template<typename CellType, SubspaceAccess>
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeScriptExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ScriptExecutable.cpp (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ScriptExecutable.cpp 2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/runtime/ScriptExecutable.cpp    2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include "Debugger.h"
</span><span class="cx"> #include "EvalCodeBlock.h"
</span><span class="cx"> #include "FunctionCodeBlock.h"
</span><ins>+#include "GlobalExecutable.h"
</ins><span class="cx"> #include "IsoCellSetInlines.h"
</span><span class="cx"> #include "JIT.h"
</span><span class="cx"> #include "JSCInlines.h"
</span><span class="lines">@@ -68,14 +69,10 @@
</span><span class="cx"> 
</span><span class="cx"> void ScriptExecutable::clearCode(IsoCellSet& clearableCodeSet)
</span><span class="cx"> {
</span><del>-#if ENABLE(JIT)
</del><span class="cx">     m_jitCodeForCall = nullptr;
</span><span class="cx">     m_jitCodeForConstruct = nullptr;
</span><span class="cx">     m_jitCodeForCallWithArityCheck = MacroAssemblerCodePtr<JSEntryPtrTag>();
</span><span class="cx">     m_jitCodeForConstructWithArityCheck = MacroAssemblerCodePtr<JSEntryPtrTag>();
</span><del>-#endif
-    m_numParametersForCall = NUM_PARAMETERS_NOT_COMPILED;
-    m_numParametersForConstruct = NUM_PARAMETERS_NOT_COMPILED;
</del><span class="cx"> 
</span><span class="cx">     switch (type()) {
</span><span class="cx">     case FunctionExecutableType: {
</span><span class="lines">@@ -180,12 +177,10 @@
</span><span class="cx">     case CodeForCall:
</span><span class="cx">         m_jitCodeForCall = genericCodeBlock ? genericCodeBlock->jitCode() : nullptr;
</span><span class="cx">         m_jitCodeForCallWithArityCheck = nullptr;
</span><del>-        m_numParametersForCall = genericCodeBlock ? genericCodeBlock->numParameters() : NUM_PARAMETERS_NOT_COMPILED;
</del><span class="cx">         break;
</span><span class="cx">     case CodeForConstruct:
</span><span class="cx">         m_jitCodeForConstruct = genericCodeBlock ? genericCodeBlock->jitCode() : nullptr;
</span><span class="cx">         m_jitCodeForConstructWithArityCheck = nullptr;
</span><del>-        m_numParametersForConstruct = genericCodeBlock ? genericCodeBlock->numParameters() : NUM_PARAMETERS_NOT_COMPILED;
</del><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -218,13 +213,11 @@
</span><span class="cx"> 
</span><span class="cx"> bool ScriptExecutable::hasClearableCode(VM& vm) const
</span><span class="cx"> {
</span><del>-#if ENABLE(JIT)
</del><span class="cx">     if (m_jitCodeForCall
</span><span class="cx">         || m_jitCodeForConstruct
</span><span class="cx">         || m_jitCodeForCallWithArityCheck
</span><span class="cx">         || m_jitCodeForConstructWithArityCheck)
</span><span class="cx">         return true;
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx">     if (structure(vm)->classInfo() == FunctionExecutable::info()) {
</span><span class="cx">         auto* executable = static_cast<const FunctionExecutable*>(this);
</span><span class="lines">@@ -322,7 +315,7 @@
</span><span class="cx">     DebuggerMode debuggerMode = globalObject->hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
</span><span class="cx">     UnlinkedFunctionCodeBlock* unlinkedCodeBlock = 
</span><span class="cx">         executable->m_unlinkedExecutable->unlinkedCodeBlockFor(
</span><del>-            *vm, executable->m_source, kind, debuggerMode, error, 
</del><ins>+            *vm, executable->source(), kind, debuggerMode, error, 
</ins><span class="cx">             executable->parseMode());
</span><span class="cx">     recordParse(
</span><span class="cx">         executable->m_unlinkedExecutable->features(), 
</span><span class="lines">@@ -331,7 +324,7 @@
</span><span class="cx">     if (!unlinkedCodeBlock) {
</span><span class="cx">         exception = throwException(
</span><span class="cx">             globalObject->globalExec(), throwScope,
</span><del>-            error.toErrorObject(globalObject, executable->m_source));
</del><ins>+            error.toErrorObject(globalObject, executable->source()));
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -459,7 +452,42 @@
</span><span class="cx">         return jsCast<const FunctionExecutable*>(this)->typeProfilingEndOffset(vm);
</span><span class="cx">     if (inherits<EvalExecutable>(vm))
</span><span class="cx">         return UINT_MAX;
</span><del>-    return m_source.length() - 1;
</del><ins>+    return source().length() - 1;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ScriptExecutable::recordParse(CodeFeatures features, bool hasCapturedVariables, int lastLine, unsigned endColumn)
+{
+    switch (type()) {
+    case FunctionExecutableType:
+        // Since UnlinkedFunctionExecutable holds the information to calculate lastLine and endColumn, we do not need to remember them in ScriptExecutable's fields.
+        jsCast<FunctionExecutable*>(this)->recordParse(features, hasCapturedVariables);
+        return;
+    default:
+        jsCast<GlobalExecutable*>(this)->recordParse(features, hasCapturedVariables, lastLine, endColumn);
+        return;
+    }
+}
+
+int ScriptExecutable::lastLine() const
+{
+    switch (type()) {
+    case FunctionExecutableType:
+        return jsCast<const FunctionExecutable*>(this)->lastLine();
+    default:
+        return jsCast<const GlobalExecutable*>(this)->lastLine();
+    }
+    return 0;
+}
+
+unsigned ScriptExecutable::endColumn() const
+{
+    switch (type()) {
+    case FunctionExecutableType:
+        return jsCast<const FunctionExecutable*>(this)->endColumn();
+    default:
+        return jsCast<const GlobalExecutable*>(this)->endColumn();
+    }
+    return 0;
+}
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeScriptExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ScriptExecutable.h (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ScriptExecutable.h   2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/runtime/ScriptExecutable.h      2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -45,9 +45,9 @@
</span><span class="cx">     const SourceOrigin& sourceOrigin() const { return m_source.provider()->sourceOrigin(); }
</span><span class="cx">     const String& sourceURL() const { return m_source.provider()->url(); }
</span><span class="cx">     int firstLine() const { return m_source.firstLine().oneBasedInt(); }
</span><del>-    int lastLine() const { return m_lastLine; }
</del><ins>+    JS_EXPORT_PRIVATE int lastLine() const;
</ins><span class="cx">     unsigned startColumn() const { return m_source.startColumn().oneBasedInt(); }
</span><del>-    unsigned endColumn() const { return m_endColumn; }
</del><ins>+    JS_EXPORT_PRIVATE unsigned endColumn() const;
</ins><span class="cx"> 
</span><span class="cx">     Optional<int> overrideLineNumber(VM&) const;
</span><span class="cx">     unsigned typeProfilingStartOffset(VM&) const;
</span><span class="lines">@@ -81,15 +81,7 @@
</span><span class="cx">         
</span><span class="cx">     DECLARE_EXPORT_INFO;
</span><span class="cx"> 
</span><del>-    void recordParse(CodeFeatures features, bool hasCapturedVariables, int lastLine, unsigned endColumn)
-    {
-        m_features = features;
-        m_hasCapturedVariables = hasCapturedVariables;
-        m_lastLine = lastLine;
-        ASSERT(endColumn != UINT_MAX);
-        m_endColumn = endColumn;
-    }
-
</del><ins>+    void recordParse(CodeFeatures, bool hasCapturedVariables, int lastLine, unsigned endColumn);
</ins><span class="cx">     void installCode(CodeBlock*);
</span><span class="cx">     void installCode(VM&, CodeBlock*, CodeType, CodeSpecializationKind);
</span><span class="cx">     CodeBlock* newCodeBlockFor(CodeSpecializationKind, JSFunction*, JSScope*, Exception*&);
</span><span class="lines">@@ -102,15 +94,13 @@
</span><span class="cx">         return m_intrinsic;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static constexpr int NUM_PARAMETERS_NOT_COMPILED = -1;
-
</del><span class="cx">     bool hasJITCodeForCall() const
</span><span class="cx">     {
</span><del>-        return m_numParametersForCall >= 0;
</del><ins>+        return m_jitCodeForCall;
</ins><span class="cx">     }
</span><span class="cx">     bool hasJITCodeForConstruct() const
</span><span class="cx">     {
</span><del>-        return m_numParametersForConstruct >= 0;
</del><ins>+        return m_jitCodeForConstruct;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // This function has an interesting GC story. Callers of this function are asking us to create a CodeBlock
</span><span class="lines">@@ -141,14 +131,13 @@
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    void recordParse(CodeFeatures features, bool hasCapturedVariables)
+    {
+        m_features = features;
+        m_hasCapturedVariables = hasCapturedVariables;
+    }
+
</ins><span class="cx">     SourceCode m_source;
</span><del>-
-    int m_numParametersForCall { NUM_PARAMETERS_NOT_COMPILED };
-    int m_numParametersForConstruct { NUM_PARAMETERS_NOT_COMPILED };
-
-    int m_lastLine { -1 };
-    unsigned m_endColumn { UINT_MAX };
-
</del><span class="cx">     Intrinsic m_intrinsic { NoIntrinsic };
</span><span class="cx">     bool m_didTryToEnterInLoop { false };
</span><span class="cx">     CodeFeatures m_features;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretoolsFunctionOverridesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tools/FunctionOverrides.h (243364 => 243365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tools/FunctionOverrides.h    2019-03-22 06:45:20 UTC (rev 243364)
+++ trunk/Source/JavaScriptCore/tools/FunctionOverrides.h       2019-03-22 07:14:43 UTC (rev 243365)
</span><span class="lines">@@ -33,18 +33,20 @@
</span><span class="cx"> 
</span><span class="cx"> class ScriptExecutable;
</span><span class="cx"> 
</span><ins>+struct FunctionOverrideInfo {
+    SourceCode sourceCode;
+    unsigned firstLine;
+    unsigned lineCount;
+    unsigned startColumn;
+    unsigned endColumn;
+    unsigned parametersStartOffset;
+    unsigned typeProfilingStartOffset;
+    unsigned typeProfilingEndOffset;
+};
+
</ins><span class="cx"> class FunctionOverrides {
</span><span class="cx"> public:
</span><del>-    struct OverrideInfo {
-        SourceCode sourceCode;
-        unsigned firstLine;
-        unsigned lineCount;
-        unsigned startColumn;
-        unsigned endColumn;
-        unsigned parametersStartOffset;
-        unsigned typeProfilingStartOffset;
-        unsigned typeProfilingEndOffset;
-    };
</del><ins>+    using OverrideInfo = FunctionOverrideInfo;
</ins><span class="cx"> 
</span><span class="cx">     static FunctionOverrides& overrides();
</span><span class="cx">     FunctionOverrides(const char* functionOverridesFileName);
</span></span></pre>
</div>
</div>

</body>
</html>