-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normative: Remove [[Enumerate]] and associated reflective capabilities #367
Conversation
Re 26.3.2. I'd just take the guts of 9.4.6.11 and insert them into 26.3.2. There is no need to tie namespace name iteration to for-in semantics |
@allenwb I thought about that but I'd have to call for-in if the method were applied to a non-module namespace object. This was simpler I thought, but happy to change it to something like:
|
??? 26.3.2 is specifically an iterator over the names of a module name space object. It really wasn't intended to be any sort of general own property name iterator. It is just sort of a design fluke it ended up that way. I think it would be better for it to just throw if it is applied to something that isn't a module namespace exotic object |
Uhh, yes, that is much better. Updating the PR. |
cbd59c2
to
2a57869
Compare
Fixed, thanks @allenwb. |
Summary of changes: * 6.1.7.2 Removed [[Enumerate]] from the table and list of invariants * 9.5 Proxy Object Internal Methods and Interal Slots, [[Enumerate]] table entry removed. * 9.4.6.1.1 Module Namespace Object [[Enumerate]] moved to 26.3.2 module namespace object [ @@iterator ] * 9.5.11 Proxy [[Enumerate]] deleted * Moved ordinary [[Enumerate]] section to end of 13.7.5 for-in, renamed to EnumerateObjectProperties. * Add an assert to step 1 to signal callers we expect they'll only pass objects * Updated informative definition of EnumerateObjectProperties * 13.7.5.12 for-in head evaluation calls EnumerateObjectProperties(_obj_) instead of _obj_.[[Enumerate]] * EnumerableOwnNames: the _names_ are always ordered the same as EnumerateObjectProperties (since we don't have to worry about this not being enforceable with proxies anymore) * 26.1.5 Reflect.enumerate deleted
2a57869
to
a7377a7
Compare
@@ -4415,8 +4398,7 @@ | |||
1. Let _desc_ be ? _O_.[[GetOwnProperty]](_key_). | |||
1. If _desc_ is not *undefined*, then | |||
1. If _desc_.[[Enumerable]] is *true*, append _key_ to _names_. | |||
1. If _O_.[[Enumerate]] is the ordinary object [[Enumerate]] internal method (<emu-xref href="#sec-ordinary-object-internal-methods-and-internal-slots-enumerate"></emu-xref>), then | |||
1. Order the elements of _names_ so they are in the same relative order as would be produced by the Iterator that would be returned if the [[Enumerate]] internal method was invoked on _O_. | |||
1. Order the elements of _names_ so they are in the same relative order as would be produced by the Iterator that would be returned if the EnumerateObjectProperties internal method was invoked with _O_. | |||
1. Return _names_. | |||
</emu-alg> | |||
<emu-note> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the note on the next line ("<p>The order of elements in the returned list is the same as the enumeration order that is used by a for-in statement.</p>"
but github has trouble showing it and won't let me comment on it) still necessary? It seems implied by EnumerateObjectProperties
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, removed the note.
How does HTML make what is now [[Enumerate]] return CreateListIterator(« ») for WindowProxy and Location objects when they are accessed from a different origin? It seems there would no longer be a hook to do that. |
@annevk probably the best way is to make GOPD always return enumerable: false. Combined with GetPrototypeOf returning null, that should do the trick. |
<p>When the abstract operation EnumerateObjectProperties is called with argument _O_, the following steps are taken:</p> | ||
<emu-alg> | ||
1. Assert: Type(_O_) is Object. | ||
1. Return an Iterator object (<emu-xref href="#sec-iterator-interface"></emu-xref>) whose `next` method iterates over all the String-valued keys of enumerable properties of _O_. The Iterator object must inherit from %IteratorPrototype% (<emu-xref href="#sec-%iteratorprototype%-object"></emu-xref>). The mechanics and order of enumerating the properties is not specified but must conform to the rules specified below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it makes sense to define that the return
method of the iterator object is null
? This should ensure that the iterator object cannot escape to user code when a break
or return
statement is nested in the for-in loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess both throw and return should be null
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And actually the requirement that it MUST inherit from %IteratorPrototype% is kind of bogus since the intention is this isn't observable. Can I simply remove that line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can remove that line. I'd probably also add the note "The Iterator object is never directly accessible to ECMAScript code." to underline that implementations don't actually need to create a JavaScript object.
except that I think you should have an "as if" in "... of prototype objects must be obtained by invoking EnumerateObjectProperties...". It should probably "... of prototype objects must be obtained as if by performing ..." We want to required the MOP operation calls, but should suggest that creation of intermediate iterators are required. |
I think you mean NOT required? I think the note in EnumerateObjectProperties that says that the iterator is never exposed to ECMAScript code makes that clear. But I can add back the first "as if by" if it helps. |
My apologies if this isn't appropriate here, but I'm not finding answers elsewhere on the web. With Specifically, I have a case where I have a Proxy object that stores values on an internal Object. It'd be nice if |
@broofa you can use the ownKeys proxy trap for that. |
@ljharb Hmm... that's not what I'm seeing. Am I doing something wrong, or are Node et al misinterpreting the spec?
|
I believe you also need to define a getOwnPropertyDescriptor trap. |
@ljharb Thanks, that works! I'm leaving a breadcrumb here for what I ended up with in case anyone else stumbles across this, and also because of a possible(?) spec issue described below. If this is getting spammy, my apologies, and let me know where I should move this conversation to. So, example of adding a virtual "c" property to a proxy object:
BTW, it's worth noting that I had to set the descriptor
I was going to report this as a bug against node's Does the Proxy spec address how implementors are expected to resolve this apparent inconsistency? FWIW, Safari and Firefox appear to use |
The [[OwnPropertyKeys]], [[GetOwnProperty]], [[Get]] and [[HasProperty]] internal methods of the object give partially redundant informations, and it is the responsibility of the writer of the Proxy handler to keep them reasonably consistent by implementing carefully, or not implementing, the corresponding traps (ownKeys, getOwnPropertyDescriptor, get and has). BTW, this is an argument for not having [[Enumerate]], because it would be one more internal method to keep consistent with others.
ECMAScript does not specify the behaviour of debugging facilities such as |
My point was |
The MOP (ie Proxy) spec. allows an exotic object to produce all sorts of inconsistent results. |
https://bugs.webkit.org/show_bug.cgi?id=212954 Reviewed by Yusuke Suzuki. JSTests: * ChakraCore.yaml: * ChakraCore/test/Basics/enum.baseline-jsc: Removed. * microbenchmarks/for-in-on-object-with-lazily-materialized-properties.js: Removed because ErrorInstance no longer materializes properties during for/in enumeration. * microbenchmarks/object-keys-cloned-arguments.js: Added. * microbenchmarks/object-keys-error-object.js: Added. * stress/arguments-properties-order.js: Added. * stress/for-in-tests.js: * stress/for-in-typed-array.js: Source/JavaScriptCore: Before this change, [[OwnPropertyKeys]] overrides were sometimes implemented inconsistently, via different get*PropertyNames() methods that duplicated logic (e.g. ErrorInstance, RegExpObject, and StringObject). This patch: 1. Introduces a clear convention to implement [[OwnPropertyKeys]] overrides: if it's defined by the spec, getOwnPropertyNames() method is used; otherwise, non-materialized properties are enumerated / reified in getOwnSpecialPropertyNames(). While no class should define both methods, we don't assert this to support inheritance. Removes getOwnNonIndexPropertyNames() from the method table and converts it to instance method; its overrides were renamed to getOwnSpecialPropertyNames() and exempted from calling the no-op base method. This approach was chosen, instead of getOwnNonIndexPropertyNames() override, because for/in enumeration must be sure there are no enumerable properties between getEnumerableLength() and the first structure property. Also, removes getStructurePropertyNames() from the method table as it's unreasonable to override it. 2. Extracts JSObject::getOwnIndexPropertyNames() instance method to enforce correct enumeration order in getOwnPropertyNames() overrides: special indices => butterfly storage => special properties => non-reified static => structure properties. Loose mode `arguments` were fixed to enumerate indices from butterfly storage before special properties [1], aligning JSC with V8 and SpiderMonkey. 3. Reworks for/in enumeration so the special properties always come before structure ones, aligning enumeration order of String objects [2] and typed arrays [3] that have expando properties with the spec, V8, and SpiderMonkey. Removes getPropertyNames() and getGenericPropertyNames() from the method table, along with their overrides, because ES7 disabled customization of for/in enumeration [4]. Instead, JSObject::getPropertyNames() instance method and getEnumerablePropertyNames() are introduced, featuring a loop instead of recursion. Also, this enabled dropping hard-to-follow JSObjectPropertiesMode bit and simplifying EnumerationMode to an enum. for/in and Object.keys microbenchmarks are neutral. This change does not affect JSPropertyNameEnumerator caching, nor fast paths of its bytecodes. [1]: https://tc39.es/ecma262/#sec-createmappedargumentsobject (steps 15-16 and 20-21) [2]: https://tc39.es/ecma262/#sec-string-exotic-objects-ownpropertykeys [3]: https://tc39.es/ecma262/#sec-integer-indexed-exotic-objects-ownpropertykeys [4]: tc39/ecma262#367 * API/JSAPIValueWrapper.h: Remove OverridesAnyFormOfGetPropertyNames structure flag as it should never be queried from JSCell instances. * API/JSCallbackObject.h: * API/JSCallbackObjectFunctions.h: (JSC::JSCallbackObject<Parent>::getOwnSpecialPropertyNames): (JSC::JSCallbackObject<Parent>::getOwnNonIndexPropertyNames): Deleted. * API/JSObjectRef.cpp: (JSObjectCopyPropertyNames): * bindings/ScriptValue.cpp: (Inspector::jsToInspectorValue): * bytecode/ObjectAllocationProfileInlines.h: (JSC::ObjectAllocationProfileBase<Derived>::possibleDefaultPropertyCount): Use DontEnumPropertyMode::Include as the intent is to count all properties, even private symbols. EnumerationMode() defaults did exclude non-enumerable properties. * debugger/DebuggerScope.cpp: (JSC::DebuggerScope::getOwnPropertyNames): * debugger/DebuggerScope.h: * runtime/ClassInfo.h: * runtime/ClonedArguments.cpp: (JSC::ClonedArguments::getOwnSpecialPropertyNames): Don't materialize DontEnum properties unless it's DontEnumPropertiesMode::Include, advancing provided microbenchmark by ~23%. (JSC::ClonedArguments::getOwnPropertyNames): Deleted. * runtime/ClonedArguments.h: * runtime/EnumerationMode.h: Explicitly specify enum type to reduce its size. (JSC::EnumerationMode::EnumerationMode): Deleted. (JSC::EnumerationMode::includeDontEnumProperties): Deleted. (JSC::EnumerationMode::includeJSObjectProperties): Deleted. * runtime/ErrorInstance.cpp: (JSC::ErrorInstance::getOwnSpecialPropertyNames): Don't materialize DontEnum properties unless it's DontEnumPropertiesMode::Include, advancing provided microbenchmark by a factor of 5. (JSC::ErrorInstance::getOwnNonIndexPropertyNames): Deleted. (JSC::ErrorInstance::getStructurePropertyNames): Deleted. * runtime/ErrorInstance.h: * runtime/GenericArguments.h: * runtime/GenericArgumentsInlines.h: (JSC::GenericArguments<Type>::getOwnPropertyNames): * runtime/JSArray.cpp: (JSC::JSArray::getOwnSpecialPropertyNames): (JSC::JSArray::getOwnNonIndexPropertyNames): Deleted. * runtime/JSArray.h: * runtime/JSCell.cpp: (JSC::JSCell::getOwnPropertyNames): (JSC::JSCell::getOwnSpecialPropertyNames): (JSC::JSCell::getOwnNonIndexPropertyNames): Deleted. (JSC::JSCell::getPropertyNames): Deleted. (JSC::JSCell::getStructurePropertyNames): Deleted. (JSC::JSCell::getGenericPropertyNames): Deleted. * runtime/JSCell.h: * runtime/JSFunction.cpp: (JSC::JSFunction::getOwnSpecialPropertyNames): (JSC::JSFunction::getOwnNonIndexPropertyNames): Deleted. * runtime/JSFunction.h: * runtime/JSGenericTypedArrayView.h: * runtime/JSGenericTypedArrayViewInlines.h: (JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertyNames): * runtime/JSGlobalObject.h: Remove OverridesAnyFormOfGetPropertyNames structure flag as it's inherited from JSSymbolTableObject, and JSGlobalObject itself doesn't override getOwn*PropertyNames(). * runtime/JSLexicalEnvironment.cpp: (JSC::JSLexicalEnvironment::getOwnSpecialPropertyNames): (JSC::JSLexicalEnvironment::getOwnNonIndexPropertyNames): Deleted. * runtime/JSLexicalEnvironment.h: * runtime/JSModuleEnvironment.cpp: (JSC::JSModuleEnvironment::getOwnSpecialPropertyNames): (JSC::JSModuleEnvironment::getOwnNonIndexPropertyNames): Deleted. * runtime/JSModuleEnvironment.h: * runtime/JSModuleNamespaceObject.cpp: (JSC::JSModuleNamespaceObject::getOwnPropertyNames): Call getOwnNonIndexPropertyNames() directly, guarded by includeSymbolProperties() check, since module namespace objects can't have string properties besides m_names. (See https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-defineownproperty-p-desc) * runtime/JSModuleNamespaceObject.h: * runtime/JSONObject.cpp: (JSC::Stringifier::Holder::appendNextProperty): (JSC::Walker::walk): * runtime/JSObject.cpp: (JSC::JSObject::getNonReifiedStaticPropertyNames): (JSC::JSObject::getPropertyNames): (JSC::JSObject::getOwnPropertyNames): (JSC::JSObject::getOwnSpecialPropertyNames): (JSC::JSObject::getOwnIndexedPropertyNames): (JSC::JSObject::getOwnNonIndexPropertyNames): (JSC::getClassPropertyNames): Deleted. (JSC::JSObject::getStructurePropertyNames): Deleted. (JSC::JSObject::getGenericPropertyNames): Deleted. * runtime/JSObject.h: (JSC::JSObject::getOwnSpecialPropertyNames): * runtime/JSPropertyNameEnumerator.cpp: (JSC::getEnumerablePropertyNames): * runtime/JSPropertyNameEnumerator.h: (JSC::propertyNameEnumerator): * runtime/JSProxy.cpp: (JSC::JSProxy::getOwnPropertyNames): (JSC::JSProxy::getPropertyNames): Deleted. (JSC::JSProxy::getStructurePropertyNames): Deleted. (JSC::JSProxy::getGenericPropertyNames): Deleted. * runtime/JSProxy.h: * runtime/JSSymbolTableObject.cpp: (JSC::JSSymbolTableObject::getOwnSpecialPropertyNames): (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames): Deleted. * runtime/JSSymbolTableObject.h: * runtime/JSTypeInfo.h: (JSC::TypeInfo::overridesGetOwnPropertyNames const): (JSC::TypeInfo::overridesGetOwnSpecialPropertyNames const): (JSC::TypeInfo::overridesAnyFormOfGetOwnPropertyNames const): (JSC::TypeInfo::overridesGetPropertyNames const): Deleted. (JSC::TypeInfo::overridesAnyFormOfGetPropertyNames const): Deleted. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorGetOwnPropertyDescriptors): (JSC::JSC_DEFINE_HOST_FUNCTION): (JSC::defineProperties): (JSC::setIntegrityLevel): (JSC::testIntegrityLevel): (JSC::ownPropertyKeys): * runtime/ProxyObject.cpp: (JSC::ProxyObject::performGetOwnPropertyNames): (JSC::ProxyObject::getOwnPropertyNames): (JSC::ProxyObject::getPropertyNames): Deleted. (JSC::ProxyObject::getOwnNonIndexPropertyNames): Deleted. (JSC::ProxyObject::getStructurePropertyNames): Deleted. (JSC::ProxyObject::getGenericPropertyNames): Deleted. * runtime/ProxyObject.h: Remove IsQuickPropertyAccessAllowedForEnumeration flag from ProxyObject's structure since canAccessPropertiesQuicklyForEnumeration() now checks for method overrides. * runtime/RegExpObject.cpp: (JSC::RegExpObject::getOwnSpecialPropertyNames): (JSC::RegExpObject::getOwnNonIndexPropertyNames): Deleted. (JSC::RegExpObject::getPropertyNames): Deleted. (JSC::RegExpObject::getGenericPropertyNames): Deleted. * runtime/RegExpObject.h: * runtime/StringObject.cpp: (JSC::StringObject::getOwnPropertyNames): (JSC::StringObject::getOwnNonIndexPropertyNames): Deleted. * runtime/StringObject.h: * runtime/Structure.cpp: (JSC::Structure::validateFlags): Strengthen overridesGetOwn*PropertyNames and overridesGetPrototype asserts into equivalence tests. (JSC::Structure::getPropertyNamesFromStructure): (JSC::Structure::canAccessPropertiesQuicklyForEnumeration const): * runtime/Structure.h: * runtime/StructureInlines.h: (JSC::Structure::canCacheOwnPropertyNames const): * tools/JSDollarVM.cpp: Remove OverridesAnyFormOfGetPropertyNames structure flag as it's inherited from JSArray, and RuntimeArray itself doesn't override getOwn*PropertyNames(). Source/WebCore: Adjust for changes in JSC's MethodTable, TypeInfo, and EnumerationMode. No new tests, no behavior change. * animation/KeyframeEffect.cpp: (WebCore::processKeyframeLikeObject): * bindings/js/JSDOMConvertRecord.h: * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertyNames): * bindings/js/JSLocationCustom.cpp: (WebCore::JSLocation::getOwnPropertyNames): * bindings/js/JSRemoteDOMWindowCustom.cpp: (WebCore::JSRemoteDOMWindow::getOwnPropertyNames): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): * bindings/scripts/CodeGeneratorJS.pm: (GenerateGetOwnPropertyNames): (GenerateHeader): * bindings/scripts/test/JS/*: Updated. * bridge/NP_jsobject.cpp: * bridge/runtime_array.cpp: (JSC::RuntimeArray::getOwnPropertyNames): * bridge/runtime_array.h: * bridge/runtime_object.cpp: (JSC::Bindings::RuntimeObject::getOwnPropertyNames): * bridge/runtime_object.h: Source/WebKit: Adjust for changes in JSC's MethodTable, TypeInfo, and EnumerationMode. No new tests, no behavior change. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::getOwnPropertyNames): * WebProcess/Plugins/Netscape/JSNPObject.h: * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::NPJSObject::enumerate): Source/WebKitLegacy/mac: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::enumerate): Canonical link: https://commits.webkit.org/232854@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=212954 Reviewed by Yusuke Suzuki. JSTests: * ChakraCore.yaml: * ChakraCore/test/Basics/enum.baseline-jsc: Removed. * microbenchmarks/for-in-on-object-with-lazily-materialized-properties.js: Removed because ErrorInstance no longer materializes properties during for/in enumeration. * microbenchmarks/object-keys-cloned-arguments.js: Added. * microbenchmarks/object-keys-error-object.js: Added. * stress/arguments-properties-order.js: Added. * stress/for-in-tests.js: * stress/for-in-typed-array.js: Source/JavaScriptCore: Before this change, [[OwnPropertyKeys]] overrides were sometimes implemented inconsistently, via different get*PropertyNames() methods that duplicated logic (e.g. ErrorInstance, RegExpObject, and StringObject). This patch: 1. Introduces a clear convention to implement [[OwnPropertyKeys]] overrides: if it's defined by the spec, getOwnPropertyNames() method is used; otherwise, non-materialized properties are enumerated / reified in getOwnSpecialPropertyNames(). While no class should define both methods, we don't assert this to support inheritance. Removes getOwnNonIndexPropertyNames() from the method table and converts it to instance method; its overrides were renamed to getOwnSpecialPropertyNames() and exempted from calling the no-op base method. This approach was chosen, instead of getOwnNonIndexPropertyNames() override, because for/in enumeration must be sure there are no enumerable properties between getEnumerableLength() and the first structure property. Also, removes getStructurePropertyNames() from the method table as it's unreasonable to override it. 2. Extracts JSObject::getOwnIndexPropertyNames() instance method to enforce correct enumeration order in getOwnPropertyNames() overrides: special indices => butterfly storage => special properties => non-reified static => structure properties. Loose mode `arguments` were fixed to enumerate indices from butterfly storage before special properties [1], aligning JSC with V8 and SpiderMonkey. 3. Reworks for/in enumeration so the special properties always come before structure ones, aligning enumeration order of String objects [2] and typed arrays [3] that have expando properties with the spec, V8, and SpiderMonkey. Removes getPropertyNames() and getGenericPropertyNames() from the method table, along with their overrides, because ES7 disabled customization of for/in enumeration [4]. Instead, JSObject::getPropertyNames() instance method and getEnumerablePropertyNames() are introduced, featuring a loop instead of recursion. Also, this enabled dropping hard-to-follow JSObjectPropertiesMode bit and simplifying EnumerationMode to an enum. for/in and Object.keys microbenchmarks are neutral. This change does not affect JSPropertyNameEnumerator caching, nor fast paths of its bytecodes. [1]: https://tc39.es/ecma262/#sec-createmappedargumentsobject (steps 15-16 and 20-21) [2]: https://tc39.es/ecma262/#sec-string-exotic-objects-ownpropertykeys [3]: https://tc39.es/ecma262/#sec-integer-indexed-exotic-objects-ownpropertykeys [4]: tc39/ecma262#367 * API/JSAPIValueWrapper.h: Remove OverridesAnyFormOfGetPropertyNames structure flag as it should never be queried from JSCell instances. * API/JSCallbackObject.h: * API/JSCallbackObjectFunctions.h: (JSC::JSCallbackObject<Parent>::getOwnSpecialPropertyNames): (JSC::JSCallbackObject<Parent>::getOwnNonIndexPropertyNames): Deleted. * API/JSObjectRef.cpp: (JSObjectCopyPropertyNames): * bindings/ScriptValue.cpp: (Inspector::jsToInspectorValue): * bytecode/ObjectAllocationProfileInlines.h: (JSC::ObjectAllocationProfileBase<Derived>::possibleDefaultPropertyCount): Use DontEnumPropertyMode::Include as the intent is to count all properties, even private symbols. EnumerationMode() defaults did exclude non-enumerable properties. * debugger/DebuggerScope.cpp: (JSC::DebuggerScope::getOwnPropertyNames): * debugger/DebuggerScope.h: * runtime/ClassInfo.h: * runtime/ClonedArguments.cpp: (JSC::ClonedArguments::getOwnSpecialPropertyNames): Don't materialize DontEnum properties unless it's DontEnumPropertiesMode::Include, advancing provided microbenchmark by ~23%. (JSC::ClonedArguments::getOwnPropertyNames): Deleted. * runtime/ClonedArguments.h: * runtime/EnumerationMode.h: Explicitly specify enum type to reduce its size. (JSC::EnumerationMode::EnumerationMode): Deleted. (JSC::EnumerationMode::includeDontEnumProperties): Deleted. (JSC::EnumerationMode::includeJSObjectProperties): Deleted. * runtime/ErrorInstance.cpp: (JSC::ErrorInstance::getOwnSpecialPropertyNames): Don't materialize DontEnum properties unless it's DontEnumPropertiesMode::Include, advancing provided microbenchmark by a factor of 5. (JSC::ErrorInstance::getOwnNonIndexPropertyNames): Deleted. (JSC::ErrorInstance::getStructurePropertyNames): Deleted. * runtime/ErrorInstance.h: * runtime/GenericArguments.h: * runtime/GenericArgumentsInlines.h: (JSC::GenericArguments<Type>::getOwnPropertyNames): * runtime/JSArray.cpp: (JSC::JSArray::getOwnSpecialPropertyNames): (JSC::JSArray::getOwnNonIndexPropertyNames): Deleted. * runtime/JSArray.h: * runtime/JSCell.cpp: (JSC::JSCell::getOwnPropertyNames): (JSC::JSCell::getOwnSpecialPropertyNames): (JSC::JSCell::getOwnNonIndexPropertyNames): Deleted. (JSC::JSCell::getPropertyNames): Deleted. (JSC::JSCell::getStructurePropertyNames): Deleted. (JSC::JSCell::getGenericPropertyNames): Deleted. * runtime/JSCell.h: * runtime/JSFunction.cpp: (JSC::JSFunction::getOwnSpecialPropertyNames): (JSC::JSFunction::getOwnNonIndexPropertyNames): Deleted. * runtime/JSFunction.h: * runtime/JSGenericTypedArrayView.h: * runtime/JSGenericTypedArrayViewInlines.h: (JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertyNames): * runtime/JSGlobalObject.h: Remove OverridesAnyFormOfGetPropertyNames structure flag as it's inherited from JSSymbolTableObject, and JSGlobalObject itself doesn't override getOwn*PropertyNames(). * runtime/JSLexicalEnvironment.cpp: (JSC::JSLexicalEnvironment::getOwnSpecialPropertyNames): (JSC::JSLexicalEnvironment::getOwnNonIndexPropertyNames): Deleted. * runtime/JSLexicalEnvironment.h: * runtime/JSModuleEnvironment.cpp: (JSC::JSModuleEnvironment::getOwnSpecialPropertyNames): (JSC::JSModuleEnvironment::getOwnNonIndexPropertyNames): Deleted. * runtime/JSModuleEnvironment.h: * runtime/JSModuleNamespaceObject.cpp: (JSC::JSModuleNamespaceObject::getOwnPropertyNames): Call getOwnNonIndexPropertyNames() directly, guarded by includeSymbolProperties() check, since module namespace objects can't have string properties besides m_names. (See https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-defineownproperty-p-desc) * runtime/JSModuleNamespaceObject.h: * runtime/JSONObject.cpp: (JSC::Stringifier::Holder::appendNextProperty): (JSC::Walker::walk): * runtime/JSObject.cpp: (JSC::JSObject::getNonReifiedStaticPropertyNames): (JSC::JSObject::getPropertyNames): (JSC::JSObject::getOwnPropertyNames): (JSC::JSObject::getOwnSpecialPropertyNames): (JSC::JSObject::getOwnIndexedPropertyNames): (JSC::JSObject::getOwnNonIndexPropertyNames): (JSC::getClassPropertyNames): Deleted. (JSC::JSObject::getStructurePropertyNames): Deleted. (JSC::JSObject::getGenericPropertyNames): Deleted. * runtime/JSObject.h: (JSC::JSObject::getOwnSpecialPropertyNames): * runtime/JSPropertyNameEnumerator.cpp: (JSC::getEnumerablePropertyNames): * runtime/JSPropertyNameEnumerator.h: (JSC::propertyNameEnumerator): * runtime/JSProxy.cpp: (JSC::JSProxy::getOwnPropertyNames): (JSC::JSProxy::getPropertyNames): Deleted. (JSC::JSProxy::getStructurePropertyNames): Deleted. (JSC::JSProxy::getGenericPropertyNames): Deleted. * runtime/JSProxy.h: * runtime/JSSymbolTableObject.cpp: (JSC::JSSymbolTableObject::getOwnSpecialPropertyNames): (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames): Deleted. * runtime/JSSymbolTableObject.h: * runtime/JSTypeInfo.h: (JSC::TypeInfo::overridesGetOwnPropertyNames const): (JSC::TypeInfo::overridesGetOwnSpecialPropertyNames const): (JSC::TypeInfo::overridesAnyFormOfGetOwnPropertyNames const): (JSC::TypeInfo::overridesGetPropertyNames const): Deleted. (JSC::TypeInfo::overridesAnyFormOfGetPropertyNames const): Deleted. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorGetOwnPropertyDescriptors): (JSC::JSC_DEFINE_HOST_FUNCTION): (JSC::defineProperties): (JSC::setIntegrityLevel): (JSC::testIntegrityLevel): (JSC::ownPropertyKeys): * runtime/ProxyObject.cpp: (JSC::ProxyObject::performGetOwnPropertyNames): (JSC::ProxyObject::getOwnPropertyNames): (JSC::ProxyObject::getPropertyNames): Deleted. (JSC::ProxyObject::getOwnNonIndexPropertyNames): Deleted. (JSC::ProxyObject::getStructurePropertyNames): Deleted. (JSC::ProxyObject::getGenericPropertyNames): Deleted. * runtime/ProxyObject.h: Remove IsQuickPropertyAccessAllowedForEnumeration flag from ProxyObject's structure since canAccessPropertiesQuicklyForEnumeration() now checks for method overrides. * runtime/RegExpObject.cpp: (JSC::RegExpObject::getOwnSpecialPropertyNames): (JSC::RegExpObject::getOwnNonIndexPropertyNames): Deleted. (JSC::RegExpObject::getPropertyNames): Deleted. (JSC::RegExpObject::getGenericPropertyNames): Deleted. * runtime/RegExpObject.h: * runtime/StringObject.cpp: (JSC::StringObject::getOwnPropertyNames): (JSC::StringObject::getOwnNonIndexPropertyNames): Deleted. * runtime/StringObject.h: * runtime/Structure.cpp: (JSC::Structure::validateFlags): Strengthen overridesGetOwn*PropertyNames and overridesGetPrototype asserts into equivalence tests. (JSC::Structure::getPropertyNamesFromStructure): (JSC::Structure::canAccessPropertiesQuicklyForEnumeration const): * runtime/Structure.h: * runtime/StructureInlines.h: (JSC::Structure::canCacheOwnPropertyNames const): * tools/JSDollarVM.cpp: Remove OverridesAnyFormOfGetPropertyNames structure flag as it's inherited from JSArray, and RuntimeArray itself doesn't override getOwn*PropertyNames(). Source/WebCore: Adjust for changes in JSC's MethodTable, TypeInfo, and EnumerationMode. No new tests, no behavior change. * animation/KeyframeEffect.cpp: (WebCore::processKeyframeLikeObject): * bindings/js/JSDOMConvertRecord.h: * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertyNames): * bindings/js/JSLocationCustom.cpp: (WebCore::JSLocation::getOwnPropertyNames): * bindings/js/JSRemoteDOMWindowCustom.cpp: (WebCore::JSRemoteDOMWindow::getOwnPropertyNames): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): * bindings/scripts/CodeGeneratorJS.pm: (GenerateGetOwnPropertyNames): (GenerateHeader): * bindings/scripts/test/JS/*: Updated. * bridge/NP_jsobject.cpp: * bridge/runtime_array.cpp: (JSC::RuntimeArray::getOwnPropertyNames): * bridge/runtime_array.h: * bridge/runtime_object.cpp: (JSC::Bindings::RuntimeObject::getOwnPropertyNames): * bridge/runtime_object.h: Source/WebKit: Adjust for changes in JSC's MethodTable, TypeInfo, and EnumerationMode. No new tests, no behavior change. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::getOwnPropertyNames): * WebProcess/Plugins/Netscape/JSNPObject.h: * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::NPJSObject::enumerate): Source/WebKitLegacy/mac: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::enumerate): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@271269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Summary of changes (actually quite simple so I expect I'm missing something major :-P)