Changeset 245288 in webkit


Ignore:
Timestamp:
May 14, 2019 10:31:53 AM (5 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
https://bugs.webkit.org/show_bug.cgi?id=197833

Reviewed by Darin Adler.

JSTests:

  • stress/generator-name.js: Added.

(shouldBe):
(gen):
(catch):

Source/JavaScriptCore:

It turns out that Gmail creates so many JSFunctions, FunctionExecutables, and UnlinkedFunctionExecutables.
So we should shrink size of them to save memory. As a first step, this patch reduces the sizeof(UnlinkedFunctionExecutable) more by 16 bytes.

  1. We reorder some fields to get 8 bytes. And we use 31 bits for xxx offset things since their maximum size should be within 31 bits due to String's length & int32_t representation in our parser.
  1. We drop m_inferredName and prefer m_ecmaName. The inferred name is used to offer better function name when the function expression lacks the name, but now ECMAScript has a specified semantics to name those functions with intuitive names. We should use ecmaName consistently, and should not eat 8 bytes for inferred names in UnlinkedFunctionExecutable.

We also fix generator ecma name.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::inferredName const):

  • bytecode/InlineCallFrame.cpp:

(JSC::InlineCallFrame::inferredName const):

  • bytecode/UnlinkedFunctionExecutable.cpp:

(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):

  • bytecode/UnlinkedFunctionExecutable.h:
  • parser/ASTBuilder.h:

(JSC::ASTBuilder::createAssignResolve):
(JSC::ASTBuilder::createGeneratorFunctionBody):
(JSC::ASTBuilder::createGetterOrSetterProperty):
(JSC::ASTBuilder::createProperty):
(JSC::ASTBuilder::tryInferNameInPatternWithIdentifier):
(JSC::ASTBuilder::makeAssignNode):

  • parser/Nodes.cpp:

(JSC::FunctionMetadataNode::operator== const):
(JSC::FunctionMetadataNode::dump const):

  • parser/Nodes.h:
  • runtime/CachedTypes.cpp:

(JSC::CachedFunctionExecutable::ecmaName const):
(JSC::CachedFunctionExecutable::encode):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::CachedFunctionExecutable::inferredName const): Deleted.

  • runtime/FunctionExecutable.h:
  • runtime/FunctionExecutableDump.cpp:

(JSC::FunctionExecutableDump::dump const):

  • runtime/JSFunction.cpp:

(JSC::JSFunction::calculatedDisplayName):
(JSC::getCalculatedDisplayName):

  • runtime/SamplingProfiler.cpp:

(JSC::SamplingProfiler::StackFrame::displayName):
(JSC::SamplingProfiler::StackFrame::displayNameForJSONTests):

Source/WebCore:

  • testing/Internals.cpp:

(WebCore::Internals::parserMetaData):

Location:
trunk
Files:
1 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r245249 r245288  
     12019-05-14  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
     4        https://bugs.webkit.org/show_bug.cgi?id=197833
     5
     6        Reviewed by Darin Adler.
     7
     8        * stress/generator-name.js: Added.
     9        (shouldBe):
     10        (gen):
     11        (catch):
     12
    1132019-05-13  Tadeu Zagallo  <tzagallo@apple.com>
    214
  • trunk/Source/JavaScriptCore/ChangeLog

    r245270 r245288  
     12019-05-14  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
     4        https://bugs.webkit.org/show_bug.cgi?id=197833
     5
     6        Reviewed by Darin Adler.
     7
     8        It turns out that Gmail creates so many JSFunctions, FunctionExecutables, and UnlinkedFunctionExecutables.
     9        So we should shrink size of them to save memory. As a first step, this patch reduces the sizeof(UnlinkedFunctionExecutable) more by 16 bytes.
     10
     11        1. We reorder some fields to get 8 bytes. And we use 31 bits for xxx offset things since their maximum size should be within 31 bits due to
     12           String's length & int32_t representation in our parser.
     13
     14        2. We drop m_inferredName and prefer m_ecmaName. The inferred name is used to offer better function name when the function expression lacks
     15           the name, but now ECMAScript has a specified semantics to name those functions with intuitive names. We should use ecmaName consistently,
     16           and should not eat 8 bytes for inferred names in UnlinkedFunctionExecutable.
     17
     18        We also fix generator ecma name.
     19
     20        * bytecode/CodeBlock.cpp:
     21        (JSC::CodeBlock::inferredName const):
     22        * bytecode/InlineCallFrame.cpp:
     23        (JSC::InlineCallFrame::inferredName const):
     24        * bytecode/UnlinkedFunctionExecutable.cpp:
     25        (JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
     26        * bytecode/UnlinkedFunctionExecutable.h:
     27        * parser/ASTBuilder.h:
     28        (JSC::ASTBuilder::createAssignResolve):
     29        (JSC::ASTBuilder::createGeneratorFunctionBody):
     30        (JSC::ASTBuilder::createGetterOrSetterProperty):
     31        (JSC::ASTBuilder::createProperty):
     32        (JSC::ASTBuilder::tryInferNameInPatternWithIdentifier):
     33        (JSC::ASTBuilder::makeAssignNode):
     34        * parser/Nodes.cpp:
     35        (JSC::FunctionMetadataNode::operator== const):
     36        (JSC::FunctionMetadataNode::dump const):
     37        * parser/Nodes.h:
     38        * runtime/CachedTypes.cpp:
     39        (JSC::CachedFunctionExecutable::ecmaName const):
     40        (JSC::CachedFunctionExecutable::encode):
     41        (JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
     42        (JSC::CachedFunctionExecutable::inferredName const): Deleted.
     43        * runtime/FunctionExecutable.h:
     44        * runtime/FunctionExecutableDump.cpp:
     45        (JSC::FunctionExecutableDump::dump const):
     46        * runtime/JSFunction.cpp:
     47        (JSC::JSFunction::calculatedDisplayName):
     48        (JSC::getCalculatedDisplayName):
     49        * runtime/SamplingProfiler.cpp:
     50        (JSC::SamplingProfiler::StackFrame::displayName):
     51        (JSC::SamplingProfiler::StackFrame::displayNameForJSONTests):
     52
    1532019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
    254
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r245239 r245288  
    123123        return "<eval>";
    124124    case FunctionCode:
    125         return jsCast<FunctionExecutable*>(ownerExecutable())->inferredName().utf8();
     125        return jsCast<FunctionExecutable*>(ownerExecutable())->ecmaName().utf8();
    126126    case ModuleCode:
    127127        return "<module>";
  • trunk/Source/JavaScriptCore/bytecode/InlineCallFrame.cpp

    r243232 r245288  
    5757CString InlineCallFrame::inferredName() const
    5858{
    59     return jsCast<FunctionExecutable*>(baselineCodeBlock->ownerExecutable())->inferredName().utf8();
     59    return jsCast<FunctionExecutable*>(baselineCodeBlock->ownerExecutable())->ecmaName().utf8();
    6060}
    6161
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp

    r245040 r245288  
    8585    : Base(*vm, structure)
    8686    , m_firstLineOffset(node->firstLine() - parentSource.firstLine().oneBasedInt())
     87    , m_isInStrictContext(node->isInStrictContext())
    8788    , m_lineCount(node->lastLine() - node->firstLine())
     89    , m_hasCapturedVariables(false)
    8890    , m_unlinkedFunctionNameStart(node->functionNameStart() - parentSource.startOffset())
     91    , m_isBuiltinFunction(kind == UnlinkedBuiltinFunction)
    8992    , m_unlinkedBodyStartColumn(node->startColumn())
     93    , m_isBuiltinDefaultClassConstructor(isBuiltinDefaultClassConstructor)
    9094    , m_unlinkedBodyEndColumn(m_lineCount ? node->endColumn() : node->endColumn() - node->startColumn())
     95    , m_constructAbility(static_cast<unsigned>(constructAbility))
    9196    , m_startOffset(node->source().startOffset() - parentSource.startOffset())
     97    , m_scriptMode(static_cast<unsigned>(scriptMode))
    9298    , m_sourceLength(node->source().length())
     99    , m_superBinding(static_cast<unsigned>(node->superBinding()))
    93100    , m_parametersStartOffset(node->parametersStart())
     101    , m_isCached(false)
    94102    , m_typeProfilingStartOffset(node->functionKeywordStart())
    95103    , m_typeProfilingEndOffset(node->startStartOffset() + node->source().length() - 1)
     
    97105    , m_features(0)
    98106    , m_sourceParseMode(node->parseMode())
    99     , m_isInStrictContext(node->isInStrictContext())
    100     , m_hasCapturedVariables(false)
    101     , m_isBuiltinFunction(kind == UnlinkedBuiltinFunction)
    102     , m_isBuiltinDefaultClassConstructor(isBuiltinDefaultClassConstructor)
    103     , m_constructAbility(static_cast<unsigned>(constructAbility))
    104107    , m_constructorKind(static_cast<unsigned>(node->constructorKind()))
    105108    , m_functionMode(static_cast<unsigned>(node->functionMode()))
    106     , m_scriptMode(static_cast<unsigned>(scriptMode))
    107     , m_superBinding(static_cast<unsigned>(node->superBinding()))
    108109    , m_derivedContextType(static_cast<unsigned>(derivedContextType))
    109     , m_isCached(false)
    110110    , m_unlinkedCodeBlockForCall()
    111111    , m_unlinkedCodeBlockForConstruct()
    112112    , m_name(node->ident())
    113113    , m_ecmaName(node->ecmaName())
    114     , m_inferredName(node->inferredName())
    115114{
    116115    // Make sure these bitfields are adequately wide.
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h

    r245040 r245288  
    8282    const Identifier& ecmaName() const { return m_ecmaName; }
    8383    void setEcmaName(const Identifier& name) { m_ecmaName = name; }
    84     const Identifier& inferredName() const { return m_inferredName; }
    8584    unsigned parameterCount() const { return m_parameterCount; }; // Excluding 'this'!
    8685    SourceParseMode parseMode() const { return static_cast<SourceParseMode>(m_sourceParseMode); };
     
    206205    void decodeCachedCodeBlocks();
    207206
    208     unsigned m_firstLineOffset;
    209     unsigned m_lineCount;
    210     unsigned m_unlinkedFunctionNameStart;
    211     unsigned m_unlinkedBodyStartColumn;
    212     unsigned m_unlinkedBodyEndColumn;
    213     unsigned m_startOffset;
    214     unsigned m_sourceLength;
    215     unsigned m_parametersStartOffset;
     207    unsigned m_firstLineOffset : 31;
     208    unsigned m_isInStrictContext : 1;
     209    unsigned m_lineCount : 31;
     210    unsigned m_hasCapturedVariables : 1;
     211    unsigned m_unlinkedFunctionNameStart : 31;
     212    unsigned m_isBuiltinFunction : 1;
     213    unsigned m_unlinkedBodyStartColumn : 31;
     214    unsigned m_isBuiltinDefaultClassConstructor : 1;
     215    unsigned m_unlinkedBodyEndColumn : 31;
     216    unsigned m_constructAbility: 1;
     217    unsigned m_startOffset : 31;
     218    unsigned m_scriptMode: 1; // JSParserScriptMode
     219    unsigned m_sourceLength : 31;
     220    unsigned m_superBinding : 1;
     221    unsigned m_parametersStartOffset : 31;
     222    unsigned m_isCached : 1;
    216223    unsigned m_typeProfilingStartOffset;
    217224    unsigned m_typeProfilingEndOffset;
     
    219226    CodeFeatures m_features;
    220227    SourceParseMode m_sourceParseMode;
    221     unsigned m_isInStrictContext : 1;
    222     unsigned m_hasCapturedVariables : 1;
    223     unsigned m_isBuiltinFunction : 1;
    224     unsigned m_isBuiltinDefaultClassConstructor : 1;
    225     unsigned m_constructAbility: 1;
    226228    unsigned m_constructorKind : 2;
    227229    unsigned m_functionMode : 2; // FunctionMode
    228     unsigned m_scriptMode: 1; // JSParserScriptMode
    229     unsigned m_superBinding : 1;
    230230    unsigned m_derivedContextType: 2;
    231     bool m_isCached : 1;
    232231
    233232    union {
     
    246245    Identifier m_name;
    247246    Identifier m_ecmaName;
    248     Identifier m_inferredName;
    249247
    250248    RareData& ensureRareData()
  • trunk/Source/JavaScriptCore/parser/ASTBuilder.h

    r245040 r245288  
    371371            auto metadata = static_cast<BaseFuncExprNode*>(rhs)->metadata();
    372372            metadata->setEcmaName(ident);
    373             metadata->setInferredName(ident);
    374373        } else if (rhs->isClassExprNode())
    375374            static_cast<ClassExprNode*>(rhs)->setEcmaName(ident);
     
    418417        FuncExprNode* result = static_cast<FuncExprNode*>(createFunctionExpr(location, functionInfo));
    419418        if (!name.isNull())
    420             result->metadata()->setInferredName(name);
     419            result->metadata()->setEcmaName(name);
    421420        return result;
    422421    }
     
    476475        functionInfo.body->setLoc(functionInfo.startLine, functionInfo.endLine, location.startOffset, location.lineStartOffset);
    477476        functionInfo.body->setEcmaName(*name);
    478         functionInfo.body->setInferredName(*name);
    479477        SourceCode source = m_sourceCode->subExpression(functionInfo.startOffset, functionInfo.endOffset, functionInfo.startLine, functionInfo.parametersStartColumn);
    480478        MethodDefinitionNode* methodDef = new (m_parserArena) MethodDefinitionNode(location, m_vm->propertyNames->nullIdentifier, functionInfo.body, source);
     
    508506                auto metadata = static_cast<BaseFuncExprNode*>(node)->metadata();
    509507                metadata->setEcmaName(*propertyName);
    510                 metadata->setInferredName(*propertyName);
    511508            } else if (node->isClassExprNode())
    512509                static_cast<ClassExprNode*>(node)->setEcmaName(*propertyName);
     
    11161113            auto metadata = static_cast<BaseFuncExprNode*>(defaultValue)->metadata();
    11171114            metadata->setEcmaName(ident);
    1118             metadata->setInferredName(ident);
    11191115        } else if (defaultValue->isClassExprNode())
    11201116            static_cast<ClassExprNode*>(defaultValue)->setEcmaName(ident);
     
    14811477                auto metadata = static_cast<BaseFuncExprNode*>(expr)->metadata();
    14821478                metadata->setEcmaName(resolve->identifier());
    1483                 metadata->setInferredName(resolve->identifier());
    14841479            } else if (expr->isClassExprNode())
    14851480                static_cast<ClassExprNode*>(expr)->setEcmaName(resolve->identifier());
     
    15001495    ASSERT(loc->isDotAccessorNode());
    15011496    DotAccessorNode* dot = static_cast<DotAccessorNode*>(loc);
    1502     if (op == OpEqual) {
    1503         if (expr->isBaseFuncExprNode()) {
    1504             // We don't also set the ecma name here because ES6 specifies that the
    1505             // function should not pick up the name of the dot->identifier().
    1506             static_cast<BaseFuncExprNode*>(expr)->metadata()->setInferredName(dot->identifier());
    1507         }
     1497    if (op == OpEqual)
    15081498        return new (m_parserArena) AssignDotNode(location, dot->base(), dot->identifier(), expr, exprHasAssignments, dot->divot(), start, end);
    1509     }
    15101499
    15111500    ReadModifyDotNode* node = new (m_parserArena) ReadModifyDotNode(location, dot->base(), dot->identifier(), op, expr, exprHasAssignments, divot, start, end);
  • trunk/Source/JavaScriptCore/parser/Nodes.cpp

    r240641 r245288  
    258258        && m_ident == other.m_ident
    259259        && m_ecmaName == other.m_ecmaName
    260         && m_inferredName == other.m_inferredName
    261260        && m_functionMode== other.m_functionMode
    262261        && m_startColumn== other.m_startColumn
     
    282281    stream.println("m_ident ", m_ident);
    283282    stream.println("m_ecmaName ", m_ecmaName);
    284     stream.println("m_inferredName ", m_inferredName);
    285283    stream.println("m_functionMode ", static_cast<uint32_t>(m_functionMode));
    286284    stream.println("m_startColumn ", m_startColumn);
  • trunk/Source/JavaScriptCore/parser/Nodes.h

    r242812 r245288  
    19951995        void setEcmaName(const Identifier& ecmaName) { m_ecmaName = ecmaName; }
    19961996        const Identifier& ecmaName() { return m_ident.isEmpty() ? m_ecmaName : m_ident; }
    1997         void setInferredName(const Identifier& inferredName) { ASSERT(!inferredName.isNull()); m_inferredName = inferredName; }
    1998         const Identifier& inferredName() { return m_inferredName.isEmpty() ? m_ident : m_inferredName; }
    19991997
    20001998        FunctionMode functionMode() { return m_functionMode; }
     
    20432041        Identifier m_ident;
    20442042        Identifier m_ecmaName;
    2045         Identifier m_inferredName;
    20462043        unsigned m_startColumn;
    20472044        unsigned m_endColumn;
  • trunk/Source/JavaScriptCore/runtime/CachedTypes.cpp

    r245064 r245288  
    16421642    Identifier name(Decoder& decoder) const { return m_name.decode(decoder); }
    16431643    Identifier ecmaName(Decoder& decoder) const { return m_ecmaName.decode(decoder); }
    1644     Identifier inferredName(Decoder& decoder) const { return m_inferredName.decode(decoder); }
    16451644
    16461645    UnlinkedFunctionExecutable::RareData* rareData(Decoder& decoder) const { return m_rareData.decode(decoder); }
     
    16521651    CachedFunctionExecutableMetadata m_mutableMetadata;
    16531652
    1654     unsigned m_firstLineOffset;
    1655     unsigned m_lineCount;
    1656     unsigned m_unlinkedFunctionNameStart;
    1657     unsigned m_unlinkedBodyStartColumn;
    1658     unsigned m_unlinkedBodyEndColumn;
    1659     unsigned m_startOffset;
    1660     unsigned m_sourceLength;
    1661     unsigned m_parametersStartOffset;
     1653    unsigned m_firstLineOffset : 31;
     1654    unsigned m_isInStrictContext : 1;
     1655    unsigned m_lineCount : 31;
     1656    unsigned m_isBuiltinFunction : 1;
     1657    unsigned m_unlinkedFunctionNameStart : 31;
     1658    unsigned m_isBuiltinDefaultClassConstructor : 1;
     1659    unsigned m_unlinkedBodyStartColumn : 31;
     1660    unsigned m_constructAbility: 1;
     1661    unsigned m_unlinkedBodyEndColumn : 31;
     1662    unsigned m_startOffset : 31;
     1663    unsigned m_scriptMode: 1; // JSParserScriptMode
     1664    unsigned m_sourceLength : 31;
     1665    unsigned m_superBinding : 1;
     1666    unsigned m_parametersStartOffset : 31;
    16621667    unsigned m_typeProfilingStartOffset;
    16631668    unsigned m_typeProfilingEndOffset;
    16641669    unsigned m_parameterCount;
    16651670    SourceParseMode m_sourceParseMode;
    1666     unsigned m_isInStrictContext : 1;
    1667     unsigned m_isBuiltinFunction : 1;
    1668     unsigned m_isBuiltinDefaultClassConstructor : 1;
    1669     unsigned m_constructAbility: 1;
    16701671    unsigned m_constructorKind : 2;
    16711672    unsigned m_functionMode : 2; // FunctionMode
    1672     unsigned m_scriptMode: 1; // JSParserScriptMode
    1673     unsigned m_superBinding : 1;
    16741673    unsigned m_derivedContextType: 2;
    16751674
     
    16781677    CachedIdentifier m_name;
    16791678    CachedIdentifier m_ecmaName;
    1680     CachedIdentifier m_inferredName;
    16811679
    16821680    CachedWriteBarrier<CachedFunctionCodeBlock, UnlinkedFunctionCodeBlock> m_unlinkedCodeBlockForCall;
     
    20452043    m_name.encode(encoder, executable.name());
    20462044    m_ecmaName.encode(encoder, executable.ecmaName());
    2047     m_inferredName.encode(encoder, executable.inferredName());
    20482045
    20492046    m_unlinkedCodeBlockForCall.encode(encoder, executable.m_unlinkedCodeBlockForCall);
     
    20642061    : Base(decoder.vm(), decoder.vm().unlinkedFunctionExecutableStructure.get())
    20652062    , m_firstLineOffset(cachedExecutable.firstLineOffset())
     2063    , m_isInStrictContext(cachedExecutable.isInStrictContext())
    20662064    , m_lineCount(cachedExecutable.lineCount())
     2065    , m_hasCapturedVariables(cachedExecutable.hasCapturedVariables())
    20672066    , m_unlinkedFunctionNameStart(cachedExecutable.unlinkedFunctionNameStart())
     2067    , m_isBuiltinFunction(cachedExecutable.isBuiltinFunction())
    20682068    , m_unlinkedBodyStartColumn(cachedExecutable.unlinkedBodyStartColumn())
     2069    , m_isBuiltinDefaultClassConstructor(cachedExecutable.isBuiltinDefaultClassConstructor())
    20692070    , m_unlinkedBodyEndColumn(cachedExecutable.unlinkedBodyEndColumn())
     2071    , m_constructAbility(cachedExecutable.constructAbility())
    20702072    , m_startOffset(cachedExecutable.startOffset())
     2073    , m_scriptMode(cachedExecutable.scriptMode())
    20712074    , m_sourceLength(cachedExecutable.sourceLength())
     2075    , m_superBinding(cachedExecutable.superBinding())
    20722076    , m_parametersStartOffset(cachedExecutable.parametersStartOffset())
     2077    , m_isCached(false)
    20732078    , m_typeProfilingStartOffset(cachedExecutable.typeProfilingStartOffset())
    20742079    , m_typeProfilingEndOffset(cachedExecutable.typeProfilingEndOffset())
     
    20762081    , m_features(cachedExecutable.features())
    20772082    , m_sourceParseMode(cachedExecutable.sourceParseMode())
    2078     , m_isInStrictContext(cachedExecutable.isInStrictContext())
    2079     , m_hasCapturedVariables(cachedExecutable.hasCapturedVariables())
    2080     , m_isBuiltinFunction(cachedExecutable.isBuiltinFunction())
    2081     , m_isBuiltinDefaultClassConstructor(cachedExecutable.isBuiltinDefaultClassConstructor())
    2082     , m_constructAbility(cachedExecutable.constructAbility())
    20832083    , m_constructorKind(cachedExecutable.constructorKind())
    20842084    , m_functionMode(cachedExecutable.functionMode())
    2085     , m_scriptMode(cachedExecutable.scriptMode())
    2086     , m_superBinding(cachedExecutable.superBinding())
    20872085    , m_derivedContextType(cachedExecutable.derivedContextType())
    2088     , m_isCached(false)
    20892086    , m_unlinkedCodeBlockForCall()
    20902087    , m_unlinkedCodeBlockForConstruct()
     
    20922089    , m_name(cachedExecutable.name(decoder))
    20932090    , m_ecmaName(cachedExecutable.ecmaName(decoder))
    2094     , m_inferredName(cachedExecutable.inferredName(decoder))
    20952091
    20962092    , m_rareData(cachedExecutable.rareData(decoder))
  • trunk/Source/JavaScriptCore/runtime/FunctionExecutable.h

    r245040 r245288  
    162162    const Identifier& name() { return m_unlinkedExecutable->name(); }
    163163    const Identifier& ecmaName() { return m_unlinkedExecutable->ecmaName(); }
    164     const Identifier& inferredName() { return m_unlinkedExecutable->inferredName(); }
    165164    unsigned parameterCount() const { return m_unlinkedExecutable->parameterCount(); } // Excluding 'this'!
    166165    SourceParseMode parseMode() const { return m_unlinkedExecutable->parseMode(); }
  • trunk/Source/JavaScriptCore/runtime/FunctionExecutableDump.cpp

    r208309 r245288  
    3535void FunctionExecutableDump::dump(PrintStream& out) const
    3636{
    37     out.print(m_executable->inferredName().string(), "#");
     37    out.print(m_executable->ecmaName().string(), "#");
    3838    if (m_executable->isGeneratedForCall())
    3939        out.print(m_executable->codeBlockForCall()->hashAsStringIfPossible());
  • trunk/Source/JavaScriptCore/runtime/JSFunction.cpp

    r243886 r245288  
    228228        return actualName;
    229229
    230     return jsExecutable()->inferredName().string();
     230    return jsExecutable()->ecmaName().string();
    231231}
    232232
     
    652652            return actualName;
    653653
    654         return function->jsExecutable()->inferredName().string();
     654        return function->jsExecutable()->ecmaName().string();
    655655    }
    656656    if (auto* function = jsDynamicCast<InternalFunction*>(vm, object))
  • trunk/Source/JavaScriptCore/runtime/SamplingProfiler.cpp

    r244811 r245288  
    780780
    781781    if (executable->isFunctionExecutable())
    782         return static_cast<FunctionExecutable*>(executable)->inferredName().string();
     782        return static_cast<FunctionExecutable*>(executable)->ecmaName().string();
    783783    if (executable->isProgramExecutable() || executable->isEvalExecutable())
    784784        return "(program)"_s;
     
    807807
    808808    if (executable->isFunctionExecutable()) {
    809         String result = static_cast<FunctionExecutable*>(executable)->inferredName().string();
     809        String result = static_cast<FunctionExecutable*>(executable)->ecmaName().string();
    810810        if (result.isEmpty())
    811811            return "(anonymous function)"_s;
  • trunk/Source/WebCore/ChangeLog

    r245286 r245288  
     12019-05-14  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
     4        https://bugs.webkit.org/show_bug.cgi?id=197833
     5
     6        Reviewed by Darin Adler.
     7
     8        * testing/Internals.cpp:
     9        (WebCore::Internals::parserMetaData):
     10
    1112019-05-14  Antoine Quint  <graouts@apple.com>
    212
  • trunk/Source/WebCore/testing/Internals.cpp

    r245280 r245288  
    21602160    if (executable->isFunctionExecutable()) {
    21612161        FunctionExecutable* funcExecutable = reinterpret_cast<FunctionExecutable*>(executable);
    2162         String inferredName = funcExecutable->inferredName().string();
     2162        String inferredName = funcExecutable->ecmaName().string();
    21632163        result.appendLiteral("function \"");
    21642164        result.append(inferredName);
Note: See TracChangeset for help on using the changeset viewer.