Changeset 281485 in webkit
- Timestamp:
- Aug 23, 2021, 7:59:56 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/for-in-disable-bytecode-generator-peephole-optimizations-after-rewrite.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r281473 r281485 1 2021-08-23 Saam Barati <sbarati@apple.com> 2 3 Disable peephole optimizations in the byte code generator after rewriting instructions for for-in 4 https://bugs.webkit.org/show_bug.cgi?id=229420 5 <rdar://82020528> 6 7 Reviewed by Keith Miller. 8 9 * stress/for-in-disable-bytecode-generator-peephole-optimizations-after-rewrite.js: Added. 10 (foo): 11 1 12 2021-08-23 Saam Barati <sbarati@apple.com> 2 13 -
trunk/Source/JavaScriptCore/ChangeLog
r281473 r281485 1 2021-08-23 Saam Barati <sbarati@apple.com> 2 3 Disable peephole optimizations in the byte code generator after rewriting instructions for for-in 4 https://bugs.webkit.org/show_bug.cgi?id=229420 5 <rdar://82020528> 6 7 Reviewed by Keith Miller. 8 9 The final instruction in a for-in loop might be the get by val that 10 we're rewriting because there was an escape. We won't ever actually 11 do peephole optimizations on this get_by_val today, but it breaks 12 some bookkeeping that the bytecode generator does. This patch makes 13 sure the bookkeeping is up to date. 14 15 * bytecompiler/BytecodeGenerator.cpp: 16 (JSC::ForInContext::finalize): 17 1 18 2021-08-23 Saam Barati <sbarati@apple.com> 2 19 -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r281429 r281485 5370 5370 return; 5371 5371 5372 OpcodeID lastOpcodeID = generator.m_lastOpcodeID;5373 InstructionStream::MutableRef lastInstruction = generator.m_lastInstruction;5374 5375 5372 for (const auto& instTuple : m_getInsts) 5376 5373 rewriteOp<OpEnumeratorGetByVal, OpGetByVal>(generator, instTuple); … … 5391 5388 generator.m_writer.seek(branchInstIndex); 5392 5389 5393 generator.disablePeepholeOptimization();5394 5395 5390 OpJmp::emit(&generator, BoundLabel(static_cast<int>(newBranchTarget) - static_cast<int>(branchInstIndex))); 5396 5391 … … 5399 5394 } 5400 5395 5396 generator.disablePeepholeOptimization(); // We might've just changed the last bytecode that was emitted. 5397 5401 5398 generator.m_writer.seek(generator.m_writer.size()); 5402 if (generator.m_lastInstruction.offset() + generator.m_lastInstruction->size() != generator.m_writer.size()) {5403 generator.m_lastOpcodeID = lastOpcodeID;5404 generator.m_lastInstruction = lastInstruction;5405 }5406 5399 } 5407 5400
Note:
See TracChangeset
for help on using the changeset viewer.