js/src/jit-test/tests/ion/truncate.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 function f() {
michael@0 2 var x = Math.pow(2, 31); // take it as argument if constant propagation comes in you way.
michael@0 3 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 32
michael@0 4 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 33
michael@0 5 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 34
michael@0 6 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 35
michael@0 7 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 36
michael@0 8 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 37
michael@0 9 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 38
michael@0 10 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 39
michael@0 11 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 40
michael@0 12 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 41
michael@0 13 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 42
michael@0 14 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 43
michael@0 15 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 44
michael@0 16 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 45
michael@0 17 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 46
michael@0 18 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 47
michael@0 19 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 48
michael@0 20 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 49
michael@0 21 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 50
michael@0 22 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 51
michael@0 23 x = x + x; assertEq((x + 1) | 0, 1); // 2 ** 52
michael@0 24 x = x + x; assertEq((x + 1) | 0, 0); // 2 ** 53
michael@0 25 }
michael@0 26
michael@0 27 for (var i = 0; i <= 100000; i++)
michael@0 28 f();

mercurial