Changeset 139835 in webkit
- Timestamp:
- Jan 15, 2013 9:47:09 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r139834 r139835 1 2013-01-15 Michael Saboff <msaboff@apple.com> 2 3 DFG X86: division in the used-as-int case doesn't correctly check for -2^31/-1 4 https://bugs.webkit.org/show_bug.cgi?id=106978 5 6 Reviewed by Filip Pizlo. 7 8 Added a new DFG check for -2^31 / -1 when we expect and integer result. 9 10 * fast/js/integer-division-neg2tothe32-by-neg1-expected.txt: 11 * fast/js/script-tests/integer-division-neg2tothe32-by-neg1.js: 12 (myDivExpectingInt): 13 1 14 2013-01-15 Dominic Cooney <dominicc@chromium.org> 2 15 -
trunk/LayoutTests/fast/js/integer-division-neg2tothe32-by-neg1-expected.txt
r111481 r139835 2804 2804 PASS myOtherModNeg2ToThe31(v) is -0 2805 2805 PASS myOtherModNeg2ToThe31(3) is -2 2806 PASS myDivExpectingInt(x, y) is x 2806 2807 PASS successfullyParsed is true 2807 2808 -
trunk/LayoutTests/fast/js/script-tests/integer-division-neg2tothe32-by-neg1.js
r111481 r139835 51 51 } 52 52 53 function myDivExpectingInt(a, b) { 54 return (a / b) | 0; 55 } 56 53 57 var w = 4; 54 58 var v = 2; … … 77 81 shouldBe("myOtherModNeg2ToThe31(v)", "-0"); 78 82 shouldBe("myOtherModNeg2ToThe31(3)", "-2"); 83 shouldBe("myDivExpectingInt(x, y)", "x"); 79 84 } 80 85 -
trunk/Source/JavaScriptCore/ChangeLog
r139821 r139835 1 2013-01-15 Michael Saboff <msaboff@apple.com> 2 3 DFG X86: division in the used-as-int case doesn't correctly check for -2^31/-1 4 https://bugs.webkit.org/show_bug.cgi?id=106978 5 6 Reviewed by Filip Pizlo. 7 8 Changed the numerator equal to -2^31 check to just return if we expect an integer 9 result, since the check is after we have determined that the denominator is -1. 10 The int result of -2^31 / -1 is -2^31, so just return the numerator as the result. 11 12 * dfg/DFGSpeculativeJIT.cpp: 13 (JSC::DFG::SpeculativeJIT::compileIntegerArithDivForX86): 14 1 15 2013-01-15 Levi Weintraub <leviw@chromium.org> 2 16 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r139541 r139835 3319 3319 } else { 3320 3320 JITCompiler::Jump zero = m_jit.branchTest32(JITCompiler::Zero, op2GPR); 3321 JITCompiler::Jump notNeg2ToThe31 = m_jit.branch32(JITCompiler::Equal, op1GPR, TrustedImm32(-2147483647-1));3321 JITCompiler::Jump isNeg2ToThe31 = m_jit.branch32(JITCompiler::Equal, op1GPR, TrustedImm32(-2147483647-1)); 3322 3322 zero.link(&m_jit); 3323 3323 m_jit.move(TrustedImm32(0), eax.gpr()); 3324 isNeg2ToThe31.link(&m_jit); 3324 3325 done = m_jit.jump(); 3325 notNeg2ToThe31.link(&m_jit);3326 3326 } 3327 3327
Note: See TracChangeset
for help on using the changeset viewer.