Changeset 228073 in webkit
- Timestamp:
- Feb 4, 2018 9:30:44 PM (6 years ago)
- Location:
- branches/safari-605-branch
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-605-branch/JSTests/ChangeLog
r228068 r228073 1 2018-02-04 Jason Marcell <jmarcell@apple.com> 2 3 Cherry-pick r228031. rdar://problem/37220129 4 5 2018-02-02 Saam Barati <sbarati@apple.com> 6 7 When BytecodeParser inserts Unreachable after ForceOSRExit it needs to update ArgumentPositions for Flushes it inserts 8 https://bugs.webkit.org/show_bug.cgi?id=182368 9 <rdar://problem/36932466> 10 11 Reviewed by Mark Lam. 12 13 * stress/flush-after-force-exit-in-bytecodeparser-needs-to-update-argument-positions.js: Added. 14 (runNearStackLimit.t): 15 (runNearStackLimit): 16 (try.runNearStackLimit): 17 (catch): 18 1 19 2018-02-04 Jason Marcell <jmarcell@apple.com> 2 20 -
branches/safari-605-branch/Source/JavaScriptCore/ChangeLog
r228068 r228073 1 2018-02-04 Jason Marcell <jmarcell@apple.com> 2 3 Cherry-pick r228031. rdar://problem/37220129 4 5 2018-02-02 Saam Barati <sbarati@apple.com> 6 7 When BytecodeParser inserts Unreachable after ForceOSRExit it needs to update ArgumentPositions for Flushes it inserts 8 https://bugs.webkit.org/show_bug.cgi?id=182368 9 <rdar://problem/36932466> 10 11 Reviewed by Mark Lam. 12 13 When preserving liveness when inserting Unreachable nodes after ForceOSRExit, 14 we must add the VariableAccessData to the given argument position. Otherwise, 15 we may end up with a VariableAccessData that doesn't respect the shouldNeverUnbox bit. 16 If we end up with such a situation, it can lead to invalid IR after the 17 arguments elimination phase optimizes a GetByVal to a GetStack. 18 19 * dfg/DFGByteCodeParser.cpp: 20 (JSC::DFG::ByteCodeParser::flushImpl): 21 (JSC::DFG::ByteCodeParser::flushForTerminalImpl): 22 (JSC::DFG::ByteCodeParser::flush): 23 (JSC::DFG::ByteCodeParser::flushForTerminal): 24 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): 25 (JSC::DFG::ByteCodeParser::parse): 26 1 27 2018-02-04 Jason Marcell <jmarcell@apple.com> 2 28 -
branches/safari-605-branch/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r227653 r228073 526 526 numArguments = inlineCallFrame->argumentsWithFixup.size(); 527 527 if (inlineCallFrame->isClosureCall) 528 addFlushDirect( remapOperand(inlineCallFrame, VirtualRegister(CallFrameSlot::callee)));528 addFlushDirect(inlineCallFrame, remapOperand(inlineCallFrame, VirtualRegister(CallFrameSlot::callee))); 529 529 if (inlineCallFrame->isVarargs()) 530 addFlushDirect( remapOperand(inlineCallFrame, VirtualRegister(CallFrameSlot::argumentCount)));530 addFlushDirect(inlineCallFrame, remapOperand(inlineCallFrame, VirtualRegister(CallFrameSlot::argumentCount))); 531 531 } else 532 532 numArguments = m_graph.baselineCodeBlockFor(inlineCallFrame)->numParameters(); 533 533 534 534 for (unsigned argument = numArguments; argument--;) 535 addFlushDirect( remapOperand(inlineCallFrame, virtualRegisterForArgument(argument)));535 addFlushDirect(inlineCallFrame, remapOperand(inlineCallFrame, virtualRegisterForArgument(argument))); 536 536 537 537 if (m_graph.needsScopeRegister()) 538 addFlushDirect( m_graph.m_codeBlock->scopeRegister());538 addFlushDirect(nullptr, m_graph.m_codeBlock->scopeRegister()); 539 539 } 540 540 … … 554 554 for (unsigned local = codeBlock->m_numCalleeLocals; local--;) { 555 555 if (livenessAtBytecode[local]) 556 addPhantomLocalDirect( remapOperand(inlineCallFrame, virtualRegisterForLocal(local)));556 addPhantomLocalDirect(inlineCallFrame, remapOperand(inlineCallFrame, virtualRegisterForLocal(local))); 557 557 } 558 558 }); … … 601 601 void flush(InlineStackEntry* inlineStackEntry) 602 602 { 603 auto addFlushDirect = [&] ( VirtualRegister reg) { flushDirect(reg); };603 auto addFlushDirect = [&] (InlineCallFrame*, VirtualRegister reg) { flushDirect(reg); }; 604 604 flushImpl(inlineStackEntry->m_inlineCallFrame, addFlushDirect); 605 605 } … … 607 607 void flushForTerminal() 608 608 { 609 auto addFlushDirect = [&] ( VirtualRegister reg) { flushDirect(reg); };610 auto addPhantomLocalDirect = [&] ( VirtualRegister reg) { phantomLocalDirect(reg); };609 auto addFlushDirect = [&] (InlineCallFrame*, VirtualRegister reg) { flushDirect(reg); }; 610 auto addPhantomLocalDirect = [&] (InlineCallFrame*, VirtualRegister reg) { phantomLocalDirect(reg); }; 611 611 flushForTerminalImpl(currentCodeOrigin(), addFlushDirect, addPhantomLocalDirect); 612 612 } … … 1026 1026 FrozenValue* m_constantOne; 1027 1027 Vector<Node*, 16> m_constants; 1028 1029 HashMap<InlineCallFrame*, Vector<ArgumentPosition*>, WTF::DefaultHash<InlineCallFrame*>::Hash, WTF::NullableHashTraits<InlineCallFrame*>> m_inlineCallFrameToArgumentPositions; 1028 1030 1029 1031 // The number of arguments passed to the function. … … 6399 6401 6400 6402 int argumentCountIncludingThisWithFixup = std::max<int>(argumentCountIncludingThis, codeBlock->numParameters()); 6401 m_argumentPositions.resize(argumentCountIncludingThisWithFixup); 6402 for (int i = 0; i < argumentCountIncludingThisWithFixup; ++i) { 6403 byteCodeParser->m_graph.m_argumentPositions.append(ArgumentPosition()); 6404 ArgumentPosition* argumentPosition = &byteCodeParser->m_graph.m_argumentPositions.last(); 6405 m_argumentPositions[i] = argumentPosition; 6406 } 6407 6403 6408 6404 if (m_caller) { 6409 6405 // Inline case. … … 6456 6452 } 6457 6453 6454 m_argumentPositions.resize(argumentCountIncludingThisWithFixup); 6455 for (int i = 0; i < argumentCountIncludingThisWithFixup; ++i) { 6456 byteCodeParser->m_graph.m_argumentPositions.append(ArgumentPosition()); 6457 ArgumentPosition* argumentPosition = &byteCodeParser->m_graph.m_argumentPositions.last(); 6458 m_argumentPositions[i] = argumentPosition; 6459 } 6460 byteCodeParser->m_inlineCallFrameToArgumentPositions.add(m_inlineCallFrame, m_argumentPositions); 6461 6458 6462 byteCodeParser->m_inlineStackTop = this; 6459 6463 } … … 6606 6610 insertionSet.insertNode(block->size(), SpecNone, ExitOK, endOrigin); 6607 6611 6608 auto insertLivenessPreservingOp = [&] ( NodeType op, VirtualRegister operand) {6612 auto insertLivenessPreservingOp = [&] (InlineCallFrame* inlineCallFrame, NodeType op, VirtualRegister operand) { 6609 6613 VariableAccessData* variable = mapping.operand(operand); 6610 6614 if (!variable) { … … 6612 6616 mapping.operand(operand) = variable; 6613 6617 } 6618 6619 VirtualRegister argument = operand - (inlineCallFrame ? inlineCallFrame->stackOffset : 0); 6620 if (argument.isArgument() && !argument.isHeader()) { 6621 const Vector<ArgumentPosition*>& arguments = m_inlineCallFrameToArgumentPositions.get(inlineCallFrame); 6622 arguments[argument.toArgument()]->addVariable(variable); 6623 } 6624 6614 6625 insertionSet.insertNode(block->size(), SpecNone, op, endOrigin, OpInfo(variable)); 6615 6626 }; 6616 auto addFlushDirect = [&] (VirtualRegister operand) { insertLivenessPreservingOp(Flush, operand); }; 6617 auto addPhantomLocalDirect = [&] (VirtualRegister operand) { insertLivenessPreservingOp(PhantomLocal, operand); }; 6618 6627 auto addFlushDirect = [&] (InlineCallFrame* inlineCallFrame, VirtualRegister operand) { 6628 insertLivenessPreservingOp(inlineCallFrame, Flush, operand); 6629 }; 6630 auto addPhantomLocalDirect = [&] (InlineCallFrame* inlineCallFrame, VirtualRegister operand) { 6631 insertLivenessPreservingOp(inlineCallFrame, PhantomLocal, operand); 6632 }; 6619 6633 flushForTerminalImpl(endOrigin.semantic, addFlushDirect, addPhantomLocalDirect); 6620 6634
Note: See TracChangeset
for help on using the changeset viewer.