Changeset 133135 in webkit
- Timestamp:
- Nov 1, 2012 12:41:43 AM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r133131 r133135 1 2012-10-31 Filip Pizlo <fpizlo@apple.com> 2 3 DFG optimized string access code should be enabled 4 https://bugs.webkit.org/show_bug.cgi?id=100825 5 6 Reviewed by Oliver Hunt. 7 8 - Removes prediction checks from the parser. 9 10 - Fixes the handling of array mode refinement for strings. I.e. we don't do 11 any refinement - we already know it's going to be a string. We could 12 revisit this in the future, but for now the DFG lacks the ability to 13 handle any array modes other than Array::String for string intrinsics, so 14 this is as good as it gets. 15 16 - Removes uses of isBlahSpeculation for checking if a mode is already 17 checked. isBlahSpeculation implicitly checks if the SpeculatedType is not 18 BOTTOM ("empty"), which breaks for checking if a mode is already checked 19 since a mode may already be "checked" in the sense that we've proven that 20 the code is unreachable. 21 22 ~1% speed-up on V8v7, mostly from a speed-up on crypto, which uses string 23 intrinsics in one of the hot functions. 24 25 * bytecode/SpeculatedType.h: 26 (JSC::speculationChecked): 27 (JSC): 28 * dfg/DFGArrayMode.cpp: 29 (JSC::DFG::ArrayMode::alreadyChecked): 30 * dfg/DFGByteCodeParser.cpp: 31 (JSC::DFG::ByteCodeParser::handleIntrinsic): 32 * dfg/DFGFixupPhase.cpp: 33 (JSC::DFG::FixupPhase::fixupNode): 34 * dfg/DFGSpeculativeJIT.cpp: 35 (JSC::DFG::SpeculativeJIT::compileGetCharCodeAt): 36 1 37 2012-10-31 Filip Pizlo <fpizlo@apple.com> 2 38 -
trunk/Source/JavaScriptCore/bytecode/SpeculatedType.h
r127189 r133135 285 285 } 286 286 287 inline bool speculationChecked(SpeculatedType actual, SpeculatedType desired) 288 { 289 return (actual | desired) == desired; 290 } 291 287 292 SpeculatedType speculationFromClassInfo(const ClassInfo*); 288 293 SpeculatedType speculationFromStructure(Structure*); -
trunk/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
r132759 r133135 160 160 161 161 case Array::String: 162 return isStringSpeculation(value.m_type);162 return speculationChecked(value.m_type, SpecString); 163 163 164 164 case Array::Contiguous: … … 202 202 203 203 case Array::Arguments: 204 return isArgumentsSpeculation(value.m_type);204 return speculationChecked(value.m_type, SpecArguments); 205 205 206 206 case Array::Int8Array: 207 return isInt8ArraySpeculation(value.m_type);207 return speculationChecked(value.m_type, SpecInt8Array); 208 208 209 209 case Array::Int16Array: 210 return isInt16ArraySpeculation(value.m_type);210 return speculationChecked(value.m_type, SpecInt16Array); 211 211 212 212 case Array::Int32Array: 213 return isInt32ArraySpeculation(value.m_type);213 return speculationChecked(value.m_type, SpecInt32Array); 214 214 215 215 case Array::Uint8Array: 216 return isUint8ArraySpeculation(value.m_type);216 return speculationChecked(value.m_type, SpecUint8Array); 217 217 218 218 case Array::Uint8ClampedArray: 219 return isUint8ClampedArraySpeculation(value.m_type);219 return speculationChecked(value.m_type, SpecUint8ClampedArray); 220 220 221 221 case Array::Uint16Array: 222 return isUint16ArraySpeculation(value.m_type);222 return speculationChecked(value.m_type, SpecUint16Array); 223 223 224 224 case Array::Uint32Array: 225 return isUint32ArraySpeculation(value.m_type);225 return speculationChecked(value.m_type, SpecUint32Array); 226 226 227 227 case Array::Float32Array: 228 return isFloat32ArraySpeculation(value.m_type);228 return speculationChecked(value.m_type, SpecFloat32Array); 229 229 230 230 case Array::Float64Array: 231 return isFloat64ArraySpeculation(value.m_type);231 return speculationChecked(value.m_type, SpecFloat64Array); 232 232 233 233 case Array::SelectUsingPredictions: -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r132759 r133135 1690 1690 1691 1691 int thisOperand = registerOffset + argumentToOperand(0); 1692 if (!(m_graph[get(thisOperand)].prediction() & SpecString))1693 return false;1694 1695 1692 int indexOperand = registerOffset + argumentToOperand(1); 1696 1693 NodeIndex charCode = addToGraph(StringCharCodeAt, OpInfo(Array::String), get(thisOperand), getToInt32(indexOperand)); … … 1706 1703 1707 1704 int thisOperand = registerOffset + argumentToOperand(0); 1708 if (!(m_graph[get(thisOperand)].prediction() & SpecString))1709 return false;1710 1711 1705 int indexOperand = registerOffset + argumentToOperand(1); 1712 1706 NodeIndex charCode = addToGraph(StringCharAt, OpInfo(Array::String), get(thisOperand), getToInt32(indexOperand)); -
trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
r132759 r133135 128 128 break; 129 129 } 130 case GetByVal: 131 case StringCharAt: 132 case StringCharCodeAt: { 130 case GetByVal: { 133 131 node.setArrayMode( 134 132 node.arrayMode().refine( … … 136 134 m_graph[node.child2()].prediction())); 137 135 136 blessArrayOperation(node.child1(), node.child2(), 2); 137 break; 138 } 139 case StringCharAt: 140 case StringCharCodeAt: { 141 // Currently we have no good way of refining these. 142 ASSERT(node.arrayMode() == ArrayMode(Array::String)); 138 143 blessArrayOperation(node.child1(), node.child2(), 2); 139 144 break; -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r132759 r133135 1800 1800 void SpeculativeJIT::compileGetCharCodeAt(Node& node) 1801 1801 { 1802 ASSERT(node.child3() == NoNode);1803 1802 SpeculateCellOperand string(this, node.child1()); 1804 1803 SpeculateStrictInt32Operand index(this, node.child2()); … … 1809 1808 GPRReg storageReg = storage.gpr(); 1810 1809 1811 if (!isStringSpeculation(m_state.forNode(node.child1()).m_type)) { 1812 ASSERT(!(at(node.child1()).prediction() & SpecString)); 1813 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1814 noResult(m_compileIndex); 1815 return; 1816 } 1810 ASSERT(speculationChecked(m_state.forNode(node.child1()).m_type, SpecString)); 1817 1811 1818 1812 // unsigned comparison so we can filter out negative indices and indices that are too large
Note: See TracChangeset
for help on using the changeset viewer.