Changeset 270874 in webkit
- Timestamp:
- Dec 15, 2020 4:33:34 PM (19 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 50 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/arguments-bizarre-behaviour-disable-enumerability.js (modified) (1 diff)
-
JSTests/stress/for-in-redefine-enumerable.js (added)
-
JSTests/stress/for-in-shadow-non-enumerable.js (added)
-
JSTests/test262/expectations.yaml (modified) (1 diff)
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac/fast/dom/wrapper-classes-objc-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac/fast/dom/wrapper-classes-objc.html (modified) (1 diff)
-
Source/JavaScriptCore/API/JSCallbackObjectFunctions.h (modified) (5 diffs)
-
Source/JavaScriptCore/API/tests/testapi.c (modified) (2 diffs)
-
Source/JavaScriptCore/API/tests/testapiScripts/testapi.js (modified) (5 diffs)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/bytecode/BytecodeList.rb (modified) (3 diffs)
-
Source/JavaScriptCore/bytecode/BytecodeUseDef.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/bytecode/CodeBlock.cpp (modified) (1 diff)
-
Source/JavaScriptCore/bytecode/Opcode.h (modified) (1 diff)
-
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (modified) (1 diff)
-
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (modified) (1 diff)
-
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h (modified) (2 diffs)
-
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/dfg/DFGCapabilities.cpp (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGClobberize.h (modified) (3 diffs)
-
Source/JavaScriptCore/dfg/DFGDoesGC.cpp (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGFixupPhase.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/dfg/DFGNode.h (modified) (2 diffs)
-
Source/JavaScriptCore/dfg/DFGNodeType.h (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGOperations.cpp (modified) (4 diffs)
-
Source/JavaScriptCore/dfg/DFGOperations.h (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGSSALoweringPhase.cpp (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGSafeToExecute.h (modified) (2 diffs)
-
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp (modified) (6 diffs)
-
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h (modified) (3 diffs)
-
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/ftl/FTLCapabilities.cpp (modified) (1 diff)
-
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp (modified) (10 diffs)
-
Source/JavaScriptCore/jit/JIT.cpp (modified) (4 diffs)
-
Source/JavaScriptCore/jit/JIT.h (modified) (2 diffs)
-
Source/JavaScriptCore/jit/JITOpcodes.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/jit/JITOpcodes32_64.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/jit/JITOperations.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/jit/JITOperations.h (modified) (1 diff)
-
Source/JavaScriptCore/llint/LowLevelInterpreter.asm (modified) (1 diff)
-
Source/JavaScriptCore/llint/LowLevelInterpreter64.asm (modified) (1 diff)
-
Source/JavaScriptCore/runtime/CommonSlowPaths.cpp (modified) (5 diffs)
-
Source/JavaScriptCore/runtime/CommonSlowPaths.h (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSObject.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/runtime/JSObject.h (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/bridge/runtime_array.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r270869 r270874 1 2020-12-15 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Non-enumerable property fails to shadow inherited enumerable property from for-in 4 https://bugs.webkit.org/show_bug.cgi?id=38970 5 6 Reviewed by Keith Miller. 7 8 * stress/arguments-bizarre-behaviour-disable-enumerability.js: 9 * stress/for-in-redefine-enumerable.js: Added. 10 * stress/for-in-shadow-non-enumerable.js: Added. 11 * test262/expectations.yaml: Mark 4 test cases as passing. 12 1 13 2020-12-15 Yusuke Suzuki <ysuzuki@apple.com> 2 14 -
trunk/JSTests/stress/arguments-bizarre-behaviour-disable-enumerability.js
r210146 r270874 19 19 array.push(s); 20 20 21 if (array.join(",") != " 0")21 if (array.join(",") != "") 22 22 throw new Error(); 23 23 -
trunk/JSTests/test262/expectations.yaml
r270695 r270874 1859 1859 default: 'Test262:AsyncTestFailure:Test262Error: Test262Error: Expected [pre, tick 1, constructor, constructor, tick 2, tick 3, loop, tick 4, constructor] and [pre, constructor, constructor, tick 1, tick 2, loop, constructor, tick 3, tick 4, post] to have the same contents. Ticks and constructor lookups' 1860 1860 strict mode: 'Test262:AsyncTestFailure:Test262Error: Test262Error: Expected [pre, tick 1, constructor, constructor, tick 2, tick 3, loop, tick 4, constructor] and [pre, constructor, constructor, tick 1, tick 2, loop, constructor, tick 3, tick 4, post] to have the same contents. Ticks and constructor lookups' 1861 test/language/statements/for-in/12.6.4-2.js:1862 default: 'Test262Error: accessedProp Expected SameValue(«true», «false») to be true'1863 strict mode: 'Test262Error: accessedProp Expected SameValue(«true», «false») to be true'1864 1861 test/language/statements/for-in/head-lhs-let.js: 1865 1862 default: "SyntaxError: Cannot use the keyword 'in' as a lexical variable name." 1866 1863 test/language/statements/for-in/identifier-let-allowed-as-lefthandside-expression-not-strict.js: 1867 1864 default: "SyntaxError: Cannot use the keyword 'in' as a lexical variable name." 1868 test/language/statements/for-in/order-enumerable-shadowed.js:1869 default: 'Test262Error: Expected [p1, p2] and [p1] to have the same contents. '1870 strict mode: 'Test262Error: Expected [p1, p2] and [p1] to have the same contents. '1871 1865 test/language/statements/for-in/scope-body-lex-open.js: 1872 1866 default: 'Test262Error: Expected a ReferenceError to be thrown but no exception was thrown at all' -
trunk/LayoutTests/ChangeLog
r270873 r270874 1 2020-12-15 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Non-enumerable property fails to shadow inherited enumerable property from for-in 4 https://bugs.webkit.org/show_bug.cgi?id=38970 5 6 Reviewed by Keith Miller. 7 8 * platform/mac/fast/dom/wrapper-classes-objc-expected.txt: 9 * platform/mac/fast/dom/wrapper-classes-objc.html: 10 1 11 2020-12-15 Alex Christensen <achristensen@webkit.org> 2 12 -
trunk/LayoutTests/platform/mac/fast/dom/wrapper-classes-objc-expected.txt
r209805 r270874 190 190 PASS objCObjectOfClass('NSArray') instanceof Array is true 191 191 PASS concatenateArray(objCArrayOfString()) is 'onetwothree' 192 PASS objCArrayOfString().every((_, i, arr) => arr.propertyIsEnumerable(i)) is true 192 193 PASS let arr = objCArrayOfString(); arr.length is 3 193 194 PASS let arr = objCArrayOfString(); arr.length = 0 threw exception RangeError: Range error. -
trunk/LayoutTests/platform/mac/fast/dom/wrapper-classes-objc.html
r209805 r270874 287 287 288 288 shouldBe("concatenateArray(objCArrayOfString())", "'onetwothree'"); 289 shouldBeTrue("objCArrayOfString().every((_, i, arr) => arr.propertyIsEnumerable(i))"); 289 290 290 291 shouldBe("let arr = objCArrayOfString(); arr.length", "3"); -
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r267727 r270874 163 163 164 164 if (StringImpl* name = propertyName.uid()) { 165 // FIXME: Set ReadOnly conditionally, based on setProperty presence in class inheritance chain. 166 // https://bugs.webkit.org/show_bug.cgi?id=219924 167 unsigned attributes = static_cast<unsigned>(PropertyAttribute::ReadOnly); 165 168 for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) { 166 169 // optional optimization to bypass getProperty in cases when we only need to know if the property exists … … 170 173 JSLock::DropAllLocks dropAllLocks(globalObject); 171 174 if (hasProperty(ctx, thisRef, propertyNameRef.get())) { 172 slot.setCustom(thisObject, PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum, getCallbackGetter());175 slot.setCustom(thisObject, attributes, getCallbackGetter()); 173 176 return true; 174 177 } … … 184 187 if (exception) { 185 188 throwException(globalObject, scope, toJS(globalObject, exception)); 186 slot.setValue(thisObject, PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum, jsUndefined());189 slot.setValue(thisObject, attributes, jsUndefined()); 187 190 return true; 188 191 } 189 192 if (value) { 190 slot.setValue(thisObject, PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum, toJS(globalObject, value));193 slot.setValue(thisObject, attributes, toJS(globalObject, value)); 191 194 return true; 192 195 } … … 194 197 195 198 if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(globalObject)) { 196 if (staticValues->contains(name)) { 199 if (StaticValueEntry* entry = staticValues->get(name)) { 200 // FIXME: getStaticValue() performs the same loop & checks just to acquire `entry`. 201 // https://bugs.webkit.org/show_bug.cgi?id=219925 197 202 JSValue value = thisObject->getStaticValue(globalObject, propertyName); 198 203 RETURN_IF_EXCEPTION(scope, false); 199 204 if (value) { 200 slot.setValue(thisObject, PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum, value);205 slot.setValue(thisObject, entry->attributes, value); 201 206 return true; 202 207 } … … 205 210 206 211 if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(globalObject)) { 207 if ( staticFunctions->contains(name)) {208 slot.setCustom(thisObject, PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum, getStaticFunctionGetter());212 if (StaticFunctionEntry* entry = staticFunctions->get(name)) { 213 slot.setCustom(thisObject, entry->attributes, getStaticFunctionGetter()); 209 214 return true; 210 215 } -
trunk/Source/JavaScriptCore/API/tests/testapi.c
r263117 r270874 1018 1018 static JSStaticValue globalObject_staticValues[] = { 1019 1019 { "globalStaticValue", globalObject_get, globalObject_set, kJSPropertyAttributeNone }, 1020 { "globalStaticValue2", globalObject_get, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum }, 1020 1021 { 0, 0, 0, 0 } 1021 1022 }; … … 1024 1025 { "globalStaticFunction", globalObject_call, kJSPropertyAttributeNone }, 1025 1026 { "globalStaticFunction2", globalObject_call, kJSPropertyAttributeNone }, 1027 { "globalStaticFunction3", globalObject_call, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum }, 1026 1028 { "gc", functionGC, kJSPropertyAttributeNone }, 1027 1029 { 0, 0, 0 } -
trunk/Source/JavaScriptCore/API/tests/testapiScripts/testapi.js
r266030 r270874 85 85 shouldBe("this.globalStaticFunction2();", 20); 86 86 87 var globalStaticValue2Descriptor = Object.getOwnPropertyDescriptor(this, "globalStaticValue2"); 88 shouldBe('typeof globalStaticValue2Descriptor', "object"); 89 shouldBe('globalStaticValue2Descriptor.writable', false); 90 shouldBe('globalStaticValue2Descriptor.enumerable', false); 91 92 var globalStaticFunction3Descriptor = Object.getOwnPropertyDescriptor(this, "globalStaticFunction3"); 93 shouldBe('typeof globalStaticFunction3Descriptor', "object"); 94 shouldBe('globalStaticFunction3Descriptor.writable', false); 95 shouldBe('globalStaticFunction3Descriptor.enumerable', false); 96 87 97 function iAmNotAStaticFunction() { return 10; } 88 98 shouldBe("iAmNotAStaticFunction();", 10); … … 135 145 shouldBe('alwaysOneDescriptor.value', MyObject.alwaysOne); 136 146 shouldBe('alwaysOneDescriptor.configurable', true); 137 shouldBe('alwaysOneDescriptor.enumerable', false); // Actually it is.147 shouldBe('alwaysOneDescriptor.enumerable', true); 138 148 var cantFindDescriptor = Object.getOwnPropertyDescriptor(MyObject, "cantFind"); 139 149 shouldBe('typeof cantFindDescriptor', "object"); 140 150 shouldBe('cantFindDescriptor.value', MyObject.cantFind); 141 151 shouldBe('cantFindDescriptor.configurable', true); 142 shouldBe('cantFindDescriptor.enumerable', false);152 shouldBe('cantFindDescriptor.enumerable', true); 143 153 try { 144 154 // If getOwnPropertyDescriptor() returned an access descriptor, this wouldn't throw. … … 151 161 shouldBe('myPropertyNameDescriptor.value', MyObject.myPropertyName); 152 162 shouldBe('myPropertyNameDescriptor.configurable', true); 153 shouldBe('myPropertyNameDescriptor.enumerable', false); // Actually it is.163 shouldBe('myPropertyNameDescriptor.enumerable', true); 154 164 try { 155 165 // if getOwnPropertyDescriptor() returned an access descriptor, this wouldn't throw. … … 238 248 shouldBe('baseDupDescriptor.value', derived.baseDup); 239 249 shouldBe('baseDupDescriptor.configurable', true); 240 shouldBe('baseDupDescriptor.enumerable', false);250 shouldBe('baseDupDescriptor.enumerable', true); 241 251 var baseOnlyDescriptor = Object.getOwnPropertyDescriptor(derived, "baseOnly"); 242 252 shouldBe('typeof baseOnlyDescriptor', "object"); 243 253 shouldBe('baseOnlyDescriptor.value', derived.baseOnly); 244 254 shouldBe('baseOnlyDescriptor.configurable', true); 245 shouldBe('baseOnlyDescriptor.enumerable', false);255 shouldBe('baseOnlyDescriptor.enumerable', true); 246 256 shouldBe('Object.getOwnPropertyDescriptor(derived, "protoOnly")', undefined); 247 257 var protoDupDescriptor = Object.getOwnPropertyDescriptor(derived, "protoDup"); … … 249 259 shouldBe('protoDupDescriptor.value', derived.protoDup); 250 260 shouldBe('protoDupDescriptor.configurable', true); 251 shouldBe('protoDupDescriptor.enumerable', false);261 shouldBe('protoDupDescriptor.enumerable', true); 252 262 var derivedOnlyDescriptor = Object.getOwnPropertyDescriptor(derived, "derivedOnly"); 253 263 shouldBe('typeof derivedOnlyDescriptor', "object"); 254 264 shouldBe('derivedOnlyDescriptor.value', derived.derivedOnly); 255 265 shouldBe('derivedOnlyDescriptor.configurable', true); 256 shouldBe('derivedOnlyDescriptor.enumerable', false);266 shouldBe('derivedOnlyDescriptor.enumerable', true); 257 267 258 268 shouldBe("undefined instanceof MyObject", false); -
trunk/Source/JavaScriptCore/ChangeLog
r270870 r270874 1 2020-12-15 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Non-enumerable property fails to shadow inherited enumerable property from for-in 4 https://bugs.webkit.org/show_bug.cgi?id=38970 5 6 Reviewed by Keith Miller. 7 8 While for/in was initially specified with notion of "shadowing", it wasn't clarified 9 until ES5 that [[Enumerable]] attributes are ignored when determining if a property 10 has already been processed. Recently, for/in spec was expanded [1] to pin down common 11 case enumeration as it's currently implemented by V8 and SpiderMonkey. 12 13 Since keeping track of DontEnum properties is a massive slowdown for uncached runs 14 (with any data structure used), this patch simply adds [[Enumerable]] check to 15 has_{indexed,structure,generic}_property bytecode ops and does renaming chores. 16 17 Common code is now shared between HasIndexedProperty (emitted for `0 in arr`) and 18 HasEnumerableIndexedProperty DFG nodes via passing different slow path ops rather 19 than having OpInfo with PropertySlot::InternalMethodType, which is a nice refactor. 20 21 While this change aligns common case for/in enumeration with the spec and other 22 engines, it also introduces a few observable discrepancies from V8 and SpiderMonkey, 23 which are permitted by the spec [2]: 24 a) properties that have been redefined as DontEnum within loop body are skipped, 25 which matches the spec [3] and seems like expected behavior; 26 b) "shadowing" is broken if a DontEnum property of already visited object is 27 added / deleted / redefined within loop body, which (pretty much) never happens. 28 29 This patch introduces a new invariant: all properties getOwn*PropertyNames() returns 30 in DontEnumPropertiesMode::Exclude should be reported as [[Enumerable]] by 31 getOwnPropertySlot(). JSCallbackObject and RuntimeArray are fixed to follow it. 32 33 for/in and Object.keys microbenchmarks are neutral. This change does not affect 34 JSPropertyNameEnumerator caching, nor fast paths of its bytecodes. 35 36 [1]: https://github.com/tc39/ecma262/pull/1791 37 [2]: https://tc39.es/ecma262/#sec-enumerate-object-properties (last paragraph) 38 [3]: https://tc39.es/ecma262/#sec-%foriniteratorprototype%.next (step 7.b.iii) 39 40 * API/JSCallbackObjectFunctions.h: 41 (JSC::JSCallbackObject<Parent>::getOwnPropertySlot): 42 * API/tests/testapi.c: 43 * API/tests/testapiScripts/testapi.js: 44 * bytecode/BytecodeList.rb: 45 * bytecode/BytecodeUseDef.cpp: 46 (JSC::computeUsesForBytecodeIndexImpl): 47 (JSC::computeDefsForBytecodeIndexImpl): 48 * bytecode/CodeBlock.cpp: 49 (JSC::CodeBlock::finishCreation): 50 * bytecode/Opcode.h: 51 * bytecompiler/BytecodeGenerator.cpp: 52 (JSC::BytecodeGenerator::emitHasEnumerableIndexedProperty): 53 (JSC::BytecodeGenerator::emitHasEnumerableStructureProperty): 54 (JSC::BytecodeGenerator::emitHasEnumerableProperty): 55 (JSC::BytecodeGenerator::emitHasGenericProperty): Deleted. 56 (JSC::BytecodeGenerator::emitHasIndexedProperty): Deleted. 57 (JSC::BytecodeGenerator::emitHasStructureProperty): Deleted. 58 * bytecompiler/BytecodeGenerator.h: 59 * bytecompiler/NodesCodegen.cpp: 60 (JSC::ForInNode::emitBytecode): 61 * dfg/DFGAbstractInterpreterInlines.h: 62 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): 63 * dfg/DFGByteCodeParser.cpp: 64 (JSC::DFG::ByteCodeParser::parseBlock): 65 * dfg/DFGCapabilities.cpp: 66 (JSC::DFG::capabilityLevel): 67 * dfg/DFGClobberize.h: 68 (JSC::DFG::clobberize): 69 * dfg/DFGDoesGC.cpp: 70 (JSC::DFG::doesGC): 71 * dfg/DFGFixupPhase.cpp: 72 (JSC::DFG::FixupPhase::fixupNode): 73 (JSC::DFG::FixupPhase::convertToHasIndexedProperty): 74 * dfg/DFGNode.h: 75 (JSC::DFG::Node::hasArrayMode): 76 (JSC::DFG::Node::hasInternalMethodType const): Deleted. 77 (JSC::DFG::Node::internalMethodType const): Deleted. 78 (JSC::DFG::Node::setInternalMethodType): Deleted. 79 * dfg/DFGNodeType.h: 80 * dfg/DFGOperations.cpp: 81 (JSC::DFG::JSC_DEFINE_JIT_OPERATION): 82 * dfg/DFGOperations.h: 83 * dfg/DFGPredictionPropagationPhase.cpp: 84 * dfg/DFGSSALoweringPhase.cpp: 85 (JSC::DFG::SSALoweringPhase::handleNode): 86 * dfg/DFGSafeToExecute.h: 87 (JSC::DFG::safeToExecute): 88 * dfg/DFGSpeculativeJIT.cpp: 89 (JSC::DFG::SpeculativeJIT::compileHasEnumerableProperty): 90 (JSC::DFG::SpeculativeJIT::compileHasEnumerableStructureProperty): 91 (JSC::DFG::SpeculativeJIT::compileHasIndexedProperty): 92 (JSC::DFG::SpeculativeJIT::compileHasGenericProperty): Deleted. 93 (JSC::DFG::SpeculativeJIT::compileHasStructureProperty): Deleted. 94 * dfg/DFGSpeculativeJIT.h: 95 * dfg/DFGSpeculativeJIT32_64.cpp: 96 (JSC::DFG::SpeculativeJIT::compile): 97 * dfg/DFGSpeculativeJIT64.cpp: 98 (JSC::DFG::SpeculativeJIT::compile): 99 * ftl/FTLCapabilities.cpp: 100 (JSC::FTL::canCompile): 101 * ftl/FTLLowerDFGToB3.cpp: 102 (JSC::FTL::DFG::LowerDFGToB3::compileNode): 103 (JSC::FTL::DFG::LowerDFGToB3::compileHasIndexedProperty): 104 (JSC::FTL::DFG::LowerDFGToB3::compileHasEnumerableProperty): 105 (JSC::FTL::DFG::LowerDFGToB3::compileHasEnumerableStructureProperty): 106 (JSC::FTL::DFG::LowerDFGToB3::compileHasGenericProperty): Deleted. 107 (JSC::FTL::DFG::LowerDFGToB3::compileHasStructureProperty): Deleted. 108 * jit/JIT.cpp: 109 (JSC::JIT::privateCompileMainPass): 110 (JSC::JIT::privateCompileSlowCases): 111 * jit/JIT.h: 112 * jit/JITOpcodes.cpp: 113 (JSC::JIT::emit_op_has_enumerable_structure_property): 114 (JSC::JIT::emit_op_has_enumerable_indexed_property): 115 (JSC::JIT::emitSlow_op_has_enumerable_indexed_property): 116 (JSC::JIT::emit_op_has_structure_property): Deleted. 117 (JSC::JIT::emit_op_has_indexed_property): Deleted. 118 (JSC::JIT::emitSlow_op_has_indexed_property): Deleted. 119 * jit/JITOpcodes32_64.cpp: 120 (JSC::JIT::emit_op_has_enumerable_structure_property): 121 (JSC::JIT::emit_op_has_enumerable_indexed_property): 122 (JSC::JIT::emitSlow_op_has_enumerable_indexed_property): 123 (JSC::JIT::emit_op_has_structure_property): Deleted. 124 (JSC::JIT::emit_op_has_indexed_property): Deleted. 125 (JSC::JIT::emitSlow_op_has_indexed_property): Deleted. 126 * jit/JITOperations.cpp: 127 (JSC::JSC_DEFINE_JIT_OPERATION): 128 * jit/JITOperations.h: 129 * llint/LowLevelInterpreter.asm: 130 * llint/LowLevelInterpreter64.asm: 131 * runtime/CommonSlowPaths.cpp: 132 (JSC::JSC_DEFINE_COMMON_SLOW_PATH): 133 * runtime/CommonSlowPaths.h: 134 * runtime/JSObject.cpp: 135 (JSC::JSObject::hasProperty const): 136 (JSC::JSObject::hasEnumerableProperty const): 137 (JSC::JSObject::hasPropertyGeneric const): Deleted. 138 * runtime/JSObject.h: 139 1 140 2020-12-15 Saam Barati <sbarati@apple.com> 2 141 -
trunk/Source/JavaScriptCore/bytecode/BytecodeList.rb
r270855 r270874 1126 1126 } 1127 1127 1128 op :has_ indexed_property,1128 op :has_enumerable_indexed_property, 1129 1129 args: { 1130 1130 dst: VirtualRegister, … … 1136 1136 } 1137 1137 1138 op :has_ structure_property,1138 op :has_enumerable_structure_property, 1139 1139 args: { 1140 1140 dst: VirtualRegister, … … 1160 1160 } 1161 1161 1162 op :has_ generic_property,1162 op :has_enumerable_property, 1163 1163 args: { 1164 1164 dst: VirtualRegister, -
trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.cpp
r267489 r270874 222 222 USES(OpNewArrayBuffer, immutableButterfly) 223 223 224 USES(OpHasGenericProperty, base, property) 225 USES(OpHasIndexedProperty, base, property) 224 USES(OpHasEnumerableIndexedProperty, base, property) 225 USES(OpHasEnumerableStructureProperty, base, property, enumerator) 226 USES(OpHasEnumerableProperty, base, property) 226 227 USES(OpEnumeratorStructurePname, enumerator, index) 227 228 USES(OpEnumeratorGenericPname, enumerator, index) … … 261 262 USES(OpGetByValWithThis, base, thisValue, property) 262 263 USES(OpInstanceofCustom, value, constructor, hasInstanceValue) 263 USES(OpHasStructureProperty, base, property, enumerator)264 264 USES(OpHasOwnStructureProperty, base, property, enumerator) 265 265 USES(OpInStructureProperty, base, property, enumerator) … … 421 421 DEFS(OpToIndexString, dst) 422 422 DEFS(OpGetEnumerableLength, dst) 423 DEFS(OpHasIndexedProperty, dst) 424 DEFS(OpHasStructureProperty, dst) 423 DEFS(OpHasEnumerableIndexedProperty, dst) 424 DEFS(OpHasEnumerableStructureProperty, dst) 425 DEFS(OpHasEnumerableProperty, dst) 425 426 DEFS(OpHasOwnStructureProperty, dst) 426 427 DEFS(OpInStructureProperty, dst) 427 DEFS(OpHasGenericProperty, dst)428 428 DEFS(OpGetDirectPname, dst) 429 429 DEFS(OpGetPropertyEnumerator, dst) -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r268077 r270874 504 504 m_bytecodeCost += opcodeLengths[opcodeID]; 505 505 switch (opcodeID) { 506 LINK(OpHas IndexedProperty)506 LINK(OpHasEnumerableIndexedProperty) 507 507 508 508 LINK(OpCallVarargs, profile) -
trunk/Source/JavaScriptCore/bytecode/Opcode.h
r263035 r270874 127 127 128 128 #define FOR_EACH_OPCODE_WITH_ARRAY_PROFILE(macro) \ 129 macro(OpHas IndexedProperty) \129 macro(OpHasEnumerableIndexedProperty) \ 130 130 macro(OpCallVarargs) \ 131 131 macro(OpTailCallVarargs) \ -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r270870 r270874 4366 4366 } 4367 4367 4368 RegisterID* BytecodeGenerator::emitHas GenericProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName)4369 { 4370 OpHas GenericProperty::emit(this, dst, base, propertyName);4371 return dst; 4372 } 4373 4374 RegisterID* BytecodeGenerator::emitHas IndexedProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName)4375 { 4376 OpHas IndexedProperty::emit(this, dst, base, propertyName);4377 return dst; 4378 } 4379 4380 RegisterID* BytecodeGenerator::emitHas StructureProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName, RegisterID* enumerator)4381 { 4382 OpHas StructureProperty::emit(this, dst, base, propertyName, enumerator);4368 RegisterID* BytecodeGenerator::emitHasEnumerableIndexedProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName) 4369 { 4370 OpHasEnumerableIndexedProperty::emit(this, dst, base, propertyName); 4371 return dst; 4372 } 4373 4374 RegisterID* BytecodeGenerator::emitHasEnumerableStructureProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName, RegisterID* enumerator) 4375 { 4376 OpHasEnumerableStructureProperty::emit(this, dst, base, propertyName, enumerator); 4377 return dst; 4378 } 4379 4380 RegisterID* BytecodeGenerator::emitHasEnumerableProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName) 4381 { 4382 OpHasEnumerableProperty::emit(this, dst, base, propertyName); 4383 4383 return dst; 4384 4384 } -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r270870 r270874 903 903 void emitCheckTraps(); 904 904 905 RegisterID* emitHasIndexedProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName); 906 RegisterID* emitHasStructureProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName, RegisterID* enumerator); 905 RegisterID* emitHasEnumerableIndexedProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName); 906 RegisterID* emitHasEnumerableStructureProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName, RegisterID* enumerator); 907 RegisterID* emitHasEnumerableProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName); 907 908 RegisterID* emitHasOwnStructureProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName, RegisterID* enumerator); 908 RegisterID* emitHasGenericProperty(RegisterID* dst, RegisterID* base, RegisterID* propertyName);909 909 RegisterID* emitGetPropertyEnumerator(RegisterID* dst, RegisterID* base); 910 910 RegisterID* emitGetEnumerableLength(RegisterID* dst, RegisterID* base); -
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r269939 r270874 3963 3963 RefPtr<RegisterID> result = generator.emitEqualityOp<OpLess>(generator.newTemporary(), i.get(), length.get()); 3964 3964 generator.emitJumpIfFalse(result.get(), loopEnd.get()); 3965 generator.emitHas IndexedProperty(result.get(), base.get(), i.get());3965 generator.emitHasEnumerableIndexedProperty(result.get(), base.get(), i.get()); 3966 3966 generator.emitJumpIfFalse(result.get(), *scope->continueTarget()); 3967 3967 … … 4004 4004 RefPtr<RegisterID> result = generator.emitIsNull(generator.newTemporary(), propertyName.get()); 4005 4005 generator.emitJumpIfTrue(result.get(), loopEnd.get()); 4006 generator.emitHas StructureProperty(result.get(), base.get(), propertyName.get(), enumerator.get());4006 generator.emitHasEnumerableStructureProperty(result.get(), base.get(), propertyName.get(), enumerator.get()); 4007 4007 generator.emitJumpIfFalse(result.get(), *scope->continueTarget()); 4008 4008 … … 4046 4046 generator.emitJumpIfTrue(result.get(), loopEnd.get()); 4047 4047 4048 generator.emitHas GenericProperty(result.get(), base.get(), propertyName.get());4048 generator.emitHasEnumerableProperty(result.get(), base.get(), propertyName.get()); 4049 4049 generator.emitJumpIfFalse(result.get(), *scope->continueTarget()); 4050 4050 -
trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
r269531 r270874 4156 4156 break; 4157 4157 } 4158 case Has GenericProperty: {4158 case HasEnumerableProperty: { 4159 4159 setNonCellTypeForNode(node, SpecBoolean); 4160 4160 clobberWorld(); … … 4163 4163 case InStructureProperty: 4164 4164 case HasOwnStructureProperty: 4165 case Has StructureProperty: {4165 case HasEnumerableStructureProperty: { 4166 4166 setNonCellTypeForNode(node, SpecBoolean); 4167 4167 clobberWorld(); 4168 4168 break; 4169 4169 } 4170 case HasIndexedProperty: { 4170 case HasIndexedProperty: 4171 case HasEnumerableIndexedProperty: { 4171 4172 ArrayMode mode = node->arrayMode(); 4172 4173 switch (mode.type()) { -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r269531 r270874 8140 8140 } 8141 8141 8142 case op_has_generic_property: { 8143 auto bytecode = currentInstruction->as<OpHasGenericProperty>(); 8144 set(bytecode.m_dst, addToGraph(HasGenericProperty, get(bytecode.m_base), get(bytecode.m_property))); 8145 NEXT_OPCODE(op_has_generic_property); 8146 } 8147 8148 case op_has_structure_property: { 8149 auto bytecode = currentInstruction->as<OpHasStructureProperty>(); 8150 set(bytecode.m_dst, addToGraph(HasStructureProperty, 8142 case op_has_enumerable_structure_property: { 8143 auto bytecode = currentInstruction->as<OpHasEnumerableStructureProperty>(); 8144 set(bytecode.m_dst, addToGraph(HasEnumerableStructureProperty, 8151 8145 get(bytecode.m_base), 8152 8146 get(bytecode.m_property), 8153 8147 get(bytecode.m_enumerator))); 8154 NEXT_OPCODE(op_has_structure_property); 8148 NEXT_OPCODE(op_has_enumerable_structure_property); 8149 } 8150 8151 case op_has_enumerable_property: { 8152 auto bytecode = currentInstruction->as<OpHasEnumerableProperty>(); 8153 set(bytecode.m_dst, addToGraph(HasEnumerableProperty, get(bytecode.m_base), get(bytecode.m_property))); 8154 NEXT_OPCODE(op_has_enumerable_property); 8155 8155 } 8156 8156 … … 8173 8173 } 8174 8174 8175 case op_has_ indexed_property: {8176 auto bytecode = currentInstruction->as<OpHas IndexedProperty>();8175 case op_has_enumerable_indexed_property: { 8176 auto bytecode = currentInstruction->as<OpHasEnumerableIndexedProperty>(); 8177 8177 Node* base = get(bytecode.m_base); 8178 8178 ArrayMode arrayMode = getArrayMode(bytecode.metadata(codeBlock).m_arrayProfile, Array::Read); … … 8181 8181 addVarArgChild(property); 8182 8182 addVarArgChild(nullptr); 8183 Node* hasIterableProperty = addToGraph(Node::VarArg, Has IndexedProperty, OpInfo(arrayMode.asWord()), OpInfo(static_cast<uint32_t>(PropertySlot::InternalMethodType::GetOwnProperty)));8183 Node* hasIterableProperty = addToGraph(Node::VarArg, HasEnumerableIndexedProperty, OpInfo(arrayMode.asWord())); 8184 8184 m_exitOK = false; // HasIndexedProperty must be treated as if it clobbers exit state, since FixupPhase may make it generic. 8185 8185 set(bytecode.m_dst, hasIterableProperty); 8186 NEXT_OPCODE(op_has_ indexed_property);8186 NEXT_OPCODE(op_has_enumerable_indexed_property); 8187 8187 } 8188 8188 -
trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp
r269349 r270874 254 254 case op_get_from_scope: 255 255 case op_get_enumerable_length: 256 case op_has_generic_property: 257 case op_has_structure_property: 256 case op_has_enumerable_indexed_property: 257 case op_has_enumerable_structure_property: 258 case op_has_enumerable_property: 258 259 case op_has_own_structure_property: 259 260 case op_in_structure_property: 260 case op_has_indexed_property:261 261 case op_get_direct_pname: 262 262 case op_get_property_enumerator: -
trunk/Source/JavaScriptCore/dfg/DFGClobberize.h
r269531 r270874 165 165 case ArrayIndexOf: 166 166 case HasIndexedProperty: 167 case HasEnumerableIndexedProperty: 167 168 case AtomicsAdd: 168 169 case AtomicsAnd: … … 349 350 } 350 351 351 case HasIndexedProperty: { 352 case HasIndexedProperty: 353 case HasEnumerableIndexedProperty: { 352 354 read(JSObject_butterfly); 353 355 ArrayMode mode = node->arrayMode(); … … 706 708 case ResolveScope: 707 709 case ToObject: 708 case Has GenericProperty:709 case Has StructureProperty:710 case HasEnumerableStructureProperty: 711 case HasEnumerableProperty: 710 712 case HasOwnStructureProperty: 711 713 case InStructureProperty: -
trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp
r269343 r270874 296 296 case GetDynamicVar: 297 297 case GetMapBucket: 298 case HasGenericProperty:299 298 case HasIndexedProperty: 299 case HasEnumerableIndexedProperty: 300 case HasEnumerableStructureProperty: 301 case HasEnumerableProperty: 300 302 case HasOwnProperty: 301 case HasStructureProperty:302 303 case HasOwnStructureProperty: 303 304 case InStructureProperty: -
trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
r269531 r270874 2205 2205 break; 2206 2206 } 2207 case Has GenericProperty: {2207 case HasEnumerableProperty: { 2208 2208 fixEdge<CellUse>(node->child2()); 2209 2209 break; 2210 2210 } 2211 case Has StructureProperty: {2211 case HasEnumerableStructureProperty: { 2212 2212 fixEdge<StringUse>(node->child2()); 2213 2213 fixEdge<KnownCellUse>(node->child3()); … … 2221 2221 break; 2222 2222 } 2223 case HasIndexedProperty: { 2223 case HasIndexedProperty: 2224 case HasEnumerableIndexedProperty: { 2224 2225 node->setArrayMode( 2225 2226 node->arrayMode().refine( … … 3989 3990 m_graph.varArgChild(node, 1)->prediction(), 3990 3991 SpecNone)); 3991 node->setInternalMethodType(PropertySlot::InternalMethodType::HasProperty);3992 3992 3993 3993 blessArrayOperation(m_graph.varArgChild(node, 0), m_graph.varArgChild(node, 1), m_graph.varArgChild(node, 2)); -
trunk/Source/JavaScriptCore/dfg/DFGNode.h
r270764 r270874 2215 2215 case ArrayIndexOf: 2216 2216 case HasIndexedProperty: 2217 case HasEnumerableIndexedProperty: 2217 2218 case AtomicsAdd: 2218 2219 case AtomicsAnd: … … 3004 3005 } 3005 3006 3006 bool hasInternalMethodType() const3007 {3008 return op() == HasIndexedProperty;3009 }3010 3011 PropertySlot::InternalMethodType internalMethodType() const3012 {3013 ASSERT(hasInternalMethodType());3014 return static_cast<PropertySlot::InternalMethodType>(m_opInfo2.as<uint32_t>());3015 }3016 3017 void setInternalMethodType(PropertySlot::InternalMethodType type)3018 {3019 ASSERT(hasInternalMethodType());3020 m_opInfo2 = static_cast<uint32_t>(type);3021 }3022 3023 3007 Node* replacement() const 3024 3008 { -
trunk/Source/JavaScriptCore/dfg/DFGNodeType.h
r269531 r270874 499 499 /* Must generate because of Proxies on the prototype chain */ \ 500 500 macro(HasIndexedProperty, NodeMustGenerate | NodeResultBoolean | NodeHasVarArgs) \ 501 macro(HasStructureProperty, NodeResultBoolean) \ 501 macro(HasEnumerableIndexedProperty, NodeMustGenerate | NodeResultBoolean | NodeHasVarArgs) \ 502 macro(HasEnumerableStructureProperty, NodeResultBoolean) \ 503 macro(HasEnumerableProperty, NodeResultBoolean) \ 502 504 macro(HasOwnStructureProperty, NodeResultBoolean | NodeMustGenerate) \ 503 505 macro(InStructureProperty, NodeMustGenerate | NodeResultBoolean) \ 504 macro(HasGenericProperty, NodeResultBoolean) \505 506 macro(GetDirectPname, NodeMustGenerate | NodeHasVarArgs | NodeResultJS) \ 506 507 macro(GetPropertyEnumerator, NodeMustGenerate | NodeResultJS) \ -
trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
r268783 r270874 2259 2259 } 2260 2260 2261 JSC_DEFINE_JIT_OPERATION(operationHas GenericProperty, EncodedJSValue, (JSGlobalObject* globalObject, EncodedJSValue encodedBaseValue, JSCell* property))2261 JSC_DEFINE_JIT_OPERATION(operationHasEnumerableProperty, EncodedJSValue, (JSGlobalObject* globalObject, EncodedJSValue encodedBaseValue, JSCell* property)) 2262 2262 { 2263 2263 VM& vm = globalObject->vm(); … … 2276 2276 auto propertyName = asString(property)->toIdentifier(globalObject); 2277 2277 RETURN_IF_EXCEPTION(scope, { }); 2278 RELEASE_AND_RETURN(scope, JSValue::encode(jsBoolean(base->has PropertyGeneric(globalObject, propertyName, PropertySlot::InternalMethodType::GetOwnProperty))));2278 RELEASE_AND_RETURN(scope, JSValue::encode(jsBoolean(base->hasEnumerableProperty(globalObject, propertyName)))); 2279 2279 } 2280 2280 … … 2301 2301 } 2302 2302 2303 JSC_DEFINE_JIT_OPERATION(operationHasIndexedProperty ByInt, size_t, (JSGlobalObject* globalObject, JSCell* baseCell, int32_t subscript, int32_t internalMethodType))2303 JSC_DEFINE_JIT_OPERATION(operationHasIndexedProperty, size_t, (JSGlobalObject* globalObject, JSCell* baseCell, int32_t subscript)) 2304 2304 { 2305 2305 VM& vm = globalObject->vm(); … … 2309 2309 if (UNLIKELY(subscript < 0)) { 2310 2310 // Go the slowest way possible because negative indices don't use indexed storage. 2311 return object->hasPropertyGeneric(globalObject, Identifier::from(vm, subscript), static_cast<PropertySlot::InternalMethodType>(internalMethodType)); 2312 } 2313 return object->hasPropertyGeneric(globalObject, subscript, static_cast<PropertySlot::InternalMethodType>(internalMethodType)); 2311 return object->hasProperty(globalObject, Identifier::from(vm, subscript)); 2312 } 2313 return object->hasProperty(globalObject, static_cast<unsigned>(subscript)); 2314 } 2315 2316 JSC_DEFINE_JIT_OPERATION(operationHasEnumerableIndexedProperty, size_t, (JSGlobalObject* globalObject, JSCell* baseCell, int32_t subscript)) 2317 { 2318 VM& vm = globalObject->vm(); 2319 CallFrame* callFrame = DECLARE_CALL_FRAME(vm); 2320 JITOperationPrologueCallFrameTracer tracer(vm, callFrame); 2321 JSObject* object = baseCell->toObject(globalObject); 2322 if (UNLIKELY(subscript < 0)) { 2323 // Go the slowest way possible because negative indices don't use indexed storage. 2324 return object->hasEnumerableProperty(globalObject, Identifier::from(vm, subscript)); 2325 } 2326 return object->hasEnumerableProperty(globalObject, subscript); 2314 2327 } 2315 2328 -
trunk/Source/JavaScriptCore/dfg/DFGOperations.h
r268385 r270874 100 100 JSC_DECLARE_JIT_OPERATION(operationGetPrototypeOf, EncodedJSValue, (JSGlobalObject*, EncodedJSValue)); 101 101 JSC_DECLARE_JIT_OPERATION(operationGetPrototypeOfObject, EncodedJSValue, (JSGlobalObject*, JSObject*)); 102 JSC_DECLARE_JIT_OPERATION(operationHasGenericProperty, EncodedJSValue, (JSGlobalObject*, EncodedJSValue, JSCell*)); 102 JSC_DECLARE_JIT_OPERATION(operationHasIndexedProperty, size_t, (JSGlobalObject*, JSCell*, int32_t)); 103 JSC_DECLARE_JIT_OPERATION(operationHasEnumerableIndexedProperty, size_t, (JSGlobalObject*, JSCell*, int32_t)); 104 JSC_DECLARE_JIT_OPERATION(operationHasEnumerableProperty, EncodedJSValue, (JSGlobalObject*, EncodedJSValue, JSCell*)); 103 105 JSC_DECLARE_JIT_OPERATION(operationHasOwnStructureProperty, EncodedJSValue, (JSGlobalObject*, JSCell*, JSString*)); 104 106 JSC_DECLARE_JIT_OPERATION(operationInStructureProperty, EncodedJSValue, (JSGlobalObject*, JSCell*, JSString*)); 105 JSC_DECLARE_JIT_OPERATION(operationHasIndexedPropertyByInt, size_t, (JSGlobalObject*, JSCell*, int32_t, int32_t));106 107 JSC_DECLARE_JIT_OPERATION(operationGetPropertyEnumerator, JSCell*, (JSGlobalObject*, EncodedJSValue)); 107 108 JSC_DECLARE_JIT_OPERATION(operationGetPropertyEnumeratorCell, JSCell*, (JSGlobalObject*, JSCell*)); -
trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
r269343 r270874 1213 1213 break; 1214 1214 } 1215 case HasGenericProperty:1216 case HasStructureProperty:1217 1215 case HasOwnStructureProperty: 1218 1216 case InStructureProperty: 1219 case HasIndexedProperty: { 1217 case HasIndexedProperty: 1218 case HasEnumerableIndexedProperty: 1219 case HasEnumerableStructureProperty: 1220 case HasEnumerableProperty: { 1220 1221 setPrediction(SpecBoolean); 1221 1222 break; -
trunk/Source/JavaScriptCore/dfg/DFGSSALoweringPhase.cpp
r269531 r270874 83 83 84 84 case HasIndexedProperty: 85 case HasEnumerableIndexedProperty: 85 86 lowerBoundsCheck(m_graph.child(m_node, 0), m_graph.child(m_node, 1), m_graph.child(m_node, 2)); 86 87 break; -
trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h
r269343 r270874 293 293 case FiatInt52: 294 294 case HasIndexedProperty: 295 case HasEnumerableIndexedProperty: 295 296 case GetEnumeratorStructurePname: 296 297 case GetEnumeratorGenericPname: … … 629 630 case MultiDeleteByOffset: 630 631 case GetEnumerableLength: 631 case Has GenericProperty:632 case Has StructureProperty:632 case HasEnumerableStructureProperty: 633 case HasEnumerableProperty: 633 634 case HasOwnStructureProperty: 634 635 case InStructureProperty: -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r270764 r270874 12839 12839 } 12840 12840 12841 void SpeculativeJIT::compileHas GenericProperty(Node* node)12841 void SpeculativeJIT::compileHasEnumerableProperty(Node* node) 12842 12842 { 12843 12843 JSValueOperand base(this, node->child1()); … … 12850 12850 JSValueRegsFlushedCallResult result(this); 12851 12851 JSValueRegs resultRegs = result.regs(); 12852 callOperation(operationHas GenericProperty, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, propertyGPR);12852 callOperation(operationHasEnumerableProperty, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, propertyGPR); 12853 12853 m_jit.exceptionCheck(); 12854 12854 blessedBooleanResult(resultRegs.payloadGPR(), node); … … 12990 12990 } 12991 12991 12992 void SpeculativeJIT::compileHas StructureProperty(Node* node)12992 void SpeculativeJIT::compileHasEnumerableStructureProperty(Node* node) 12993 12993 { 12994 12994 JSValueOperand base(this, node->child1()); … … 13012 13012 moveTrueTo(resultRegs.payloadGPR()); 13013 13013 13014 addSlowPathGenerator(slowPathCall(wrongStructure, this, operationHas GenericProperty, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, propertyGPR));13014 addSlowPathGenerator(slowPathCall(wrongStructure, this, operationHasEnumerableProperty, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, propertyGPR)); 13015 13015 blessedBooleanResult(resultRegs.payloadGPR(), node); 13016 13016 } … … 14268 14268 } 14269 14269 14270 void SpeculativeJIT::compileHasIndexedProperty(Node* node )14270 void SpeculativeJIT::compileHasIndexedProperty(Node* node, S_JITOperation_GCZ slowPathOperation) 14271 14271 { 14272 14272 SpeculateCellOperand base(this, m_graph.varArgChild(node, 0)); … … 14384 14384 } 14385 14385 14386 addSlowPathGenerator(slowPathCall(slowCases, this, operationHasIndexedPropertyByInt, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, indexGPR, static_cast<int32_t>(node->internalMethodType())));14386 addSlowPathGenerator(slowPathCall(slowCases, this, slowPathOperation, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, indexGPR)); 14387 14387 14388 14388 unblessedBooleanResult(resultGPR, node); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r269343 r270874 1447 1447 void compileThrowStaticError(Node*); 1448 1448 void compileGetEnumerableLength(Node*); 1449 void compileHasGenericProperty(Node*); 1449 void compileHasEnumerableStructureProperty(Node*); 1450 void compileHasEnumerableProperty(Node*); 1450 1451 void compileToIndexString(Node*); 1451 1452 void compilePutByIdFlush(Node*); … … 1453 1454 void compilePutByIdDirect(Node*); 1454 1455 void compilePutByIdWithThis(Node*); 1455 void compileHasStructureProperty(Node*);1456 1456 template <typename Function> 1457 1457 void compileHasOwnStructurePropertyImpl(Node*, Function); … … 1489 1489 void compileLogShadowChickenPrologue(Node*); 1490 1490 void compileLogShadowChickenTail(Node*); 1491 void compileHasIndexedProperty(Node* );1491 void compileHasIndexedProperty(Node*, S_JITOperation_GCZ); 1492 1492 void compileExtractCatchLocal(Node*); 1493 1493 void compileClearCatchLocals(Node*); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r269343 r270874 4074 4074 break; 4075 4075 } 4076 case Has GenericProperty: {4077 compileHas GenericProperty(node);4078 break; 4079 } 4080 case Has StructureProperty: {4081 compileHas StructureProperty(node);4076 case HasEnumerableStructureProperty: { 4077 compileHasEnumerableStructureProperty(node); 4078 break; 4079 } 4080 case HasEnumerableProperty: { 4081 compileHasEnumerableProperty(node); 4082 4082 break; 4083 4083 } … … 4091 4091 } 4092 4092 case HasIndexedProperty: { 4093 compileHasIndexedProperty(node); 4093 compileHasIndexedProperty(node, operationHasIndexedProperty); 4094 break; 4095 } 4096 case HasEnumerableIndexedProperty: { 4097 compileHasIndexedProperty(node, operationHasEnumerableIndexedProperty); 4094 4098 break; 4095 4099 } -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r269531 r270874 5121 5121 break; 5122 5122 } 5123 case Has GenericProperty: {5124 compileHas GenericProperty(node);5125 break; 5126 } 5127 case Has StructureProperty: {5128 compileHas StructureProperty(node);5123 case HasEnumerableStructureProperty: { 5124 compileHasEnumerableStructureProperty(node); 5125 break; 5126 } 5127 case HasEnumerableProperty: { 5128 compileHasEnumerableProperty(node); 5129 5129 break; 5130 5130 } … … 5138 5138 } 5139 5139 case HasIndexedProperty: { 5140 compileHasIndexedProperty(node); 5140 compileHasIndexedProperty(node, operationHasIndexedProperty); 5141 break; 5142 } 5143 case HasEnumerableIndexedProperty: { 5144 compileHasIndexedProperty(node, operationHasEnumerableIndexedProperty); 5141 5145 break; 5142 5146 } -
trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp
r269343 r270874 281 281 case Int52Constant: 282 282 case BooleanToNumber: 283 case HasGenericProperty: 284 case HasStructureProperty: 283 case HasIndexedProperty: 284 case HasEnumerableIndexedProperty: 285 case HasEnumerableStructureProperty: 286 case HasEnumerableProperty: 285 287 case HasOwnStructureProperty: 286 288 case InStructureProperty: 287 case HasIndexedProperty:288 289 case GetDirectPname: 289 290 case GetEnumerableLength: -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r270764 r270874 1501 1501 break; 1502 1502 case HasIndexedProperty: 1503 compileHasIndexedProperty(); 1504 break; 1505 case HasGenericProperty: 1506 compileHasGenericProperty(); 1507 break; 1508 case HasStructureProperty: 1509 compileHasStructureProperty(); 1503 compileHasIndexedProperty(operationHasIndexedProperty); 1504 break; 1505 case HasEnumerableIndexedProperty: 1506 compileHasIndexedProperty(operationHasEnumerableIndexedProperty); 1507 break; 1508 case HasEnumerableStructureProperty: 1509 compileHasEnumerableStructureProperty(); 1510 break; 1511 case HasEnumerableProperty: 1512 compileHasEnumerableProperty(); 1510 1513 break; 1511 1514 case HasOwnStructureProperty: … … 12493 12496 } 12494 12497 12495 void compileHasIndexedProperty( )12498 void compileHasIndexedProperty(S_JITOperation_GCZ slowPathOperation) 12496 12499 { 12497 12500 JSGlobalObject* globalObject = m_graph.globalObjectFor(m_origin.semantic); … … 12504 12507 case Array::Contiguous: { 12505 12508 LValue storage = lowStorage(m_graph.varArgChild(m_node, 2)); 12506 LValue internalMethodType = m_out.constInt32(static_cast<int32_t>(m_node->internalMethodType()));12507 12509 12508 12510 IndexedAbstractHeap& heap = mode.type() == Array::Int32 ? … … 12535 12537 m_out.appendTo(slowCase, continuation); 12536 12538 ValueFromBlock slowResult = m_out.anchor( 12537 m_out.notZero64(vmCall(Int64, operationHasIndexedPropertyByInt, weakPointer(globalObject), base, index, internalMethodType)));12539 m_out.notZero64(vmCall(Int64, slowPathOperation, weakPointer(globalObject), base, index))); 12538 12540 m_out.jump(continuation); 12539 12541 … … 12544 12546 case Array::Double: { 12545 12547 LValue storage = lowStorage(m_graph.varArgChild(m_node, 2)); 12546 LValue internalMethodType = m_out.constInt32(static_cast<int32_t>(m_node->internalMethodType()));12547 12548 12548 12549 IndexedAbstractHeap& heap = m_heaps.indexedDoubleProperties; … … 12574 12575 m_out.appendTo(slowCase, continuation); 12575 12576 ValueFromBlock slowResult = m_out.anchor( 12576 m_out.notZero64(vmCall(Int64, operationHasIndexedPropertyByInt, weakPointer(globalObject), base, index, internalMethodType)));12577 m_out.notZero64(vmCall(Int64, slowPathOperation, weakPointer(globalObject), base, index))); 12577 12578 m_out.jump(continuation); 12578 12579 … … 12584 12585 case Array::ArrayStorage: { 12585 12586 LValue storage = lowStorage(m_graph.varArgChild(m_node, 2)); 12586 LValue internalMethodType = m_out.constInt32(static_cast<int32_t>(m_node->internalMethodType()));12587 12587 12588 12588 LBasicBlock slowCase = m_out.newBlock(); … … 12612 12612 m_out.appendTo(slowCase, continuation); 12613 12613 ValueFromBlock slowResult = m_out.anchor( 12614 m_out.notZero64(vmCall(Int64, operationHasIndexedPropertyByInt, weakPointer(globalObject), base, index, internalMethodType)));12614 m_out.notZero64(vmCall(Int64, slowPathOperation, weakPointer(globalObject), base, index))); 12615 12615 m_out.jump(continuation); 12616 12616 … … 12621 12621 12622 12622 default: { 12623 LValue internalMethodType = m_out.constInt32(static_cast<int32_t>(m_node->internalMethodType())); 12624 setBoolean(m_out.notZero64(vmCall(Int64, operationHasIndexedPropertyByInt, weakPointer(globalObject), base, index, internalMethodType))); 12625 break; 12626 } 12627 } 12628 } 12629 12630 void compileHasGenericProperty() 12623 setBoolean(m_out.notZero64(vmCall(Int64, slowPathOperation, weakPointer(globalObject), base, index))); 12624 break; 12625 } 12626 } 12627 } 12628 12629 void compileHasEnumerableProperty() 12631 12630 { 12632 12631 JSGlobalObject* globalObject = m_graph.globalObjectFor(m_origin.semantic); 12633 12632 LValue base = lowJSValue(m_node->child1()); 12634 12633 LValue property = lowCell(m_node->child2()); 12635 setJSValue(vmCall(Int64, operationHas GenericProperty, weakPointer(globalObject), base, property));12634 setJSValue(vmCall(Int64, operationHasEnumerableProperty, weakPointer(globalObject), base, property)); 12636 12635 } 12637 12636 … … 12673 12672 } 12674 12673 12675 void compileHas StructureProperty()12676 { 12677 compileHasStructurePropertyImpl(lowJSValue(m_node->child1()), operationHas GenericProperty);12674 void compileHasEnumerableStructureProperty() 12675 { 12676 compileHasStructurePropertyImpl(lowJSValue(m_node->child1()), operationHasEnumerableProperty); 12678 12677 } 12679 12678 -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r270711 r270874 305 305 DEFINE_SLOW_OP(spread) 306 306 DEFINE_SLOW_OP(get_enumerable_length) 307 DEFINE_SLOW_OP(has_ generic_property)307 DEFINE_SLOW_OP(has_enumerable_property) 308 308 DEFINE_SLOW_OP(get_property_enumerator) 309 309 DEFINE_SLOW_OP(to_index_string) … … 464 464 DEFINE_OP(op_put_to_arguments) 465 465 466 DEFINE_OP(op_has_structure_property) 466 DEFINE_OP(op_has_enumerable_indexed_property) 467 DEFINE_OP(op_has_enumerable_structure_property) 467 468 DEFINE_OP(op_has_own_structure_property) 468 469 DEFINE_OP(op_in_structure_property) 469 DEFINE_OP(op_has_indexed_property)470 470 DEFINE_OP(op_get_direct_pname) 471 471 DEFINE_OP(op_enumerator_structure_pname) … … 593 593 DEFINE_SLOWCASE_OP(op_del_by_id) 594 594 DEFINE_SLOWCASE_OP(op_sub) 595 DEFINE_SLOWCASE_OP(op_has_ indexed_property)595 DEFINE_SLOWCASE_OP(op_has_enumerable_indexed_property) 596 596 DEFINE_SLOWCASE_OP(op_get_from_scope) 597 597 DEFINE_SLOWCASE_OP(op_put_to_scope) … … 626 626 DEFINE_SLOWCASE_SLOW_OP(get_direct_pname) 627 627 DEFINE_SLOWCASE_SLOW_OP(get_prototype_of) 628 DEFINE_SLOWCASE_SLOW_OP(has_ structure_property)628 DEFINE_SLOWCASE_SLOW_OP(has_enumerable_structure_property) 629 629 DEFINE_SLOWCASE_SLOW_OP(has_own_structure_property) 630 630 DEFINE_SLOWCASE_SLOW_OP(in_structure_property) -
trunk/Source/JavaScriptCore/jit/JIT.h
r270711 r270874 666 666 template <typename OpCodeType> 667 667 void emit_op_has_structure_propertyImpl(const Instruction*); 668 void emit_op_has_structure_property(const Instruction*); 668 void emit_op_has_enumerable_indexed_property(const Instruction*); 669 void emit_op_has_enumerable_structure_property(const Instruction*); 669 670 void emit_op_has_own_structure_property(const Instruction*); 670 671 void emit_op_in_structure_property(const Instruction*); 671 void emit_op_has_indexed_property(const Instruction*);672 672 void emit_op_get_direct_pname(const Instruction*); 673 673 void emit_op_enumerator_structure_pname(const Instruction*); … … 724 724 void emitSlow_op_put_private_name(const Instruction*, Vector<SlowCaseEntry>::iterator&); 725 725 void emitSlow_op_sub(const Instruction*, Vector<SlowCaseEntry>::iterator&); 726 void emitSlow_op_has_ indexed_property(const Instruction*, Vector<SlowCaseEntry>::iterator&);726 void emitSlow_op_has_enumerable_indexed_property(const Instruction*, Vector<SlowCaseEntry>::iterator&); 727 727 728 728 void emit_op_resolve_scope(const Instruction*); -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r270711 r270874 1393 1393 } 1394 1394 1395 void JIT::emit_op_has_ structure_property(const Instruction* currentInstruction)1396 { 1397 emit_op_has_structure_propertyImpl<OpHas StructureProperty>(currentInstruction);1395 void JIT::emit_op_has_enumerable_structure_property(const Instruction* currentInstruction) 1396 { 1397 emit_op_has_structure_propertyImpl<OpHasEnumerableStructureProperty>(currentInstruction); 1398 1398 } 1399 1399 … … 1435 1435 } 1436 1436 1437 void JIT::emit_op_has_ indexed_property(const Instruction* currentInstruction)1438 { 1439 auto bytecode = currentInstruction->as<OpHas IndexedProperty>();1437 void JIT::emit_op_has_enumerable_indexed_property(const Instruction* currentInstruction) 1438 { 1439 auto bytecode = currentInstruction->as<OpHasEnumerableIndexedProperty>(); 1440 1440 auto& metadata = bytecode.metadata(m_codeBlock); 1441 1441 VirtualRegister dst = bytecode.m_dst; … … 1482 1482 } 1483 1483 1484 void JIT::emitSlow_op_has_ indexed_property(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)1484 void JIT::emitSlow_op_has_enumerable_indexed_property(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1485 1485 { 1486 1486 linkAllSlowCases(iter); 1487 1487 1488 auto bytecode = currentInstruction->as<OpHas IndexedProperty>();1488 auto bytecode = currentInstruction->as<OpHasEnumerableIndexedProperty>(); 1489 1489 VirtualRegister dst = bytecode.m_dst; 1490 1490 VirtualRegister base = bytecode.m_base; -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r270711 r270874 1152 1152 } 1153 1153 1154 void JIT::emit_op_has_ structure_property(const Instruction* currentInstruction)1155 { 1156 emit_op_has_structure_propertyImpl<OpHas StructureProperty>(currentInstruction);1154 void JIT::emit_op_has_enumerable_structure_property(const Instruction* currentInstruction) 1155 { 1156 emit_op_has_structure_propertyImpl<OpHasEnumerableStructureProperty>(currentInstruction); 1157 1157 } 1158 1158 … … 1194 1194 } 1195 1195 1196 void JIT::emit_op_has_ indexed_property(const Instruction* currentInstruction)1197 { 1198 auto bytecode = currentInstruction->as<OpHas IndexedProperty>();1196 void JIT::emit_op_has_enumerable_indexed_property(const Instruction* currentInstruction) 1197 { 1198 auto bytecode = currentInstruction->as<OpHasEnumerableIndexedProperty>(); 1199 1199 auto& metadata = bytecode.metadata(m_codeBlock); 1200 1200 VirtualRegister dst = bytecode.m_dst; … … 1241 1241 } 1242 1242 1243 void JIT::emitSlow_op_has_ indexed_property(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)1243 void JIT::emitSlow_op_has_enumerable_indexed_property(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1244 1244 { 1245 1245 linkAllSlowCases(iter); 1246 1246 1247 auto bytecode = currentInstruction->as<OpHas IndexedProperty>();1247 auto bytecode = currentInstruction->as<OpHasEnumerableIndexedProperty>(); 1248 1248 VirtualRegister dst = bytecode.m_dst; 1249 1249 VirtualRegister base = bytecode.m_base; -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r268794 r270874 2446 2446 if (!CommonSlowPaths::canAccessArgumentIndexQuickly(*object, index)) 2447 2447 byValInfo->arrayProfile->setOutOfBounds(); 2448 return JSValue::encode(jsBoolean(object->has PropertyGeneric(globalObject, index, PropertySlot::InternalMethodType::GetOwnProperty)));2448 return JSValue::encode(jsBoolean(object->hasEnumerableProperty(globalObject, index))); 2449 2449 } 2450 2450 … … 2467 2467 if (!CommonSlowPaths::canAccessArgumentIndexQuickly(*object, index)) 2468 2468 byValInfo->arrayProfile->setOutOfBounds(); 2469 return JSValue::encode(jsBoolean(object->has PropertyGeneric(globalObject, index, PropertySlot::InternalMethodType::GetOwnProperty)));2469 return JSValue::encode(jsBoolean(object->hasEnumerableProperty(globalObject, index))); 2470 2470 } 2471 2471 -
trunk/Source/JavaScriptCore/jit/JITOperations.h
r270764 r270874 139 139 using C_JITOperation_B_GJssJss = uintptr_t(JIT_OPERATION_ATTRIBUTES *)(JSGlobalObject*, JSString*, JSString*); 140 140 using S_JITOperation_GC = size_t(JIT_OPERATION_ATTRIBUTES *)(JSGlobalObject*, JSCell*); 141 using S_JITOperation_GCZ = size_t(JIT_OPERATION_ATTRIBUTES *)(JSGlobalObject*, JSCell*, int32_t); 141 142 using S_JITOperation_GJJ = size_t(JIT_OPERATION_ATTRIBUTES *)(JSGlobalObject*, EncodedJSValue, EncodedJSValue); 142 143 using V_JITOperation_GJJJ = void(JIT_OPERATION_ATTRIBUTES *)(JSGlobalObject*, EncodedJSValue, EncodedJSValue, EncodedJSValue); -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r270764 r270874 1973 1973 slowPathOp(greater) 1974 1974 slowPathOp(greatereq) 1975 slowPathOp(has_ generic_property)1976 slowPathOp(has_ indexed_property)1975 slowPathOp(has_enumerable_indexed_property) 1976 slowPathOp(has_enumerable_property) 1977 1977 1978 1978 if not JSVALUE64 1979 slowPathOp(has_ structure_property)1979 slowPathOp(has_enumerable_structure_property) 1980 1980 slowPathOp(has_own_structure_property) 1981 1981 slowPathOp(in_structure_property) -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r270764 r270874 3042 3042 end 3043 3043 3044 llintOpWithReturn(op_has_ structure_property, OpHasStructureProperty, macro (size, get, dispatch, return)3045 hasStructurePropertyImpl(size, get, dispatch, return, _slow_path_has_ structure_property)3044 llintOpWithReturn(op_has_enumerable_structure_property, OpHasEnumerableStructureProperty, macro (size, get, dispatch, return) 3045 hasStructurePropertyImpl(size, get, dispatch, return, _slow_path_has_enumerable_structure_property) 3046 3046 end) 3047 3047 -
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
r268656 r270874 1041 1041 } 1042 1042 1043 JSC_DEFINE_COMMON_SLOW_PATH(slow_path_has_ indexed_property)1044 { 1045 BEGIN(); 1046 auto bytecode = pc->as<OpHas IndexedProperty>();1043 JSC_DEFINE_COMMON_SLOW_PATH(slow_path_has_enumerable_indexed_property) 1044 { 1045 BEGIN(); 1046 auto bytecode = pc->as<OpHasEnumerableIndexedProperty>(); 1047 1047 auto& metadata = bytecode.metadata(codeBlock); 1048 1048 JSObject* base = GET_C(bytecode.m_base).jsValue().toObject(globalObject); … … 1051 1051 metadata.m_arrayProfile.observeStructure(base->structure(vm)); 1052 1052 ASSERT(property.isUInt32AsAnyInt()); 1053 RETURN(jsBoolean(base->has PropertyGeneric(globalObject, property.asUInt32AsAnyInt(), PropertySlot::InternalMethodType::GetOwnProperty)));1054 } 1055 1056 JSC_DEFINE_COMMON_SLOW_PATH(slow_path_has_ structure_property)1057 { 1058 BEGIN(); 1059 auto bytecode = pc->as<OpHas StructureProperty>();1053 RETURN(jsBoolean(base->hasEnumerableProperty(globalObject, property.asUInt32AsAnyInt()))); 1054 } 1055 1056 JSC_DEFINE_COMMON_SLOW_PATH(slow_path_has_enumerable_structure_property) 1057 { 1058 BEGIN(); 1059 auto bytecode = pc->as<OpHasEnumerableStructureProperty>(); 1060 1060 JSObject* base = GET_C(bytecode.m_base).jsValue().toObject(globalObject); 1061 1061 CHECK_EXCEPTION(); … … 1070 1070 auto propertyName = string->toIdentifier(globalObject); 1071 1071 CHECK_EXCEPTION(); 1072 RETURN(jsBoolean(base->has PropertyGeneric(globalObject, propertyName, PropertySlot::InternalMethodType::GetOwnProperty)));1072 RETURN(jsBoolean(base->hasEnumerableProperty(globalObject, propertyName))); 1073 1073 } 1074 1074 … … 1109 1109 } 1110 1110 1111 JSC_DEFINE_COMMON_SLOW_PATH(slow_path_has_ generic_property)1112 { 1113 BEGIN(); 1114 auto bytecode = pc->as<OpHas GenericProperty>();1111 JSC_DEFINE_COMMON_SLOW_PATH(slow_path_has_enumerable_property) 1112 { 1113 BEGIN(); 1114 auto bytecode = pc->as<OpHasEnumerableProperty>(); 1115 1115 JSObject* base = GET_C(bytecode.m_base).jsValue().toObject(globalObject); 1116 1116 CHECK_EXCEPTION(); … … 1120 1120 auto propertyName = string->toIdentifier(globalObject); 1121 1121 CHECK_EXCEPTION(); 1122 RETURN(jsBoolean(base->has PropertyGeneric(globalObject, propertyName, PropertySlot::InternalMethodType::GetOwnProperty)));1122 RETURN(jsBoolean(base->hasEnumerableProperty(globalObject, propertyName))); 1123 1123 } 1124 1124 -
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h
r267808 r270874 260 260 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_to_property_key); 261 261 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_get_enumerable_length); 262 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_has_generic_property); 263 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_has_structure_property); 262 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_has_enumerable_indexed_property); 263 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_has_enumerable_structure_property); 264 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_has_enumerable_property); 264 265 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_has_own_structure_property); 265 266 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_in_structure_property); 266 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_has_indexed_property);267 267 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_get_direct_pname); 268 268 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_get_property_enumerator); -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r270298 r270874 1988 1988 } 1989 1989 1990 // HasProperty(O, P) from Section 7.3.10 of the spec. 1991 // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-hasproperty 1990 // https://tc39.es/ecma262/#sec-hasproperty 1992 1991 bool JSObject::hasProperty(JSGlobalObject* globalObject, PropertyName propertyName) const 1993 1992 { 1994 return hasPropertyGeneric(globalObject, propertyName, PropertySlot::InternalMethodType::HasProperty); 1993 PropertySlot slot(this, PropertySlot::InternalMethodType::HasProperty); 1994 return const_cast<JSObject*>(this)->getPropertySlot(globalObject, propertyName, slot); 1995 1995 } 1996 1996 1997 1997 bool JSObject::hasProperty(JSGlobalObject* globalObject, unsigned propertyName) const 1998 1998 { 1999 return hasPropertyGeneric(globalObject, propertyName, PropertySlot::InternalMethodType::HasProperty); 1999 PropertySlot slot(this, PropertySlot::InternalMethodType::HasProperty); 2000 return const_cast<JSObject*>(this)->getPropertySlot(globalObject, propertyName, slot); 2000 2001 } 2001 2002 … … 2008 2009 } 2009 2010 2010 bool JSObject::hasPropertyGeneric(JSGlobalObject* globalObject, PropertyName propertyName, PropertySlot::InternalMethodType internalMethodType) const 2011 { 2012 PropertySlot slot(this, internalMethodType); 2013 return const_cast<JSObject*>(this)->getPropertySlot(globalObject, propertyName, slot); 2014 } 2015 2016 bool JSObject::hasPropertyGeneric(JSGlobalObject* globalObject, unsigned propertyName, PropertySlot::InternalMethodType internalMethodType) const 2017 { 2018 PropertySlot slot(this, internalMethodType); 2019 return const_cast<JSObject*>(this)->getPropertySlot(globalObject, propertyName, slot); 2011 bool JSObject::hasEnumerableProperty(JSGlobalObject* globalObject, PropertyName propertyName) const 2012 { 2013 VM& vm = globalObject->vm(); 2014 auto scope = DECLARE_THROW_SCOPE(vm); 2015 PropertySlot slot(this, PropertySlot::InternalMethodType::GetOwnProperty); 2016 bool hasProperty = const_cast<JSObject*>(this)->getPropertySlot(globalObject, propertyName, slot); 2017 RETURN_IF_EXCEPTION(scope, false); 2018 return hasProperty && !(slot.attributes() & PropertyAttribute::DontEnum); 2019 } 2020 2021 bool JSObject::hasEnumerableProperty(JSGlobalObject* globalObject, unsigned propertyName) const 2022 { 2023 VM& vm = globalObject->vm(); 2024 auto scope = DECLARE_THROW_SCOPE(vm); 2025 PropertySlot slot(this, PropertySlot::InternalMethodType::GetOwnProperty); 2026 bool hasProperty = const_cast<JSObject*>(this)->getPropertySlot(globalObject, propertyName, slot); 2027 RETURN_IF_EXCEPTION(scope, false); 2028 return hasProperty && !(slot.attributes() & PropertyAttribute::DontEnum); 2020 2029 } 2021 2030 … … 2372 2381 } 2373 2382 2383 // FIXME: Assert that properties returned by getOwnPropertyNames() are reported enumerable by getOwnPropertySlot(). 2384 // https://bugs.webkit.org/show_bug.cgi?id=219926 2374 2385 void JSObject::getPropertyNames(JSObject* object, JSGlobalObject* globalObject, PropertyNameArray& propertyNames, EnumerationMode mode) 2375 2386 { -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r270298 r270874 656 656 JS_EXPORT_PRIVATE bool hasProperty(JSGlobalObject*, unsigned propertyName) const; 657 657 bool hasProperty(JSGlobalObject*, uint64_t propertyName) const; 658 bool has PropertyGeneric(JSGlobalObject*, PropertyName, PropertySlot::InternalMethodType) const;659 bool has PropertyGeneric(JSGlobalObject*, unsigned propertyName, PropertySlot::InternalMethodType) const;658 bool hasEnumerableProperty(JSGlobalObject*, PropertyName) const; 659 bool hasEnumerableProperty(JSGlobalObject*, unsigned propertyName) const; 660 660 bool hasOwnProperty(JSGlobalObject*, PropertyName, PropertySlot&) const; 661 661 bool hasOwnProperty(JSGlobalObject*, PropertyName) const; -
trunk/Source/WebCore/ChangeLog
r270872 r270874 1 2020-12-15 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Non-enumerable property fails to shadow inherited enumerable property from for-in 4 https://bugs.webkit.org/show_bug.cgi?id=38970 5 6 Reviewed by Keith Miller. 7 8 Report RuntimeArray indices as [[Enumerable]]. 9 10 Test: platform/mac/fast/dom/wrapper-classes-objc.html 11 12 * bridge/runtime_array.cpp: 13 (JSC::RuntimeArray::getOwnPropertySlot): 14 (JSC::RuntimeArray::getOwnPropertySlotByIndex): 15 1 16 2020-12-15 Jer Noble <jer.noble@apple.com> 2 17 -
trunk/Source/WebCore/bridge/runtime_array.cpp
r267727 r270874 101 101 Optional<uint32_t> index = parseIndex(propertyName); 102 102 if (index && index.value() < thisObject->getLength()) { 103 slot.setValue(thisObject, PropertyAttribute::DontDelete | PropertyAttribute::DontEnum,103 slot.setValue(thisObject, static_cast<unsigned>(PropertyAttribute::DontDelete), 104 104 thisObject->getConcreteArray()->valueAt(lexicalGlobalObject, index.value())); 105 105 return true; … … 113 113 RuntimeArray* thisObject = jsCast<RuntimeArray*>(object); 114 114 if (index < thisObject->getLength()) { 115 slot.setValue(thisObject, PropertyAttribute::DontDelete | PropertyAttribute::DontEnum,115 slot.setValue(thisObject, static_cast<unsigned>(PropertyAttribute::DontDelete), 116 116 thisObject->getConcreteArray()->valueAt(lexicalGlobalObject, index)); 117 117 return true;
Note: See TracChangeset
for help on using the changeset viewer.