Changeset 194996 in webkit
- Timestamp:
- Jan 13, 2016, 3:28:38 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r194981 r194996 1 2016-01-13 Mark Lam <mark.lam@apple.com> 2 3 The StringFromCharCode DFG intrinsic should support untyped operands. 4 https://bugs.webkit.org/show_bug.cgi?id=153046 5 6 Reviewed by Geoffrey Garen. 7 8 * js/regress/ftl-polymorphic-StringFromCharCode-expected.txt: Added. 9 * js/regress/ftl-polymorphic-StringFromCharCode.html: Added. 10 * js/regress/script-tests/ftl-polymorphic-StringFromCharCode.js: Added. 11 (o1.valueOf): 12 (foo): 13 1 14 2016-01-13 Joseph Pecoraro <pecoraro@apple.com> 2 15 -
trunk/Source/JavaScriptCore/ChangeLog
r194983 r194996 1 2016-01-13 Mark Lam <mark.lam@apple.com> 2 3 The StringFromCharCode DFG intrinsic should support untyped operands. 4 https://bugs.webkit.org/show_bug.cgi?id=153046 5 6 Reviewed by Geoffrey Garen. 7 8 The current StringFromCharCode DFG intrinsic assumes that its operand charCode 9 must be an Int32. This results in 26000+ BadType OSR exits in the LongSpider 10 crypto-aes benchmark. With support for Untyped operands, the number of OSR 11 exits drops to 202. 12 13 * dfg/DFGClobberize.h: 14 (JSC::DFG::clobberize): 15 * dfg/DFGFixupPhase.cpp: 16 (JSC::DFG::FixupPhase::fixupNode): 17 * dfg/DFGOperations.cpp: 18 * dfg/DFGOperations.h: 19 * dfg/DFGSpeculativeJIT.cpp: 20 (JSC::DFG::SpeculativeJIT::compileFromCharCode): 21 * dfg/DFGSpeculativeJIT.h: 22 (JSC::DFG::SpeculativeJIT::callOperation): 23 * dfg/DFGValidate.cpp: 24 (JSC::DFG::Validate::validate): 25 * runtime/JSCJSValueInlines.h: 26 (JSC::JSValue::toUInt32): 27 1 28 2016-01-13 Mark Lam <mark.lam@apple.com> 2 29 -
trunk/Source/JavaScriptCore/dfg/DFGClobberize.h
r194770 r194996 136 136 case SkipScope: 137 137 case StringCharCodeAt: 138 case StringFromCharCode:139 138 case CompareStrictEq: 140 139 case IsUndefined: … … 258 257 return; 259 258 } 259 260 case StringFromCharCode: 261 switch (node->child1().useKind()) { 262 case Int32Use: 263 def(PureValue(node)); 264 return; 265 case UntypedUse: 266 read(World); 267 write(Heap); 268 return; 269 default: 270 DFG_CRASH(graph, node, "Bad use kind"); 271 } 272 return; 260 273 261 274 case ArithAdd: -
trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
r194983 r194996 603 603 604 604 case StringFromCharCode: 605 if (node->child1()->shouldSpeculateUntypedForArithmetic()) { 606 fixEdge<UntypedUse>(node->child1()); 607 break; 608 } 605 609 fixEdge<Int32Use>(node->child1()); 606 610 break; -
trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
r194863 r194996 1314 1314 } 1315 1315 1316 EncodedJSValue JIT_OPERATION operationStringFromCharCodeUntyped(ExecState* exec, EncodedJSValue encodedValue) 1317 { 1318 VM* vm = &exec->vm(); 1319 NativeCallFrameTracer tracer(vm, exec); 1320 JSValue charValue = JSValue::decode(encodedValue); 1321 int32_t chInt = charValue.toUInt32(exec); 1322 return JSValue::encode(JSC::stringFromCharCode(exec, chInt)); 1323 } 1324 1316 1325 int64_t JIT_OPERATION operationConvertBoxedDoubleToInt52(EncodedJSValue encodedValue) 1317 1326 { -
trunk/Source/JavaScriptCore/dfg/DFGOperations.h
r194770 r194996 39 39 40 40 JSCell* JIT_OPERATION operationStringFromCharCode(ExecState*, int32_t) WTF_INTERNAL; 41 EncodedJSValue JIT_OPERATION operationStringFromCharCodeUntyped(ExecState*, EncodedJSValue) WTF_INTERNAL; 41 42 42 43 // These routines are provide callbacks out to C++ implementations of operations too complex to JIT. -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r194835 r194996 1872 1872 void SpeculativeJIT::compileFromCharCode(Node* node) 1873 1873 { 1874 SpeculateStrictInt32Operand property(this, node->child1()); 1874 Edge& child = node->child1(); 1875 if (child.useKind() == UntypedUse) { 1876 JSValueOperand opr(this, child); 1877 JSValueRegs oprRegs = opr.jsValueRegs(); 1878 #if USE(JSVALUE64) 1879 GPRTemporary result(this); 1880 JSValueRegs resultRegs = JSValueRegs(result.gpr()); 1881 #else 1882 GPRTemporary resultTag(this); 1883 GPRTemporary resultPayload(this); 1884 JSValueRegs resultRegs = JSValueRegs(resultPayload.gpr(), resultTag.gpr()); 1885 #endif 1886 flushRegisters(); 1887 callOperation(operationStringFromCharCodeUntyped, resultRegs, oprRegs); 1888 m_jit.exceptionCheck(); 1889 1890 jsValueResult(resultRegs, node); 1891 return; 1892 } 1893 1894 SpeculateStrictInt32Operand property(this, child); 1875 1895 GPRReg propertyReg = property.gpr(); 1876 1896 GPRTemporary smallStrings(this); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r194248 r194996 1410 1410 return appendCallSetResult(operation, result); 1411 1411 } 1412 JITCompiler::Call callOperation(J_JITOperation_EJ operation, JSValueRegs result, JSValueRegs arg1) 1413 { 1414 return callOperation(operation, result.payloadGPR(), arg1.payloadGPR()); 1415 } 1412 1416 JITCompiler::Call callOperation(J_JITOperation_EJ operation, GPRReg result, GPRReg arg1) 1413 1417 { … … 1610 1614 m_jit.setupArgumentsWithExecState(arg1, arg2); 1611 1615 return appendCallSetResult(operation, resultPayload, resultTag); 1616 } 1617 JITCompiler::Call callOperation(J_JITOperation_EJ operation, JSValueRegs result, JSValueRegs arg1) 1618 { 1619 return callOperation(operation, result.tagGPR(), result.payloadGPR(), arg1.tagGPR(), arg1.payloadGPR()); 1612 1620 } 1613 1621 JITCompiler::Call callOperation(J_JITOperation_EJ operation, GPRReg resultPayload, GPRReg resultTag, GPRReg arg1) -
trunk/Source/JavaScriptCore/dfg/DFGValidate.cpp
r194216 r194996 265 265 break; 266 266 case CheckStructure: 267 case StringFromCharCode: 267 268 VALIDATE((node), !!node->child1()); 268 269 break; -
trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h
r194175 r194996 47 47 inline uint32_t JSValue::toUInt32(ExecState* exec) const 48 48 { 49 // See comment on JSC::toUInt32, above.49 // See comment on JSC::toUInt32, in JSCJSValue.h. 50 50 return toInt32(exec); 51 51 }
Note:
See TracChangeset
for help on using the changeset viewer.