Changeset 110631 in webkit
- Timestamp:
- Mar 13, 2012, 3:59:43 PM (15 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 8 edited
-
ChangeLog (modified) (1 diff)
-
bytecode/PredictedType.cpp (modified) (1 diff)
-
bytecode/PredictedType.h (modified) (1 diff)
-
dfg/DFGAbstractState.cpp (modified) (1 diff)
-
dfg/DFGGraph.cpp (modified) (1 diff)
-
dfg/DFGPredictionPropagationPhase.cpp (modified) (1 diff)
-
dfg/DFGSpeculativeJIT.cpp (modified) (2 diffs)
-
dfg/DFGSpeculativeJIT.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r110617 r110631 1 2012-03-13 Filip Pizlo <fpizlo@apple.com> 2 3 Loads from UInt32Arrays should not result in a double up-convert if it isn't necessary 4 https://bugs.webkit.org/show_bug.cgi?id=80979 5 <rdar://problem/11036848> 6 7 Reviewed by Oliver Hunt. 8 9 Also improved DFG IR dumping to include type information in a somewhat more 10 intuitive way. 11 12 * bytecode/PredictedType.cpp: 13 (JSC::predictionToAbbreviatedString): 14 (JSC): 15 * bytecode/PredictedType.h: 16 (JSC): 17 * dfg/DFGAbstractState.cpp: 18 (JSC::DFG::AbstractState::execute): 19 * dfg/DFGGraph.cpp: 20 (JSC::DFG::Graph::dump): 21 * dfg/DFGPredictionPropagationPhase.cpp: 22 (JSC::DFG::PredictionPropagationPhase::propagate): 23 * dfg/DFGSpeculativeJIT.cpp: 24 (JSC::DFG::SpeculativeJIT::compileUInt32ToNumber): 25 (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): 26 * dfg/DFGSpeculativeJIT.h: 27 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck): 28 1 29 2012-03-13 George Staikos <staikos@webkit.org> 2 30 -
trunk/Source/JavaScriptCore/bytecode/PredictedType.cpp
r108908 r110631 167 167 } 168 168 169 const char* predictionToAbbreviatedString(PredictedType prediction) 170 { 171 if (isFinalObjectPrediction(prediction)) 172 return "<Final>"; 173 if (isArrayPrediction(prediction)) 174 return "<Array>"; 175 if (isStringPrediction(prediction)) 176 return "<String>"; 177 if (isFunctionPrediction(prediction)) 178 return "<Function>"; 179 if (isByteArrayPrediction(prediction)) 180 return "<Bytearray>"; 181 if (isInt8ArrayPrediction(prediction)) 182 return "<Int8array>"; 183 if (isInt16ArrayPrediction(prediction)) 184 return "<Int16array>"; 185 if (isInt32ArrayPrediction(prediction)) 186 return "<Int32array>"; 187 if (isUint8ArrayPrediction(prediction)) 188 return "<Uint8array>"; 189 if (isUint16ArrayPrediction(prediction)) 190 return "<Uint16array>"; 191 if (isUint32ArrayPrediction(prediction)) 192 return "<Uint32array>"; 193 if (isFloat32ArrayPrediction(prediction)) 194 return "<Float32array>"; 195 if (isFloat64ArrayPrediction(prediction)) 196 return "<Float64array>"; 197 if (isObjectPrediction(prediction)) 198 return "<Object>"; 199 if (isCellPrediction(prediction)) 200 return "<Cell>"; 201 if (isInt32Prediction(prediction)) 202 return "<Int32>"; 203 if (isDoublePrediction(prediction)) 204 return "<Double>"; 205 if (isNumberPrediction(prediction)) 206 return "<Number>"; 207 if (isBooleanPrediction(prediction)) 208 return "<Boolean>"; 209 if (isOtherPrediction(prediction)) 210 return "<Other>"; 211 return ""; 212 } 213 169 214 PredictedType predictionFromClassInfo(const ClassInfo* classInfo) 170 215 { -
trunk/Source/JavaScriptCore/bytecode/PredictedType.h
r109865 r110631 226 226 227 227 const char* predictionToString(PredictedType value); 228 const char* predictionToAbbreviatedString(PredictedType value); 228 229 229 230 // Merge two predictions. Note that currently this just does left | right. It may -
trunk/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
r110498 r110631 515 515 forNode(node.child1()).filter(PredictUint32Array); 516 516 forNode(node.child2()).filter(PredictInt32); 517 forNode(nodeIndex).set(PredictDouble); 517 if (node.shouldSpeculateInteger()) 518 forNode(nodeIndex).set(PredictInt32); 519 else 520 forNode(nodeIndex).set(PredictDouble); 518 521 break; 519 522 } -
trunk/Source/JavaScriptCore/dfg/DFGGraph.cpp
r110498 r110631 165 165 else 166 166 hasPrinted = true; 167 dataLog("@%u ", m_varArgChildren[childIdx].index());167 dataLog("@%u%s", m_varArgChildren[childIdx].index(), predictionToAbbreviatedString(at(childIdx).prediction())); 168 168 } 169 169 } else { 170 170 if (!!node.child1()) 171 dataLog("@%u ", node.child1().index());171 dataLog("@%u%s", node.child1().index(), predictionToAbbreviatedString(at(node.child1()).prediction())); 172 172 if (!!node.child2()) 173 dataLog(", @%u ", node.child2().index());173 dataLog(", @%u%s", node.child2().index(), predictionToAbbreviatedString(at(node.child2()).prediction())); 174 174 if (!!node.child3()) 175 dataLog(", @%u ", node.child3().index());175 dataLog(", @%u%s", node.child3().index(), predictionToAbbreviatedString(at(node.child3()).prediction())); 176 176 hasPrinted = !!node.child1(); 177 177 } -
trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
r110518 r110631 398 398 399 399 case GetByVal: { 400 if (m_graph[node.child1()].shouldSpeculate Uint32Array() || m_graph[node.child1()].shouldSpeculateFloat32Array() || m_graph[node.child1()].shouldSpeculateFloat64Array())400 if (m_graph[node.child1()].shouldSpeculateFloat32Array() || m_graph[node.child1()].shouldSpeculateFloat64Array()) 401 401 changed |= mergePrediction(PredictDouble); 402 402 else if (node.getHeapPrediction()) -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r110498 r110631 1548 1548 // to do this because by this point, the original values necessary to compile whatever 1549 1549 // operation the UInt32ToNumber originated from might be dead. 1550 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, op1.gpr(), TrustedImm32(0))); 1551 1552 // Verify that we can do roll forward. 1553 // FIXME: This isn't right, since the next node in the graph may not actually be the next 1554 // node in the basic block's execution sequence. 1555 ASSERT(at(m_compileIndex + 1).op() == SetLocal); 1556 ASSERT(at(m_compileIndex + 1).codeOrigin == node.codeOrigin); 1557 ASSERT(at(m_compileIndex + 2).codeOrigin != node.codeOrigin); 1558 1559 // Now do the magic. 1560 OSRExit& exit = m_jit.codeBlock()->lastOSRExit(); 1561 Node& setLocal = at(m_compileIndex + 1); 1562 exit.m_codeOrigin = at(m_compileIndex + 2).codeOrigin; 1563 exit.m_lastSetOperand = setLocal.local(); 1564 1565 // Create the value recovery, and stuff it into the right place. 1566 exit.valueRecoveryForOperand(setLocal.local()) = ValueRecovery::uint32InGPR(op1.gpr()); 1550 forwardSpeculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, op1.gpr(), TrustedImm32(0)), ValueRecovery::uint32InGPR(op1.gpr())); 1567 1551 1568 1552 m_jit.move(op1.gpr(), result.gpr()); … … 1761 1745 } 1762 1746 outOfBounds.link(&m_jit); 1763 if (elementSize < 4 || signedness == SignedTypedArray) 1747 if (elementSize < 4 || signedness == SignedTypedArray) { 1764 1748 integerResult(resultReg, m_compileIndex); 1765 else { 1766 FPRTemporary fresult(this); 1767 m_jit.convertInt32ToDouble(resultReg, fresult.fpr()); 1768 JITCompiler::Jump positive = m_jit.branch32(MacroAssembler::GreaterThanOrEqual, resultReg, TrustedImm32(0)); 1769 m_jit.addDouble(JITCompiler::AbsoluteAddress(&AssemblyHelpers::twoToThe32), fresult.fpr()); 1770 positive.link(&m_jit); 1771 doubleResult(fresult.fpr(), m_compileIndex); 1772 } 1749 return; 1750 } 1751 1752 ASSERT(elementSize == 4 && signedness == UnsignedTypedArray); 1753 if (node.shouldSpeculateInteger()) { 1754 forwardSpeculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, resultReg, TrustedImm32(0)), ValueRecovery::uint32InGPR(resultReg)); 1755 integerResult(resultReg, m_compileIndex); 1756 return; 1757 } 1758 1759 FPRTemporary fresult(this); 1760 m_jit.convertInt32ToDouble(resultReg, fresult.fpr()); 1761 JITCompiler::Jump positive = m_jit.branch32(MacroAssembler::GreaterThanOrEqual, resultReg, TrustedImm32(0)); 1762 m_jit.addDouble(JITCompiler::AbsoluteAddress(&AssemblyHelpers::twoToThe32), fresult.fpr()); 1763 positive.link(&m_jit); 1764 doubleResult(fresult.fpr(), m_compileIndex); 1773 1765 } 1774 1766 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r110498 r110631 1824 1824 speculationCheck(kind, jsValueSource, nodeUse.index(), jumpToFail, recovery); 1825 1825 } 1826 void forwardSpeculationCheck(ExitKind kind, JSValueSource jsValueSource, NodeIndex nodeIndex, MacroAssembler::Jump jumpToFail, const ValueRecovery& valueRecovery) 1827 { 1828 speculationCheck(kind, jsValueSource, nodeIndex, jumpToFail); 1829 1830 Node& setLocal = at(m_jit.graph().m_blocks[m_block]->at(m_indexInBlock + 1)); 1831 Node& nextNode = at(m_jit.graph().m_blocks[m_block]->at(m_indexInBlock + 2)); 1832 ASSERT(setLocal.op() == SetLocal); 1833 ASSERT(setLocal.codeOrigin == at(m_compileIndex).codeOrigin); 1834 ASSERT(nextNode.codeOrigin != at(m_compileIndex).codeOrigin); 1835 1836 OSRExit& exit = m_jit.codeBlock()->lastOSRExit(); 1837 exit.m_codeOrigin = nextNode.codeOrigin; 1838 exit.m_lastSetOperand = setLocal.local(); 1839 1840 exit.valueRecoveryForOperand(setLocal.local()) = valueRecovery; 1841 } 1826 1842 1827 1843 // Called when we statically determine that a speculation will fail.
Note:
See TracChangeset
for help on using the changeset viewer.