Ignore:
Timestamp:
Mar 22, 2019, 12:14:43 AM (6 years ago)
Author:
[email protected]
Message:

[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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/tools/FunctionOverrides.h

    r218794 r243365  
    3434class ScriptExecutable;
    3535
     36struct FunctionOverrideInfo {
     37    SourceCode sourceCode;
     38    unsigned firstLine;
     39    unsigned lineCount;
     40    unsigned startColumn;
     41    unsigned endColumn;
     42    unsigned parametersStartOffset;
     43    unsigned typeProfilingStartOffset;
     44    unsigned typeProfilingEndOffset;
     45};
     46
    3647class FunctionOverrides {
    3748public:
    38     struct OverrideInfo {
    39         SourceCode sourceCode;
    40         unsigned firstLine;
    41         unsigned lineCount;
    42         unsigned startColumn;
    43         unsigned endColumn;
    44         unsigned parametersStartOffset;
    45         unsigned typeProfilingStartOffset;
    46         unsigned typeProfilingEndOffset;
    47     };
     49    using OverrideInfo = FunctionOverrideInfo;
    4850
    4951    static FunctionOverrides& overrides();
Note: See TracChangeset for help on using the changeset viewer.