Ignore:
Timestamp:
May 17, 2022, 2:24:05 PM (3 years ago)
Author:
Chris Dumez
Message:

Use ASCIILiteral for JSC::HashTableValue::m_key
https://bugs.webkit.org/show_bug.cgi?id=240492

Reviewed by Geoffrey Garen.

Use ASCIILiteral for JSC::HashTableValue::m_key since the key is always a string literal. This
allows JSC::reifyStaticProperties() to call a more optimal Identifier::fromString(VM&, ASCIILiteral)
overload.

  • Source/JavaScriptCore/create_hash_table:
  • Source/JavaScriptCore/runtime/Lookup.h:

(JSC::HashTable::ConstIterator::key const):
(JSC::HashTable::ConstIterator::skipInvalidKeys):
(JSC::reifyStaticProperties):

  • Source/JavaScriptCore/tools/JSDollarVM.cpp:
  • Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:

(GenerateHashTableValueArray):

  • Source/WebCore/bindings/scripts/test/JS/JSDOMWindow.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSExposedStar.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSExposedToWorkerAndWindow.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSPaintWorkletGlobalScope.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSServiceWorkerGlobalScope.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSShadowRealmGlobalScope.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSSharedWorkerGlobalScope.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestCallTracer.cpp:

(WebCore::JSTestCallTracerDOMConstructor::prototypeForStructure):

  • Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestConditionalIncludes.cpp:

(WebCore::JSTestConditionalIncludesDOMConstructor::prototypeForStructure):

  • Source/WebCore/bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp:

(WebCore::JSTestConditionallyReadWriteDOMConstructor::prototypeForStructure):

  • Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSON.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONIndirectInheritance.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONInherit.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONInheritFinal.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestDomainSecurity.cpp:

(WebCore::JSTestDomainSecurityDOMConstructor::prototypeForStructure):

  • Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:

(WebCore::JSTestEnabledBySettingDOMConstructor::prototypeForStructure):

  • Source/WebCore/bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestGenerateAddOpaqueRoot.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp:

(WebCore::JSTestInterfaceDOMConstructor::construct):

  • Source/WebCore/bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.cpp:

(WebCore::JSTestLegacyNoInterfaceObjectPrototype::finishCreation):

  • Source/WebCore/bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestMapLike.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestMapLikeWithOverriddenOperations.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyOverrideBuiltIns.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp:

(WebCore::JSTestNamedSetterWithLegacyUnforgeablePropertiesDOMConstructor::prototypeForStructure):

  • Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp:

(WebCore::JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltInsDOMConstructor::prototypeForStructure):

  • Source/WebCore/bindings/scripts/test/JS/JSTestNamespaceConst.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNamespaceObject.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp:

(WebCore::JSTestObjDOMConstructor::construct):

  • Source/WebCore/bindings/scripts/test/JS/JSTestOperationConditional.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestPluginInterface.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestReadOnlyMapLike.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestReadOnlySetLike.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestReportExtraMemoryCost.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestSetLike.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestSetLikeWithOverriddenOperations.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestStringifier.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestTaggedWrapper.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp:

(WebCore::JSTestTypedefsDOMConstructor::construct):

  • Source/WebCore/bindings/scripts/test/JS/JSWorkerGlobalScope.cpp:
  • Source/WebCore/bindings/scripts/test/JS/JSWorkletGlobalScope.cpp:

Canonical link: https://commits.webkit.org/250658@main

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/tools/JSDollarVM.cpp

    r293779 r294346  
    746746
    747747static const struct HashTableValue staticCustomAccessorTableValues[3] = {
    748     { "testStaticAccessor", static_cast<unsigned>(PropertyAttribute::CustomAccessor), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(testStaticAccessorGetter), (intptr_t)static_cast<PutPropertySlot::PutValueFunc>(testStaticAccessorPutter) } },
    749     { "testStaticAccessorDontEnum", PropertyAttribute::CustomAccessor | PropertyAttribute::DontEnum, NoIntrinsic, { (intptr_t)static_cast<GetValueFunc>(testStaticAccessorGetter), (intptr_t)static_cast<PutValueFunc>(testStaticAccessorPutter) } },
    750     { "testStaticAccessorReadOnly", PropertyAttribute::CustomAccessor | PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly, NoIntrinsic, { (intptr_t)static_cast<GetValueFunc>(testStaticAccessorGetter), 0 } },
     748    { "testStaticAccessor"_s, static_cast<unsigned>(PropertyAttribute::CustomAccessor), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(testStaticAccessorGetter), (intptr_t)static_cast<PutPropertySlot::PutValueFunc>(testStaticAccessorPutter) } },
     749    { "testStaticAccessorDontEnum"_s, PropertyAttribute::CustomAccessor | PropertyAttribute::DontEnum, NoIntrinsic, { (intptr_t)static_cast<GetValueFunc>(testStaticAccessorGetter), (intptr_t)static_cast<PutValueFunc>(testStaticAccessorPutter) } },
     750    { "testStaticAccessorReadOnly"_s, PropertyAttribute::CustomAccessor | PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly, NoIntrinsic, { (intptr_t)static_cast<GetValueFunc>(testStaticAccessorGetter), 0 } },
    751751};
    752752
     
    845845
    846846static const struct HashTableValue staticCustomValueTableValues[4] = {
    847     { "testStaticValue", static_cast<unsigned>(PropertyAttribute::CustomValue), NoIntrinsic, { (intptr_t)static_cast<GetValueFunc>(testStaticValueGetter), (intptr_t)static_cast<PutValueFunc>(testStaticValuePutter) } },
    848     { "testStaticValueNoSetter", PropertyAttribute::CustomValue | PropertyAttribute::DontEnum, NoIntrinsic, { (intptr_t)static_cast<GetValueFunc>(testStaticValueGetter), 0 } },
    849     { "testStaticValueReadOnly", PropertyAttribute::CustomValue | PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly, NoIntrinsic, { (intptr_t)static_cast<GetValueFunc>(testStaticValueGetter), 0 } },
    850     { "testStaticValueSetFlag", static_cast<unsigned>(PropertyAttribute::CustomValue), NoIntrinsic, { (intptr_t)static_cast<GetValueFunc>(testStaticValueGetter), (intptr_t)static_cast<PutValueFunc>(testStaticValuePutterSetFlag) } },
     847    { "testStaticValue"_s, static_cast<unsigned>(PropertyAttribute::CustomValue), NoIntrinsic, { (intptr_t)static_cast<GetValueFunc>(testStaticValueGetter), (intptr_t)static_cast<PutValueFunc>(testStaticValuePutter) } },
     848    { "testStaticValueNoSetter"_s, PropertyAttribute::CustomValue | PropertyAttribute::DontEnum, NoIntrinsic, { (intptr_t)static_cast<GetValueFunc>(testStaticValueGetter), 0 } },
     849    { "testStaticValueReadOnly"_s, PropertyAttribute::CustomValue | PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly, NoIntrinsic, { (intptr_t)static_cast<GetValueFunc>(testStaticValueGetter), 0 } },
     850    { "testStaticValueSetFlag"_s, static_cast<unsigned>(PropertyAttribute::CustomValue), NoIntrinsic, { (intptr_t)static_cast<GetValueFunc>(testStaticValueGetter), (intptr_t)static_cast<PutValueFunc>(testStaticValuePutterSetFlag) } },
    851851};
    852852
Note: See TracChangeset for help on using the changeset viewer.