Changeset 281029 in webkit
- Timestamp:
- Aug 13, 2021, 12:29:04 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/for-in-own-structure-and-generic-with-late-add-indexed.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r280886 r281029 1 2021-08-13 Keith Miller <keith_miller@apple.com> 2 3 EnumeratorNextUpdatePropertyName always needs to be able to handle IndexedMode 4 https://bugs.webkit.org/show_bug.cgi?id=229087 5 6 Reviewed by Filip Pizlo. 7 8 * stress/for-in-own-structure-and-generic-with-late-add-indexed.js: Added. 9 (test): 10 (Foo): 11 1 12 2021-08-11 Yusuke Suzuki <ysuzuki@apple.com> 2 13 -
trunk/Source/JavaScriptCore/ChangeLog
r280996 r281029 1 2021-08-13 Keith Miller <keith_miller@apple.com> 2 3 EnumeratorNextUpdatePropertyName always needs to be able to handle IndexedMode 4 https://bugs.webkit.org/show_bug.cgi?id=229087 5 6 Reviewed by Filip Pizlo. 7 8 Right now, this operation incorrectly assumes that EnumeratorNextUpdateIndexAndMode will guarantee 9 the mode matches the seen mode set. But no speculation is guaranteed and adding such a guarantee 10 would require adding checkpoints, which is likely not worth it. Instead, this patch just makes 11 sure we always handle the allocation for IndexedMode. 12 13 * dfg/DFGSpeculativeJIT.cpp: 14 (JSC::DFG::SpeculativeJIT::compileEnumeratorNextUpdatePropertyName): 15 * ftl/FTLLowerDFGToB3.cpp: 16 (JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq): 17 1 18 2021-08-12 Mark Lam <mark.lam@apple.com> 2 19 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r280760 r281029 13592 13592 MacroAssembler::Jump operationCall; 13593 13593 13594 bool needsOperation = seenModes.contains(JSPropertyNameEnumerator::IndexedMode); 13595 13596 // Make sure we flush on all code paths if we could call the operation. 13597 if (needsOperation) 13598 flushRegisters(); 13594 // Make sure we flush on all code paths if we will call the operation. 13595 // Note: we can't omit the operation because we are not guaranteed EnumeratorUpdateIndexAndMode will speculate on the mode. 13596 flushRegisters(); 13599 13597 13600 13598 if (seenModes.containsAny({ JSPropertyNameEnumerator::OwnStructureMode, JSPropertyNameEnumerator::GenericMode })) { 13601 13602 if (needsOperation) 13603 operationCall = m_jit.branchTest32(MacroAssembler::NonZero, mode, TrustedImm32(JSPropertyNameEnumerator::IndexedMode)); 13599 operationCall = m_jit.branchTest32(MacroAssembler::NonZero, mode, TrustedImm32(JSPropertyNameEnumerator::IndexedMode)); 13604 13600 13605 13601 auto outOfBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, index, MacroAssembler::Address(enumerator, JSPropertyNameEnumerator::endGenericPropertyIndexOffset())); … … 13614 13610 outOfBounds.link(&m_jit); 13615 13611 m_jit.moveTrustedValue(jsNull(), resultRegs); 13616 } 13617 13618 if (needsOperation) { 13619 if (operationCall.isSet()) { 13620 doneCases.append(m_jit.jump()); 13621 operationCall.link(&m_jit); 13622 } 13623 callOperation(operationEnumeratorNextUpdatePropertyName, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), index, mode, enumerator); 13624 m_jit.exceptionCheck(); 13625 } 13612 doneCases.append(m_jit.jump()); 13613 operationCall.link(&m_jit); 13614 } 13615 13616 callOperation(operationEnumeratorNextUpdatePropertyName, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), index, mode, enumerator); 13617 m_jit.exceptionCheck(); 13626 13618 13627 13619 doneCases.link(&m_jit); -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r280809 r281029 13139 13139 13140 13140 if (seenModes.containsAny({ JSPropertyNameEnumerator::OwnStructureMode, JSPropertyNameEnumerator::GenericMode })) { 13141 LBasicBlock checkIndex = nullptr;13141 LBasicBlock checkIndex = m_out.newBlock(); 13142 13142 LBasicBlock outOfBoundsBlock = m_out.newBlock(); 13143 13143 LBasicBlock loadPropertyNameBlock = m_out.newBlock(); 13144 13144 continuation = m_out.newBlock(); 13145 13146 if (seenModes.contains(JSPropertyNameEnumerator::IndexedMode)) { 13147 checkIndex = m_out.newBlock(); 13148 operationBlock = m_out.newBlock(); 13149 m_out.branch(m_out.testIsZero32(mode, m_out.constInt32(JSPropertyNameEnumerator::IndexedMode)), unsure(checkIndex), unsure(operationBlock)); 13150 } 13151 13145 operationBlock = m_out.newBlock(); 13146 13147 m_out.branch(m_out.testIsZero32(mode, m_out.constInt32(JSPropertyNameEnumerator::IndexedMode)), unsure(checkIndex), unsure(operationBlock)); 13152 13148 { 13153 if (checkIndex) 13154 m_out.appendTo(checkIndex); 13149 m_out.appendTo(checkIndex); 13155 13150 LValue outOfBounds = m_out.aboveOrEqual(index, m_out.load32(enumerator, m_heaps.JSPropertyNameEnumerator_endGenericPropertyIndex)); 13156 13151 m_out.branch(outOfBounds, unsure(outOfBoundsBlock), unsure(loadPropertyNameBlock)); … … 13171 13166 } 13172 13167 13173 if (seenModes.contains(JSPropertyNameEnumerator::IndexedMode)) { 13174 if (operationBlock) 13175 m_out.appendTo(operationBlock); 13176 results.append(m_out.anchor(vmCall(Int64, operationEnumeratorNextUpdatePropertyName, weakPointer(globalObject), index, mode, enumerator))); 13177 if (continuation) 13178 m_out.jump(continuation); 13179 } 13180 13181 if (continuation) 13168 if (operationBlock) 13169 m_out.appendTo(operationBlock); 13170 // Note: We can't omit the operation because we have no guarantee that the mode will match what we profiled. 13171 results.append(m_out.anchor(vmCall(Int64, operationEnumeratorNextUpdatePropertyName, weakPointer(globalObject), index, mode, enumerator))); 13172 if (continuation) { 13173 m_out.jump(continuation); 13182 13174 m_out.appendTo(continuation); 13175 } 13183 13176 13184 13177 ASSERT(results.size());
Note:
See TracChangeset
for help on using the changeset viewer.