Ignore:
Timestamp:
Oct 25, 2018, 9:51:59 PM (7 years ago)
Author:
[email protected]
Message:

Unreviewed, partial rolling in r237254
https://bugs.webkit.org/show_bug.cgi?id=190340

We do not use the added function right now to investigate what is the reason of the regression.
If it causes the regression, it seems that Parser.cpp's inlining decision seems culprit.

  • bytecode/UnlinkedFunctionExecutable.cpp:

(JSC::UnlinkedFunctionExecutable::fromGlobalCode):

  • bytecode/UnlinkedFunctionExecutable.h:
  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseSingleFunction):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseAsyncFunctionDeclaration):

  • parser/Parser.h:

(JSC::Parser<LexerType>::parse):
(JSC::parse):
(JSC::parseFunctionForFunctionConstructor):

  • parser/ParserModes.h:
  • parser/ParserTokens.h:

(JSC::JSTextPosition::JSTextPosition):
(JSC::JSTokenLocation::JSTokenLocation): Deleted.

  • parser/SourceCodeKey.h:

(JSC::SourceCodeKey::SourceCodeKey):
(JSC::SourceCodeKey::operator== const):

  • runtime/CodeCache.cpp:

(JSC::CodeCache::getUnlinkedGlobalCodeBlock):
(JSC::CodeCache::getUnlinkedGlobalFunctionExecutable):

  • runtime/CodeCache.h:
  • runtime/FunctionConstructor.cpp:

(JSC::constructFunctionSkippingEvalEnabledCheck):

  • runtime/FunctionExecutable.cpp:

(JSC::FunctionExecutable::fromGlobalCode):

  • runtime/FunctionExecutable.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/SourceCodeKey.h

    r237299 r237445  
    3030#include "UnlinkedSourceCode.h"
    3131#include <wtf/HashTraits.h>
     32#include <wtf/Hasher.h>
    3233
    3334namespace JSC {
     
    7273class SourceCodeKey {
    7374public:
    74     SourceCodeKey()
    75     {
    76     }
     75    SourceCodeKey() = default;
    7776
    7877    SourceCodeKey(
    7978        const UnlinkedSourceCode& sourceCode, const String& name, SourceCodeType codeType, JSParserStrictMode strictMode,
    8079        JSParserScriptMode scriptMode, DerivedContextType derivedContextType, EvalContextType evalContextType, bool isArrowFunctionContext,
    81         DebuggerMode debuggerMode, TypeProfilerEnabled typeProfilerEnabled, ControlFlowProfilerEnabled controlFlowProfilerEnabled)
     80        DebuggerMode debuggerMode, TypeProfilerEnabled typeProfilerEnabled, ControlFlowProfilerEnabled controlFlowProfilerEnabled, std::optional<int> functionConstructorParametersEndPosition)
    8281            : m_sourceCode(sourceCode)
    8382            , m_name(name)
    8483            , m_flags(codeType, strictMode, scriptMode, derivedContextType, evalContextType, isArrowFunctionContext, debuggerMode, typeProfilerEnabled, controlFlowProfilerEnabled)
    85             , m_hash(sourceCode.hash() ^ m_flags.bits())
     84            , m_functionConstructorParametersEndPosition(functionConstructorParametersEndPosition.value_or(-1))
     85            , m_hash(sourceCode.hash() ^ computeHash(m_flags.bits(), m_functionConstructorParametersEndPosition))
    8686    {
    8787    }
     
    109109            && length() == other.length()
    110110            && m_flags == other.m_flags
     111            && m_functionConstructorParametersEndPosition == other.m_functionConstructorParametersEndPosition
    111112            && m_name == other.m_name
    112113            && string() == other.string();
     
    128129    String m_name;
    129130    SourceCodeFlags m_flags;
    130     unsigned m_hash;
     131    int m_functionConstructorParametersEndPosition { -1 };
     132    unsigned m_hash { 0 };
    131133};
    132134
Note: See TracChangeset for help on using the changeset viewer.