Ignore:
Timestamp:
Nov 15, 2016, 11:04:22 AM (9 years ago)
Author:
[email protected]
Message:

CodeCache should stop pretending to cache builtins
https://bugs.webkit.org/show_bug.cgi?id=164750

Reviewed by Saam Barati.

We were passing JSParserBuiltinMode to all CodeCache functions, but the
passed-in value was always NotBuiltin.

Let's stop passing it.

  • parser/SourceCodeKey.h:

(JSC::SourceCodeFlags::SourceCodeFlags):
(JSC::SourceCodeKey::SourceCodeKey):

  • runtime/CodeCache.cpp:

(JSC::CodeCache::getUnlinkedGlobalCodeBlock):
(JSC::CodeCache::getUnlinkedProgramCodeBlock):
(JSC::CodeCache::getUnlinkedGlobalEvalCodeBlock):
(JSC::CodeCache::getUnlinkedModuleProgramCodeBlock):
(JSC::CodeCache::getUnlinkedGlobalFunctionExecutable):

  • runtime/CodeCache.h:

(JSC::generateUnlinkedCodeBlock):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::createProgramCodeBlock):
(JSC::JSGlobalObject::createLocalEvalCodeBlock):
(JSC::JSGlobalObject::createGlobalEvalCodeBlock):
(JSC::JSGlobalObject::createModuleProgramCodeBlock):

File:
1 edited

Legend:

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

    r206525 r208736  
    3939    SourceCodeFlags() = default;
    4040
    41     SourceCodeFlags(SourceCodeType codeType, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, JSParserScriptMode scriptMode, DerivedContextType derivedContextType, EvalContextType evalContextType, bool isArrowFunctionContext)
     41    SourceCodeFlags(SourceCodeType codeType, JSParserStrictMode strictMode, JSParserScriptMode scriptMode, DerivedContextType derivedContextType, EvalContextType evalContextType, bool isArrowFunctionContext)
    4242        : m_flags(
    43             (static_cast<unsigned>(scriptMode) << 8) |
    44             (static_cast<unsigned>(isArrowFunctionContext) << 7) |
    45             (static_cast<unsigned>(evalContextType) << 6) |
    46             (static_cast<unsigned>(derivedContextType) << 4) |
    47             (static_cast<unsigned>(codeType) << 2) |
    48             (static_cast<unsigned>(builtinMode) << 1) |
     43            (static_cast<unsigned>(scriptMode) << 5) |
     44            (static_cast<unsigned>(isArrowFunctionContext) << 4) |
     45            (static_cast<unsigned>(evalContextType) << 3) |
     46            (static_cast<unsigned>(derivedContextType) << 2) |
     47            (static_cast<unsigned>(codeType) << 1) |
    4948            (static_cast<unsigned>(strictMode))
    5049        )
     
    6766    }
    6867
    69     SourceCodeKey(const SourceCode& sourceCode, const String& name, SourceCodeType codeType, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, JSParserScriptMode scriptMode, DerivedContextType derivedContextType, EvalContextType evalContextType, bool isArrowFunctionContext)
     68    SourceCodeKey(const SourceCode& sourceCode, const String& name, SourceCodeType codeType, JSParserStrictMode strictMode, JSParserScriptMode scriptMode, DerivedContextType derivedContextType, EvalContextType evalContextType, bool isArrowFunctionContext)
    7069        : m_sourceCode(sourceCode)
    7170        , m_name(name)
    72         , m_flags(codeType, builtinMode, strictMode, scriptMode, derivedContextType, evalContextType, isArrowFunctionContext)
     71        , m_flags(codeType, strictMode, scriptMode, derivedContextType, evalContextType, isArrowFunctionContext)
    7372        , m_hash(sourceCode.hash())
    7473    {
Note: See TracChangeset for help on using the changeset viewer.