Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: test/mjsunit/smi-ops.js

Issue 1756007: Fix error in static type information computation for bitwise shift. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 } 662 }
663 } 663 }
664 664
665 intConversion(); 665 intConversion();
666 666
667 // Verify that we handle the (optimized) corner case of shifting by 667 // Verify that we handle the (optimized) corner case of shifting by
668 // zero even for non-smis. 668 // zero even for non-smis.
669 function shiftByZero(n) { return n << 0; } 669 function shiftByZero(n) { return n << 0; }
670 670
671 assertEquals(3, shiftByZero(3.1415)); 671 assertEquals(3, shiftByZero(3.1415));
672
673 // Verify that the static type information of x >>> 32 is computed correctly.
674 function LogicalShiftRightByMultipleOf32(x) {
675 x = x >>> 32;
676 return x + x;
677 }
678
679 assertEquals(4589934592, LogicalShiftRightByMultipleOf32(-2000000000));
680 assertEquals(4589934592, LogicalShiftRightByMultipleOf32(-2000000000));
Lasse Reichstein 2010/04/22 08:59:04 Why the same line twice?
William Hesse 2010/04/22 09:01:29 Because the function returns different answers eac
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698