⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 237492 in webkit


Ignore:
Timestamp:
Oct 27, 2018, 7:41:22 AM (8 years ago)
Author:
yusukesuzuki@slowstart.org
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.
It also does not include any Parser.{h,cpp} changes to ensure that Parser.cpp's inlining decision
seems culprit of the regression on iOS devices.

  • bytecode/UnlinkedFunctionExecutable.cpp:

(JSC::UnlinkedFunctionExecutable::fromGlobalCode):

  • bytecode/UnlinkedFunctionExecutable.h:
  • 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:
Location:
trunk/Source/JavaScriptCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r237486 r237492  
     12018-10-27  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
     2
     3        Unreviewed, partial rolling in r237254
     4        https://bugs.webkit.org/show_bug.cgi?id=190340
     5
     6        We do not use the added function right now to investigate what is the reason of the regression.
     7        It also does not include any Parser.{h,cpp} changes to ensure that Parser.cpp's inlining decision
     8        seems culprit of the regression on iOS devices.
     9
     10        * bytecode/UnlinkedFunctionExecutable.cpp:
     11        (JSC::UnlinkedFunctionExecutable::fromGlobalCode):
     12        * bytecode/UnlinkedFunctionExecutable.h:
     13        * parser/SourceCodeKey.h:
     14        (JSC::SourceCodeKey::SourceCodeKey):
     15        (JSC::SourceCodeKey::operator== const):
     16        * runtime/CodeCache.cpp:
     17        (JSC::CodeCache::getUnlinkedGlobalCodeBlock):
     18        (JSC::CodeCache::getUnlinkedGlobalFunctionExecutable):
     19        * runtime/CodeCache.h:
     20        * runtime/FunctionConstructor.cpp:
     21        (JSC::constructFunctionSkippingEvalEnabledCheck):
     22        * runtime/FunctionExecutable.cpp:
     23        (JSC::FunctionExecutable::fromGlobalCode):
     24        * runtime/FunctionExecutable.h:
     25
    1262018-10-26  Commit Queue  <commit-queue@webkit.org>
    227
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp

    r237478 r237492  
    175175UnlinkedFunctionExecutable* UnlinkedFunctionExecutable::fromGlobalCode(
    176176    const Identifier& name, ExecState& exec, const SourceCode& source,
    177     JSObject*& exception, int overrideLineNumber)
     177    JSObject*& exception, int overrideLineNumber, std::optional<int> functionConstructorParametersEndPosition)
    178178{
    179179    ParserError error;
    … …  
    182182    CodeCache* codeCache = vm.codeCache();
    183183    DebuggerMode debuggerMode = globalObject.hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
    184     UnlinkedFunctionExecutable* executable = codeCache->getUnlinkedGlobalFunctionExecutable(vm, name, source, debuggerMode, error);
     184    UnlinkedFunctionExecutable* executable = codeCache->getUnlinkedGlobalFunctionExecutable(vm, name, source, debuggerMode, functionConstructorParametersEndPosition, error);
    185185
    186186    if (globalObject.hasDebugger())
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h

    r237478 r237492  
    108108    static UnlinkedFunctionExecutable* fromGlobalCode(
    109109        const Identifier&, ExecState&, const SourceCode&, JSObject*& exception,
    110         int overrideLineNumber);
     110        int overrideLineNumber, std::optional<int> functionConstructorParametersEndPosition);
    111111
    112112    JS_EXPORT_PRIVATE FunctionExecutable* link(VM&, const SourceCode& parentSource, std::optional<int> overrideLineNumber = std::nullopt, Intrinsic = NoIntrinsic);
  • trunk/Source/JavaScriptCore/parser/SourceCodeKey.h

    r237478 r237492  
    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
  • trunk/Source/JavaScriptCore/runtime/CodeCache.cpp

    r237478 r237492  
    5858        derivedContextType, evalContextType, isArrowFunctionContext, debuggerMode,
    5959        vm.typeProfiler() ? TypeProfilerEnabled::Yes : TypeProfilerEnabled::No,
    60         vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No);
     60        vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No,
     61        std::nullopt);
    6162    SourceCodeValue* cache = m_sourceCode.findCacheAndUpdateAge(key);
    6263    if (cache && Options::useCodeCache()) {
    … …  
    9697}
    9798
    98 UnlinkedFunctionExecutable* CodeCache::getUnlinkedGlobalFunctionExecutable(VM& vm, const Identifier& name, const SourceCode& source, DebuggerMode debuggerMode, ParserError& error)
     99UnlinkedFunctionExecutable* CodeCache::getUnlinkedGlobalFunctionExecutable(VM& vm, const Identifier& name, const SourceCode& source, DebuggerMode debuggerMode, std::optional<int> functionConstructorParametersEndPosition, ParserError& error)
    99100{
    100101    bool isArrowFunctionContext = false;
    … …  
    108109        debuggerMode,
    109110        vm.typeProfiler() ? TypeProfilerEnabled::Yes : TypeProfilerEnabled::No,
    110         vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No);
     111        vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No,
     112        functionConstructorParametersEndPosition);
    111113    SourceCodeValue* cache = m_sourceCode.findCacheAndUpdateAge(key);
    112114    if (cache && Options::useCodeCache()) {
  • trunk/Source/JavaScriptCore/runtime/CodeCache.h

    r237478 r237492  
    195195    UnlinkedEvalCodeBlock* getUnlinkedEvalCodeBlock(VM&, IndirectEvalExecutable*, const SourceCode&, JSParserStrictMode, DebuggerMode, ParserError&, EvalContextType);
    196196    UnlinkedModuleProgramCodeBlock* getUnlinkedModuleProgramCodeBlock(VM&, ModuleProgramExecutable*, const SourceCode&, DebuggerMode, ParserError&);
    197     UnlinkedFunctionExecutable* getUnlinkedGlobalFunctionExecutable(VM&, const Identifier&, const SourceCode&, DebuggerMode, ParserError&);
     197    UnlinkedFunctionExecutable* getUnlinkedGlobalFunctionExecutable(VM&, const Identifier&, const SourceCode&, DebuggerMode, std::optional<int> functionConstructorParametersEndPosition, ParserError&);
    198198
    199199    void clear() { m_sourceCode.clear(); }
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp

    r237478 r237492  
    170170    SourceCode source = makeSource(program, sourceOrigin, sourceURL, position);
    171171    JSObject* exception = nullptr;
    172     FunctionExecutable* function = FunctionExecutable::fromGlobalCode(functionName, *exec, source, exception, overrideLineNumber);
     172    FunctionExecutable* function = FunctionExecutable::fromGlobalCode(functionName, *exec, source, exception, overrideLineNumber, std::nullopt);
    173173    if (!function) {
    174174        ASSERT(exception);
  • trunk/Source/JavaScriptCore/runtime/FunctionExecutable.cpp

    r237478 r237492  
    9595FunctionExecutable* FunctionExecutable::fromGlobalCode(
    9696    const Identifier& name, ExecState& exec, const SourceCode& source,
    97     JSObject*& exception, int overrideLineNumber)
     97    JSObject*& exception, int overrideLineNumber, std::optional<int> functionConstructorParametersEndPosition)
    9898{
    9999    UnlinkedFunctionExecutable* unlinkedExecutable =
    100100        UnlinkedFunctionExecutable::fromGlobalCode(
    101             name, exec, source, exception, overrideLineNumber);
     101            name, exec, source, exception, overrideLineNumber, functionConstructorParametersEndPosition);
    102102    if (!unlinkedExecutable)
    103103        return nullptr;
  • trunk/Source/JavaScriptCore/runtime/FunctionExecutable.h

    r237478 r237492  
    5656    static FunctionExecutable* fromGlobalCode(
    5757        const Identifier& name, ExecState&, const SourceCode&,
    58         JSObject*& exception, int overrideLineNumber);
     58        JSObject*& exception, int overrideLineNumber, std::optional<int> functionConstructorParametersEndPosition);
    5959
    6060    static void destroy(JSCell*);
Note: See TracChangeset for help on using the changeset viewer.