OLD | NEW |
---|---|
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 Loading... | |
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
| |
OLD | NEW |