Ignore:
Timestamp:
Mar 31, 2022, 6:25:02 PM (3 years ago)
Author:
Chris Dumez
Message:

Adopt Identifier::fromString(ASCIILiteral) more broadly
https://bugs.webkit.org/show_bug.cgi?id=238574

Reviewed by Darin Adler.

Adopt Identifier::fromString(ASCIILiteral) more broadly, now that it is very efficient.

Source/JavaScriptCore:

  • API/JSBase.cpp:

(JSGetMemoryUsageStatistics):

  • Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result:
  • Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result:
  • Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result:
  • Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result:
  • Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result:
  • Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result:
  • Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result:
  • Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result:
  • Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result:
  • Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result:
  • Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result:
  • Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result:
  • Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result:
  • Scripts/wkbuiltins/builtins_model.py:

(BuiltinFunction.fromString):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitThrowReferenceError):
(JSC::BytecodeGenerator::emitThrowTypeError):
(JSC::BytecodeGenerator::emitRequireObjectCoercible):

  • bytecompiler/BytecodeGenerator.h:
  • bytecompiler/NodesCodegen.cpp:

(JSC::ThrowableExpressionData::emitThrowReferenceError):

  • inspector/JSInjectedScriptHostPrototype.cpp:

(Inspector::JSInjectedScriptHostPrototype::finishCreation):

  • inspector/JSJavaScriptCallFramePrototype.cpp:

(Inspector::JSJavaScriptCallFramePrototype::finishCreation):

  • jsc.cpp:

(JSC_DEFINE_CUSTOM_SETTER):
(JSCMemoryFootprint::finishCreation):
(JSCMemoryFootprint::addProperty):
(JSC_DEFINE_HOST_FUNCTION):

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

(JSC::ArrayPrototype::finishCreation):

  • runtime/ConsoleObject.cpp:

(JSC::ConsoleObject::finishCreation):

  • runtime/Identifier.cpp:

(JSC::Identifier::add): Deleted.

  • runtime/Identifier.h:
  • runtime/IdentifierInlines.h:

(JSC::Identifier::fromCString):

  • runtime/IntlDateTimeFormatPrototype.cpp:

(JSC::IntlDateTimeFormatPrototype::finishCreation):

  • runtime/IntlNumberFormatPrototype.cpp:

(JSC::IntlNumberFormatPrototype::finishCreation):

  • runtime/IntlObject.cpp:

(JSC::IntlObject::finishCreation):

  • runtime/JSObject.cpp:

(JSC::JSObject::reifyAllStaticProperties):

  • runtime/JSObject.h:

(JSC::makeIdentifier):

  • runtime/JSObjectInlines.h:

(JSC::JSObject::getNonReifiedStaticPropertyNames):

  • runtime/JSTypedArrayViewPrototype.cpp:

(JSC::JSTypedArrayViewPrototype::finishCreation):

  • runtime/ProxyConstructor.cpp:

(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::ProxyConstructor::finishCreation):

  • runtime/ProxyObject.cpp:

(JSC::ProxyObject::performInternalMethodGetOwnProperty):
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::ProxyObject::performDelete):
(JSC::ProxyObject::performPreventExtensions):
(JSC::ProxyObject::performIsExtensible):
(JSC::ProxyObject::performGetOwnPropertyNames):
(JSC::ProxyObject::performSetPrototype):
(JSC::ProxyObject::performGetPrototype):

  • runtime/StringPrototype.cpp:

(JSC::StringPrototype::finishCreation):

  • tools/JSDollarVM.cpp:

(JSC::JSDollarVM::finishCreation):
(JSC::JSDollarVM::addFunction):
(JSC::JSDollarVM::addConstructibleFunction):

  • tools/JSDollarVM.h:
  • wasm/js/JSWebAssembly.cpp:

(JSC::JSWebAssembly::finishCreation):

Source/WebCore:

  • Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:

(WebCore::CDMSessionClearKey::update):

  • bridge/testbindings.cpp:

(main):

  • bridge/testbindings.mm:

(main):

  • crypto/SubtleCrypto.cpp:

(WebCore::normalizeCryptoAlgorithmParameters):

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::updatePageScaleFactorJSProperty):
(WebCore::HTMLMediaElement::updateUsesLTRUserInterfaceLayoutDirectionJSProperty):
(WebCore::HTMLMediaElement::setControllerJSProperty):
(WebCore::HTMLMediaElement::setMediaControlsMaximumRightContainerButtonCountOverride):
(WebCore::HTMLMediaElement::setMediaControlsHidePlaybackRates):

  • html/HTMLMediaElement.h:
  • inspector/InspectorFrontendHost.cpp:

(WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld):
(WebCore::InspectorFrontendHost::showContextMenu):

  • inspector/WebInjectedScriptHost.cpp:

(WebCore::constructInternalProperty):
(WebCore::objectForPaymentOptions):
(WebCore::objectForPaymentCurrencyAmount):
(WebCore::objectForPaymentItem):
(WebCore::objectForPaymentShippingOption):
(WebCore::objectForPaymentDetailsModifier):
(WebCore::objectForPaymentDetails):
(WebCore::objectForEventTargetListeners):

  • inspector/agents/InspectorCanvasAgent.cpp:

(WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):

  • inspector/agents/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::buildObjectForEventListener):

  • inspector/agents/page/PageAuditAgent.cpp:

(WebCore::PageAuditAgent::populateAuditObject):

  • testing/Internals.cpp:
  • testing/Internals.h:
  • worklets/PaintWorkletGlobalScope.cpp:

(WebCore::PaintWorkletGlobalScope::registerPaint):

Source/WebKit:

  • WebProcess/WebPage/IPCTestingAPI.cpp:

(WebKit::IPCTestingAPI::jsResultFromReplyDecoder):
(WebKit::IPCTestingAPI::createJSArrayForArgumentDescriptions):
(WebKit::IPCTestingAPI::JSIPC::messages):
(WebKit::IPCTestingAPI::JSMessageListener::jsDescriptionFromDecoder):
(WebKit::IPCTestingAPI::inject):

Location:
trunk/Source/JavaScriptCore/Scripts
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result

    r278210 r292193  
    6161
    6262#define JSC_FOREACH_BUILTIN_CODE(macro) \
    63     macro(builtinPromiseFulfillPromiseCode, fulfillPromise, static_cast<const char*>(nullptr), s_builtinPromiseFulfillPromiseCodeLength) \
    64     macro(builtinPromiseRejectPromiseCode, rejectPromise, static_cast<const char*>(nullptr), s_builtinPromiseRejectPromiseCodeLength) \
     63    macro(builtinPromiseFulfillPromiseCode, fulfillPromise, ASCIILiteral::null(), s_builtinPromiseFulfillPromiseCodeLength) \
     64    macro(builtinPromiseRejectPromiseCode, rejectPromise, ASCIILiteral::null(), s_builtinPromiseRejectPromiseCodeLength) \
    6565
    6666#define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result

    r278210 r292193  
    5858
    5959#define JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_CODE(macro) \
    60     macro(builtinPromiseRejectPromiseCode, rejectPromise, static_cast<const char*>(nullptr), s_builtinPromiseRejectPromiseCodeLength) \
    61     macro(builtinPromiseFulfillPromiseCode, fulfillPromise, static_cast<const char*>(nullptr), s_builtinPromiseFulfillPromiseCodeLength) \
     60    macro(builtinPromiseRejectPromiseCode, rejectPromise, ASCIILiteral::null(), s_builtinPromiseRejectPromiseCodeLength) \
     61    macro(builtinPromiseFulfillPromiseCode, fulfillPromise, ASCIILiteral::null(), s_builtinPromiseFulfillPromiseCodeLength) \
    6262
    6363#define JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_FUNCTION_NAME(macro) \
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result

    r278210 r292193  
    7171
    7272#define JSC_FOREACH_BUILTIN_CODE(macro) \
    73     macro(builtinPrototypeEveryCode, every, static_cast<const char*>(nullptr), s_builtinPrototypeEveryCodeLength) \
    74     macro(builtinPrototypeForEachCode, forEach, static_cast<const char*>(nullptr), s_builtinPrototypeForEachCodeLength) \
    75     macro(builtinPrototypeMatchCode, match, "[Symbol.match]", s_builtinPrototypeMatchCodeLength) \
    76     macro(builtinPrototypeTestCode, test, static_cast<const char*>(nullptr), s_builtinPrototypeTestCodeLength) \
     73    macro(builtinPrototypeEveryCode, every, ASCIILiteral::null(), s_builtinPrototypeEveryCodeLength) \
     74    macro(builtinPrototypeForEachCode, forEach, ASCIILiteral::null(), s_builtinPrototypeForEachCodeLength) \
     75    macro(builtinPrototypeMatchCode, match, "[Symbol.match]"_s, s_builtinPrototypeMatchCodeLength) \
     76    macro(builtinPrototypeTestCode, test, ASCIILiteral::null(), s_builtinPrototypeTestCodeLength) \
    7777
    7878#define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result

    r278210 r292193  
    7070
    7171#define JSC_FOREACH_BUILTIN.PROTOTYPE_BUILTIN_CODE(macro) \
    72     macro(builtinPrototypeEveryCode, every, static_cast<const char*>(nullptr), s_builtinPrototypeEveryCodeLength) \
    73     macro(builtinPrototypeForEachCode, forEach, static_cast<const char*>(nullptr), s_builtinPrototypeForEachCodeLength) \
    74     macro(builtinPrototypeMatchCode, match, "[Symbol.match]", s_builtinPrototypeMatchCodeLength) \
    75     macro(builtinPrototypeTestCode, test, static_cast<const char*>(nullptr), s_builtinPrototypeTestCodeLength) \
     72    macro(builtinPrototypeEveryCode, every, ASCIILiteral::null(), s_builtinPrototypeEveryCodeLength) \
     73    macro(builtinPrototypeForEachCode, forEach, ASCIILiteral::null(), s_builtinPrototypeForEachCodeLength) \
     74    macro(builtinPrototypeMatchCode, match, "[Symbol.match]"_s, s_builtinPrototypeMatchCodeLength) \
     75    macro(builtinPrototypeTestCode, test, ASCIILiteral::null(), s_builtinPrototypeTestCodeLength) \
    7676
    7777#define JSC_FOREACH_BUILTIN.PROTOTYPE_BUILTIN_FUNCTION_NAME(macro) \
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result

    r278210 r292193  
    6060
    6161#define JSC_FOREACH_BUILTIN_CODE(macro) \
    62     macro(builtinConstructorFromCode, from, static_cast<const char*>(nullptr), s_builtinConstructorFromCodeLength) \
    63     macro(builtinConstructorOfCode, of, static_cast<const char*>(nullptr), s_builtinConstructorOfCodeLength) \
     62    macro(builtinConstructorFromCode, from, ASCIILiteral::null(), s_builtinConstructorFromCodeLength) \
     63    macro(builtinConstructorOfCode, of, ASCIILiteral::null(), s_builtinConstructorOfCodeLength) \
    6464
    6565#define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result

    r278210 r292193  
    5757
    5858#define JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_CODE(macro) \
    59     macro(builtinConstructorOfCode, of, static_cast<const char*>(nullptr), s_builtinConstructorOfCodeLength) \
    60     macro(builtinConstructorFromCode, from, static_cast<const char*>(nullptr), s_builtinConstructorFromCodeLength) \
     59    macro(builtinConstructorOfCode, of, ASCIILiteral::null(), s_builtinConstructorOfCodeLength) \
     60    macro(builtinConstructorFromCode, from, ASCIILiteral::null(), s_builtinConstructorFromCodeLength) \
    6161
    6262#define JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_FUNCTION_NAME(macro) \
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result

    r278210 r292193  
    6161
    6262#define JSC_FOREACH_BUILTIN_CODE(macro) \
    63     macro(internalClashingNamesIsReadableStreamLockedCode, isReadableStreamLocked, static_cast<const char*>(nullptr), s_internalClashingNamesIsReadableStreamLockedCodeLength) \
    64     macro(internalClashingNamesIsReadableStreamLockedCode, isReadableStreamLocked, static_cast<const char*>(nullptr), s_internalClashingNamesIsReadableStreamLockedCodeLength) \
     63    macro(internalClashingNamesIsReadableStreamLockedCode, isReadableStreamLocked, ASCIILiteral::null(), s_internalClashingNamesIsReadableStreamLockedCodeLength) \
     64    macro(internalClashingNamesIsReadableStreamLockedCode, isReadableStreamLocked, ASCIILiteral::null(), s_internalClashingNamesIsReadableStreamLockedCodeLength) \
    6565
    6666#define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result

    r278210 r292193  
    5656
    5757#define WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(macro) \
    58     macro(anotherGuardedInternalBuiltinLetsFetchCode, letsFetch, static_cast<const char*>(nullptr), s_anotherGuardedInternalBuiltinLetsFetchCodeLength) \
     58    macro(anotherGuardedInternalBuiltinLetsFetchCode, letsFetch, ASCIILiteral::null(), s_anotherGuardedInternalBuiltinLetsFetchCodeLength) \
    5959
    6060#define WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result

    r278210 r292193  
    5757
    5858#define WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(macro) \
    59     macro(arbitraryConditionalGuardIsReadableStreamLockedCode, isReadableStreamLocked, static_cast<const char*>(nullptr), s_arbitraryConditionalGuardIsReadableStreamLockedCodeLength) \
     59    macro(arbitraryConditionalGuardIsReadableStreamLockedCode, isReadableStreamLocked, ASCIILiteral::null(), s_arbitraryConditionalGuardIsReadableStreamLockedCodeLength) \
    6060
    6161#define WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(macro) \
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result

    r278210 r292193  
    5757
    5858#define WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(macro) \
    59     macro(guardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, static_cast<const char*>(nullptr), s_guardedBuiltinIsReadableStreamLockedCodeLength) \
     59    macro(guardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, ASCIILiteral::null(), s_guardedBuiltinIsReadableStreamLockedCodeLength) \
    6060
    6161#define WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result

    r278210 r292193  
    5757
    5858#define WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(macro) \
    59     macro(guardedInternalBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, static_cast<const char*>(nullptr), s_guardedInternalBuiltinIsReadableStreamLockedCodeLength) \
     59    macro(guardedInternalBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, ASCIILiteral::null(), s_guardedInternalBuiltinIsReadableStreamLockedCodeLength) \
    6060
    6161#define WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result

    r278210 r292193  
    5555
    5656#define WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(macro) \
    57     macro(unguardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, static_cast<const char*>(nullptr), s_unguardedBuiltinIsReadableStreamLockedCodeLength) \
     57    macro(unguardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, ASCIILiteral::null(), s_unguardedBuiltinIsReadableStreamLockedCodeLength) \
    5858
    5959#define WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result

    r278210 r292193  
    6969
    7070#define WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(macro) \
    71     macro(xmlCasingTestXMLCasingTestCode, xmlCasingTest, static_cast<const char*>(nullptr), s_xmlCasingTestXMLCasingTestCodeLength) \
    72     macro(xmlCasingTestCssCasingTestCode, cssCasingTest, static_cast<const char*>(nullptr), s_xmlCasingTestCssCasingTestCodeLength) \
    73     macro(xmlCasingTestUrlCasingTestCode, urlCasingTest, static_cast<const char*>(nullptr), s_xmlCasingTestUrlCasingTestCodeLength) \
     71    macro(xmlCasingTestXMLCasingTestCode, xmlCasingTest, ASCIILiteral::null(), s_xmlCasingTestXMLCasingTestCodeLength) \
     72    macro(xmlCasingTestCssCasingTestCode, cssCasingTest, ASCIILiteral::null(), s_xmlCasingTestCssCasingTestCodeLength) \
     73    macro(xmlCasingTestUrlCasingTestCode, urlCasingTest, ASCIILiteral::null(), s_xmlCasingTestUrlCasingTestCodeLength) \
    7474
    7575#define WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(macro) \
  • trunk/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_model.py

    r284096 r292193  
    151151
    152152        if is_getter and not overridden_name:
    153             overridden_name = "\"get %s\"" % (function_name)
     153            overridden_name = "\"get %s\"_s" % (function_name)
    154154
    155155        if not overridden_name:
    156             overridden_name = "static_cast<const char*>(nullptr)"
     156            overridden_name = "ASCIILiteral::null()"
     157
     158        if overridden_name[-1] == "\"":
     159            overridden_name += "_s"
    157160
    158161        return BuiltinFunction(function_name, function_source, parameters, is_async, is_constructor, is_global_private, is_naked_constructor, intrinsic, overridden_name)
Note: See TracChangeset for help on using the changeset viewer.