js/src/jit-test/tests/ion/inlining/inline-callarg-ubench-no-double2.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.

     1 function lameFunc(x, y) {
     2   var lsw = (x & 0xFFFF) + (y & 0xFFFF);
     3   var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
     4   return (msw << 16) | (lsw & 0xFFFF);
     5 }
     7 function runSomeTimes(func, iters) {
     8     var result;
     9     for (var i = 0; i < iters; ++i) {
    10         result = func(42, 42);
    11         result = func(42, 42);
    12     }
    13     return result;
    14 }
    16 // First, run the inner function to get TI information.
    17 for (var i = 0; i < 100; ++i)
    18     lameFunc(42, 42);
    20 // Then, run the outer function with the inner function as a CALLARG to get it
    21 // to Ion compile with inlining.
    22 for (var i = 0; i < 11000; ++i)
    23     runSomeTimes(lameFunc, 1);
    25 // Lastly, now that we're all inlined and compiled, perform the test!
    26 var iterations = 100;
    27 assertEq(84, runSomeTimes(lameFunc, iterations));

mercurial