WebKit Bugzilla
Attachment 357761 Details for
Bug 192901
: Adding runtime-enabled attribute to Element prevents inlining property access
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192901-20181219170644.patch (text/plain), 17.91 KB, created by
Justin Michaud
on 2018-12-19 17:06:59 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Justin Michaud
Created:
2018-12-19 17:06:59 PST
Size:
17.91 KB
patch
obsolete
>Subversion Revision: 239365 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ff907605b66e1ed0cea74d9881becb774b0a6b4b..fab55c80e519ee708bce1aac5ba470a38c03231c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-12-19 Justin Michaud <justin_michaud@apple.com> >+ >+ Adding runtime-enabled attribute to Element prevents inlining >+ https://bugs.webkit.org/show_bug.cgi?id=192901 >+ >+ Add a call to flattenDictionaryObject after disabling runtime-enabled attributes. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * bindings/scripts/CodeGeneratorJS.pm: >+ (GenerateImplementation): >+ * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: >+ (WebCore::JSTestEnabledBySettingPrototype::finishCreation): >+ * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: >+ (WebCore::JSTestGenerateIsReachablePrototype::finishCreation): >+ * bindings/scripts/test/JS/JSTestNode.cpp: >+ (WebCore::JSTestNodePrototype::finishCreation): >+ * bindings/scripts/test/JS/JSTestObj.cpp: >+ (WebCore::JSTestObjPrototype::finishCreation): >+ > 2018-12-18 Justin Michaud <justin_michaud@apple.com> > > Update CSS Properties and Values API to use new cycle fallback behaviour >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index ce24ee4de353694ded1de45be1100b92d1167e96..ad1cbde4d546a711e5172b6a57239799732c722f 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -4191,12 +4191,18 @@ sub GenerateImplementation > > my @runtimeEnabledProperties = @runtimeEnabledOperations; > push(@runtimeEnabledProperties, @runtimeEnabledAttributes); >+ >+ if (@runtimeEnabledProperties) { >+ push(@implContent, " bool hasDisabledRuntimeProperties = false;\n"); >+ } >+ > foreach my $operationOrAttribute (@runtimeEnabledProperties) { > my $conditionalString = $codeGenerator->GenerateConditionalString($operationOrAttribute); > push(@implContent, "#if ${conditionalString}\n") if $conditionalString; > my $runtimeEnableConditionalString = GenerateRuntimeEnableConditionalString($interface, $operationOrAttribute); > my $name = $operationOrAttribute->name; > push(@implContent, " if (!${runtimeEnableConditionalString}) {\n"); >+ push(@implContent, " hasDisabledRuntimeProperties = true;\n"); > push(@implContent, " auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>(\"$name\"), strlen(\"$name\"));\n"); > push(@implContent, " VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);\n"); > push(@implContent, " JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);\n"); >@@ -4204,6 +4210,11 @@ sub GenerateImplementation > push(@implContent, "#endif\n") if $conditionalString; > } > >+ if (@runtimeEnabledProperties) { >+ push(@implContent, " if (hasDisabledRuntimeProperties && this->structure()->isDictionary())\n"); >+ push(@implContent, " this->flattenDictionaryObject(vm);\n"); >+ } >+ > foreach my $operation (@{$interface->operations}) { > next unless ($operation->extendedAttributes->{PrivateIdentifier}); > AddToImplIncludes("WebCoreJSClientData.h"); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.cpp >index 127faa967d2ac536e46ab93dbf56fd5254fe1911..549e49c3fc80d09007c2c7a1e20e92dcb51e932d 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.cpp >@@ -129,8 +129,10 @@ void JSTestEnabledBySettingPrototype::finishCreation(VM& vm) > { > Base::finishCreation(vm); > reifyStaticProperties(vm, JSTestEnabledBySetting::info(), JSTestEnabledBySettingPrototypeTableValues, *this); >+ bool hasDisabledRuntimeProperties = false; > #if ENABLE(TEST_FEATURE) > if (!downcast<Document>(jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext())->settings().testSettingEnabled()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("enabledBySettingOperation"), strlen("enabledBySettingOperation")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); >@@ -138,11 +140,14 @@ void JSTestEnabledBySettingPrototype::finishCreation(VM& vm) > #endif > #if ENABLE(TEST_FEATURE) > if (!downcast<Document>(jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext())->settings().testSettingEnabled()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("enabledBySettingAttribute"), strlen("enabledBySettingAttribute")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > #endif >+ if (hasDisabledRuntimeProperties && this->structure()->isDictionary()) >+ this->flattenDictionaryObject(vm); > } > > const ClassInfo JSTestEnabledBySetting::s_info = { "TestEnabledBySetting", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestEnabledBySetting) }; >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp >index ac2bebb2d9324a1a2c2add6a160d37c775c23b8f..43607d78f9d7bf33340b3c0142d03917e56060de 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp >@@ -101,11 +101,15 @@ void JSTestGenerateIsReachablePrototype::finishCreation(VM& vm) > { > Base::finishCreation(vm); > reifyStaticProperties(vm, JSTestGenerateIsReachable::info(), JSTestGenerateIsReachablePrototypeTableValues, *this); >+ bool hasDisabledRuntimeProperties = false; > if (!jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isSecureContext()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("aSecretAttribute"), strlen("aSecretAttribute")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } >+ if (hasDisabledRuntimeProperties && this->structure()->isDictionary()) >+ this->flattenDictionaryObject(vm); > } > > const ClassInfo JSTestGenerateIsReachable::s_info = { "TestGenerateIsReachable", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestGenerateIsReachable) }; >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp >index 2b2ded4c2c688af443f4a97c0fd49b12600065ad..8bb8b27ef399bccaea57d0d420804bdceab80696 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp >@@ -147,43 +147,53 @@ void JSTestNodePrototype::finishCreation(VM& vm) > { > Base::finishCreation(vm); > reifyStaticProperties(vm, JSTestNode::info(), JSTestNodePrototypeTableValues, *this); >+ bool hasDisabledRuntimeProperties = false; > if (!jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isSecureContext()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("calculateSecretResult"), strlen("calculateSecretResult")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > if (!jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isSecureContext()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("getSecretBoolean"), strlen("getSecretBoolean")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > #if ENABLE(TEST_FEATURE) > if (!(jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isSecureContext() && RuntimeEnabledFeatures::sharedFeatures().testFeatureEnabled())) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("testFeatureGetSecretBoolean"), strlen("testFeatureGetSecretBoolean")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > #endif > if (!RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("entries"), strlen("entries")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > if (!RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("keys"), strlen("keys")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > if (!RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("values"), strlen("values")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > if (!RuntimeEnabledFeatures::sharedFeatures().domIteratorEnabled()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("forEach"), strlen("forEach")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } >+ if (hasDisabledRuntimeProperties && this->structure()->isDictionary()) >+ this->flattenDictionaryObject(vm); > putDirect(vm, vm.propertyNames->iteratorSymbol, getDirect(vm, vm.propertyNames->builtinNames().entriesPublicName()), static_cast<unsigned>(JSC::PropertyAttribute::DontEnum)); > } > >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >index e2f48367eaec95daba1e6e1da0bad20951f69029..50ba60bd95aceda24525d52190715d782587d5e7 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >@@ -2324,67 +2324,81 @@ void JSTestObjPrototype::finishCreation(VM& vm) > { > Base::finishCreation(vm); > reifyStaticProperties(vm, JSTestObj::info(), JSTestObjPrototypeTableValues, *this); >+ bool hasDisabledRuntimeProperties = false; > #if ENABLE(TEST_FEATURE) > if (!RuntimeEnabledFeatures::sharedFeatures().testFeatureEnabled()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("enabledAtRuntimeOperation"), strlen("enabledAtRuntimeOperation")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > #endif > if (!(worldForDOMObject(*this).someWorld() && RuntimeEnabledFeatures::sharedFeatures().testFeatureEnabled())) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("enabledInSpecificWorldWhenRuntimeFeatureEnabled"), strlen("enabledInSpecificWorldWhenRuntimeFeatureEnabled")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > if (!worldForDOMObject(*this).someWorld()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("worldSpecificMethod"), strlen("worldSpecificMethod")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > if (!jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isSecureContext()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("calculateSecretResult"), strlen("calculateSecretResult")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > if (!jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isSecureContext()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("getSecretBoolean"), strlen("getSecretBoolean")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > #if ENABLE(TEST_FEATURE) > if (!(jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isSecureContext() && RuntimeEnabledFeatures::sharedFeatures().testFeatureEnabled())) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("testFeatureGetSecretBoolean"), strlen("testFeatureGetSecretBoolean")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > #endif > if (!jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isDocument()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("conditionallyExposedToWindowFunction"), strlen("conditionallyExposedToWindowFunction")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > if (!jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isWorkerGlobalScope()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("conditionallyExposedToWorkerFunction"), strlen("conditionallyExposedToWorkerFunction")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > #if ENABLE(TEST_FEATURE) > if (!(RuntimeEnabledFeatures::sharedFeatures().testFeatureEnabled() && RuntimeEnabledFeatures::sharedFeatures().testFeature1Enabled())) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("enabledAtRuntimeAttribute"), strlen("enabledAtRuntimeAttribute")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > #endif > if (!jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isDocument()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("conditionallyExposedToWindowAttribute"), strlen("conditionallyExposedToWindowAttribute")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } > if (!jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isWorkerGlobalScope()) { >+ hasDisabledRuntimeProperties = true; > auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("conditionallyExposedToWorkerAttribute"), strlen("conditionallyExposedToWorkerAttribute")); > VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); > JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); > } >+ if (hasDisabledRuntimeProperties && this->structure()->isDictionary()) >+ this->flattenDictionaryObject(vm); > putDirect(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().privateMethodPrivateName(), JSFunction::create(vm, globalObject(), 0, String(), jsTestObjPrototypeFunctionPrivateMethod), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); > putDirect(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().publicAndPrivateMethodPrivateName(), JSFunction::create(vm, globalObject(), 0, String(), jsTestObjPrototypeFunctionPublicAndPrivateMethod), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); > putDirect(vm, vm.propertyNames->iteratorSymbol, globalObject()->arrayPrototype()->getDirect(vm, vm.propertyNames->builtinNames().valuesPrivateName()), static_cast<unsigned>(JSC::PropertyAttribute::DontEnum));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192901
:
357761
|
357778
|
357822