Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://bugs.webkit.org/show_bug.cgi?id=184023 Reviewed by Yusuke Suzuki and Filip Pizlo. JSTests: * stress/double-to-int32-NaN.js: Added. (assert): (foo): Source/JavaScriptCore: ARMv8.3 introduced the fjcvtzs instruction which does double->int32 conversion using the semantics defined by JavaScript: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0801g/hko1477562192868.html This patch teaches JSC to use that instruction when possible. * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::fjcvtzs): (JSC::ARM64Assembler::fjcvtzsInsn): * assembler/MacroAssemblerARM64.cpp: (JSC::MacroAssemblerARM64::collectCPUFeatures): * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::supportsDoubleToInt32ConversionUsingJavaScriptSemantics): (JSC::MacroAssemblerARM64::convertDoubleToInt32UsingJavaScriptSemantics): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileValueToInt32): * disassembler/ARM64/A64DOpcode.cpp: * disassembler/ARM64/A64DOpcode.h: (JSC::ARM64Disassembler::A64DOpcode::appendInstructionName): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::doubleToInt32): * jit/JITRightShiftGenerator.cpp: (JSC::JITRightShiftGenerator::generateFastPath): * runtime/MathCommon.h: (JSC::toInt32): Source/WTF: * wtf/Platform.h: Identifier: 205510@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Saam Barati
committed
Oct 15, 2018
1 parent
4b9076c
commit 981565a
Showing
14 changed files
with
167 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
function assert(b) { | ||
if (!b) | ||
throw new Error; | ||
} | ||
|
||
function foo(view) { | ||
let x = view.getFloat64(0); | ||
return [x, x | 0]; | ||
} | ||
noInline(foo); | ||
|
||
let buffer = new ArrayBuffer(8); | ||
let view = new DataView(buffer); | ||
for (let i = 0; i < 1000000; ++i) { | ||
for (let i = 0; i < 8; ++i) { | ||
view.setInt8(i, Math.random() * 255); | ||
} | ||
|
||
let [a, b] = foo(view); | ||
if (isNaN(a)) | ||
assert(b === 0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters