forked from mozilla/mozilla-central
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 825006: There are some more cases where we can convert double ari…
…thmetic to integer arithmetic. (r=nbp)
- Loading branch information
Marty Rosenberg
committed
Jan 13, 2013
1 parent
14a8578
commit e87a80c
Showing
8 changed files
with
105 additions
and
33 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
function f() { | ||
var x = Math.pow(2, 31); // take it as argument if constant propagation comes in you way. | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 32 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 33 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 34 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 35 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 36 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 37 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 38 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 39 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 40 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 41 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 42 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 43 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 44 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 45 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 46 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 47 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 48 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 49 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 50 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 51 | ||
x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 52 | ||
x = x + x; assertEq((x + 1) | 0, 0); // 2 ** 53 | ||
} | ||
|
||
for (var i = 0; i <= 100000; i++) | ||
f(); |