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/bytecompiler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r291779 r292193  
    40304030}
    40314031
    4032 void BytecodeGenerator::emitThrowReferenceError(const String& message)
     4032void BytecodeGenerator::emitThrowReferenceError(ASCIILiteral message)
    40334033{
    40344034    emitThrowStaticError(ErrorTypeWithExtension::ReferenceError, Identifier::fromString(m_vm, message));
    40354035}
    40364036
    4037 void BytecodeGenerator::emitThrowTypeError(const String& message)
     4037void BytecodeGenerator::emitThrowTypeError(ASCIILiteral message)
    40384038{
    40394039    emitThrowStaticError(ErrorTypeWithExtension::TypeError, Identifier::fromString(m_vm, message));
     
    47364736}
    47374737
    4738 void BytecodeGenerator::emitRequireObjectCoercible(RegisterID* value, const String& error)
     4738void BytecodeGenerator::emitRequireObjectCoercible(RegisterID* value, ASCIILiteral error)
    47394739{
    47404740    Ref<Label> target = newLabel();
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r290768 r292193  
    902902        RegisterID* emitIsEmpty(RegisterID* dst, RegisterID* src);
    903903        RegisterID* emitIsDerivedArray(RegisterID* dst, RegisterID* src) { return emitIsCellWithType(dst, src, DerivedArrayType); }
    904         void emitRequireObjectCoercible(RegisterID* value, const String& error);
     904        void emitRequireObjectCoercible(RegisterID* value, ASCIILiteral error);
    905905
    906906        void emitIteratorOpen(RegisterID* iterator, RegisterID* nextOrIndex, RegisterID* symbolIterator, CallArguments& iterable, const ThrowableExpressionData*);
     
    956956        void emitThrowStaticError(ErrorTypeWithExtension, RegisterID*);
    957957        void emitThrowStaticError(ErrorTypeWithExtension, const Identifier& message);
    958         void emitThrowReferenceError(const String& message);
    959         void emitThrowTypeError(const String& message);
     958        void emitThrowReferenceError(ASCIILiteral message);
     959        void emitThrowTypeError(ASCIILiteral message);
    960960        void emitThrowTypeError(const Identifier& message);
    961961        void emitThrowRangeError(const Identifier& message);
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r291779 r292193  
    8787// ------------------------------ ThrowableExpressionData --------------------------------
    8888
    89 RegisterID* ThrowableExpressionData::emitThrowReferenceError(BytecodeGenerator& generator, const String& message, RegisterID* dst)
     89RegisterID* ThrowableExpressionData::emitThrowReferenceError(BytecodeGenerator& generator, ASCIILiteral message, RegisterID* dst)
    9090{
    9191    generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
Note: See TracChangeset for help on using the changeset viewer.