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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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

mercurial