Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 enableOsiPointRegisterChecks();
3 function DiagModule(stdlib, foreign) {
4 "use asm";
6 var sqrt = stdlib.Math.sqrt;
7 var test = foreign.test;
9 function square(x) {
10 x = x|0;
11 return ((x|0)+(x|0))|0;
12 }
14 function diag() {
15 var x = 0.0;
16 while(1) {
17 test(1, x);
18 x = x+1.0
19 if (x > 15.0)
20 return 0;
21 }
22 return 0;
23 }
25 function diag_1() {
26 test();
27 return 0;
28 }
31 return { diag: diag, diag_1:diag_1 };
32 }
34 var foreign = {
35 test:function(a,b) {
36 print(a+":"+b)
37 var c = [0.0];
38 if (b > 10)
39 return c[1];
40 return c[0];
41 }
42 }
44 // make sure foreign is compiled
46 var fast = DiagModule(this, foreign); // produces AOT-compiled version
47 print(fast.diag()); // 5
48 gc()
49 print(fast.diag()); // 5