baseline-babel-es2017.js 3.03 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.


new BenchmarkSuite('BaselineES2017', [1000], [
  new Benchmark('Basic', false, false, 0, Basic, Setup),
]);

function _asyncToGenerator(fn) {
  return function () {
    var gen = fn.apply(this, arguments);
    return new Promise(function (resolve, reject) {
      function step(key, arg) {
        try {
          var info = gen[key](arg);
          var value = info.value;
        } catch (error) {
          reject(error);
          return;
        }
        if (info.done) {
          resolve(value);
        } else {
          return Promise.resolve(value)
              .then(function (value) {
                step("next", value);
              }, function (err) {
                step("throw", err);
              });
        }
      }
      return step("next");
    });
  };
}

var a, b, c, d, e, f, g, h, i, j, x;

function Setup() {
  x = Promise.resolve();

  j = (() => {
    var _ref = _asyncToGenerator(function* () {
      return x;
    });

    function j() {
      return _ref.apply(this, arguments);
    }

    return j;
  })();
  i = (() => {
    var _ref2 = _asyncToGenerator(function* () {
      yield j();
      yield j();
      yield j();
      yield j();
      yield j();
      yield j();
      yield j();
      yield j();
      yield j();
      return j();
    });

    function i() {
      return _ref2.apply(this, arguments);
    }

    return i;
  })();
  h = (() => {
    var _ref3 = _asyncToGenerator(function* () {
      return i();
    });

    function h() {
      return _ref3.apply(this, arguments);
    }

    return h;
  })();
  g = (() => {
    var _ref4 = _asyncToGenerator(function* () {
      return h();
    });

    function g() {
      return _ref4.apply(this, arguments);
    }

    return g;
  })();
  f = (() => {
    var _ref5 = _asyncToGenerator(function* () {
      return g();
    });

    function f() {
      return _ref5.apply(this, arguments);
    }

    return f;
  })();
  e = (() => {
    var _ref6 = _asyncToGenerator(function* () {
      return f();
    });

    function e() {
      return _ref6.apply(this, arguments);
    }

    return e;
  })();
  d = (() => {
    var _ref7 = _asyncToGenerator(function* () {
      return e();
    });

    function d() {
      return _ref7.apply(this, arguments);
    }

    return d;
  })();
  c = (() => {
    var _ref8 = _asyncToGenerator(function* () {
      return d();
    });

    function c() {
      return _ref8.apply(this, arguments);
    }

    return c;
  })();
  b = (() => {
    var _ref9 = _asyncToGenerator(function* () {
      return c();
    });

    function b() {
      return _ref9.apply(this, arguments);
    }

    return b;
  })();
  a = (() => {
    var _ref10 = _asyncToGenerator(function* () {
      return b();
    });

    function a() {
      return _ref10.apply(this, arguments);
    }

    return a;
  })();

163
  %PerformMicrotaskCheckpoint();
164 165 166 167
}

function Basic() {
  a();
168
  %PerformMicrotaskCheckpoint();
169
}