Changeset 164461 in webkit
- Timestamp:
- Feb 20, 2014 6:01:28 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r164457 r164461 1 2014-02-20 Geoffrey Garen <ggaren@apple.com> 2 3 Math.imul gives wrong results 4 https://bugs.webkit.org/show_bug.cgi?id=126345 5 6 Reviewed by Mark Hahnenberg. 7 8 Test this edge case of a double just outside the int range. 9 10 * js/dom/imul-expected.txt: 11 * js/dom/script-tests/imul.js: 12 1 13 2014-02-20 Brady Eidson <beidson@apple.com> 2 14 -
trunk/LayoutTests/js/dom/imul-expected.txt
r156066 r164461 22 22 PASS Math.imul(-Infinity, Infinity) is 0 23 23 PASS Math.imul(-Infinity, -Infinity) is 0 24 PASS Math.imul(0xffffffff, 5) is -5 24 25 PASS testIMul(2,2,10000) is 40000 25 26 PASS testIMul(2.5,2,10000) is 40000 -
trunk/LayoutTests/js/dom/script-tests/imul.js
r156066 r164461 21 21 shouldBe("Math.imul(-Infinity, Infinity)", "0"); 22 22 shouldBe("Math.imul(-Infinity, -Infinity)", "0"); 23 shouldBe("Math.imul(0xffffffff, 5)", "-5"); 23 24 24 25 function testIMul(left, right, count) -
trunk/Source/JavaScriptCore/ChangeLog
r164459 r164461 1 2014-02-20 Geoffrey Garen <ggaren@apple.com> 2 3 Math.imul gives wrong results 4 https://bugs.webkit.org/show_bug.cgi?id=126345 5 6 Reviewed by Mark Hahnenberg. 7 8 Don't truncate non-int doubles to 0 -- that's just not how ToInt32 works. 9 Instead, take a slow path that will do the right thing. 10 11 * jit/ThunkGenerators.cpp: 12 (JSC::imulThunkGenerator): 13 1 14 2014-02-20 Filip Pizlo <fpizlo@apple.com> 2 15 -
trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp
r164039 r164461 925 925 jit.loadDoubleArgument(0, SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::regT0); 926 926 jit.branchTruncateDoubleToInt32(SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::regT0, SpecializedThunkJIT::BranchIfTruncateSuccessful).linkTo(doneLoadingArg0, &jit); 927 jit.xor32(SpecializedThunkJIT::regT0, SpecializedThunkJIT::regT0); 928 jit.jump(doneLoadingArg0); 927 jit.appendFailure(jit.jump()); 929 928 } else 930 929 jit.appendFailure(nonIntArg0Jump); … … 934 933 jit.loadDoubleArgument(1, SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::regT1); 935 934 jit.branchTruncateDoubleToInt32(SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::regT1, SpecializedThunkJIT::BranchIfTruncateSuccessful).linkTo(doneLoadingArg1, &jit); 936 jit.xor32(SpecializedThunkJIT::regT1, SpecializedThunkJIT::regT1); 937 jit.jump(doneLoadingArg1); 935 jit.appendFailure(jit.jump()); 938 936 } else 939 937 jit.appendFailure(nonIntArg1Jump);
Note: See TracChangeset
for help on using the changeset viewer.