summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/cacheir/optimize-spread.js
blob: accd56ea13df24cb93fec63205ea327a7cc40756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
setJitCompilerOption("ion.forceinlineCaches", 1);

function testOptimizeSpread() {
  function f(a, b) {
    return a + b;
  }
  function g(...rest) {
    return f(...rest);
  }

  for (var i = 0; i < 20; ++i) {
    var v = g(1, 2);
    assertEq(v, 3);
  }
}
for (var i = 0; i < 2; ++i) testOptimizeSpread();