Changeset 166276 in webkit
- Timestamp:
- Mar 25, 2014 7:14:40 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r166266 r166276 1 2014-03-25 Filip Pizlo <fpizlo@apple.com> 2 3 DFG::ByteCodeParser::SetMode should distinguish between setting immediately without a flush and setting immediately with a flush 4 https://bugs.webkit.org/show_bug.cgi?id=130760 5 6 Reviewed by Mark Hahnenberg. 7 8 * dfg/DFGByteCodeParser.cpp: 9 (JSC::DFG::ByteCodeParser::setLocal): 10 (JSC::DFG::ByteCodeParser::setArgument): 11 (JSC::DFG::ByteCodeParser::handleInlining): 12 (JSC::DFG::ByteCodeParser::parseBlock): 13 * tests/stress/assign-argument-in-inlined-call.js: Added. 14 (f1): 15 (getF2Arguments): 16 (f2): 17 (f3): 18 * tests/stress/assign-captured-argument-in-inlined-call.js: Added. 19 (f1): 20 (f2): 21 (f3): 22 1 23 2014-03-25 Filip Pizlo <fpizlo@apple.com> 2 24 -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r166142 r166276 250 250 } 251 251 252 enum SetMode { NormalSet, ImmediateSet }; 252 enum SetMode { 253 // A normal set which follows a two-phase commit that spans code origins. During 254 // the current code origin it issues a MovHint, and at the start of the next 255 // code origin there will be a SetLocal. If the local needs flushing, the second 256 // SetLocal will be preceded with a Flush. 257 NormalSet, 258 259 // A set where the SetLocal happens immediately and there is still a Flush. This 260 // is relevant when assigning to a local in tricky situations for the delayed 261 // SetLocal logic but where we know that we have not performed any side effects 262 // within this code origin. This is a safe replacement for NormalSet anytime we 263 // know that we have not yet performed side effects in this code origin. 264 ImmediateSetWithFlush, 265 266 // A set where the SetLocal happens immediately and we do not Flush it even if 267 // this is a local that is marked as needing it. This is relevant when 268 // initializing locals at the top of a function. 269 ImmediateNakedSet 270 }; 253 271 Node* setDirect(VirtualRegister operand, Node* value, SetMode setMode = NormalSet) 254 272 { … … 341 359 bool isCaptured = m_codeBlock->isCaptured(operand, inlineCallFrame()); 342 360 343 if (setMode == NormalSet) {361 if (setMode != ImmediateNakedSet) { 344 362 ArgumentPosition* argumentPosition = findArgumentPositionForLocal(operand); 345 363 if (isCaptured || argumentPosition) … … 400 418 // then make sure that it's never unboxed. 401 419 if (argument) { 402 if (setMode == NormalSet)420 if (setMode != ImmediateNakedSet) 403 421 flushDirect(operand); 404 422 } else if (m_codeBlock->specializationKind() == CodeForConstruct) … … 1400 1418 if (callLinkStatus.isClosureCall()) { 1401 1419 VariableAccessData* calleeVariable = 1402 set(VirtualRegister(JSStack::Callee), callTargetNode, Immediate Set)->variableAccessData();1420 set(VirtualRegister(JSStack::Callee), callTargetNode, ImmediateNakedSet)->variableAccessData(); 1403 1421 VariableAccessData* scopeVariable = 1404 set(VirtualRegister(JSStack::ScopeChain), addToGraph(GetScope, callTargetNode), Immediate Set)->variableAccessData();1422 set(VirtualRegister(JSStack::ScopeChain), addToGraph(GetScope, callTargetNode), ImmediateNakedSet)->variableAccessData(); 1405 1423 1406 1424 calleeVariable->mergeShouldNeverUnbox(true); … … 2148 2166 // Initialize all locals to undefined. 2149 2167 for (int i = 0; i < m_inlineStackTop->m_codeBlock->m_numVars; ++i) 2150 set(virtualRegisterForLocal(i), constantUndefined(), Immediate Set);2168 set(virtualRegisterForLocal(i), constantUndefined(), ImmediateNakedSet); 2151 2169 if (m_inlineStackTop->m_codeBlock->specializationKind() == CodeForConstruct) 2152 set(virtualRegisterForArgument(0), constantUndefined(), Immediate Set);2170 set(virtualRegisterForArgument(0), constantUndefined(), ImmediateNakedSet); 2153 2171 NEXT_OPCODE(op_enter); 2154 2172 … … 2846 2864 if (inlineCallFrame()) { 2847 2865 ASSERT(m_inlineStackTop->m_returnValue.isValid()); 2848 setDirect(m_inlineStackTop->m_returnValue, get(VirtualRegister(currentInstruction[1].u.operand)), ImmediateSet );2866 setDirect(m_inlineStackTop->m_returnValue, get(VirtualRegister(currentInstruction[1].u.operand)), ImmediateSetWithFlush); 2849 2867 m_inlineStackTop->m_didReturn = true; 2850 2868 if (m_inlineStackTop->m_unlinkedBlocks.isEmpty()) { … … 2929 2947 // look like the bytecode had done it. 2930 2948 int nextRegister = registerOffset + JSStack::CallFrameHeaderSize; 2931 set(VirtualRegister(nextRegister++), get(VirtualRegister(thisReg)), Immediate Set);2949 set(VirtualRegister(nextRegister++), get(VirtualRegister(thisReg)), ImmediateNakedSet); 2932 2950 for (unsigned argument = 1; argument < argCount; ++argument) 2933 set(VirtualRegister(nextRegister++), get(virtualRegisterForArgument(argument)), Immediate Set);2951 set(VirtualRegister(nextRegister++), get(virtualRegisterForArgument(argument)), ImmediateNakedSet); 2934 2952 2935 2953 handleCall(
Note: See TracChangeset
for help on using the changeset viewer.