| Index: test/mjsunit/shared-function-tier-up-turbo.js
|
| diff --git a/test/mjsunit/shared-function-tier-up-turbo.js b/test/mjsunit/shared-function-tier-up-turbo.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..aa407303e23f95c64d271099d4bc4f39242e118b
|
| --- /dev/null
|
| +++ b/test/mjsunit/shared-function-tier-up-turbo.js
|
| @@ -0,0 +1,24 @@
|
| +// 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.
|
| +//
|
| +// Flags: --mark-shared-functions-for-tier-up --allow-natives-syntax --ignition-staging --turbo
|
| +
|
| +(function f() {
|
| + var sum = 0;
|
| + var i = 0;
|
| + for (var i = 0; i < 3; ++i) {
|
| + var g = function(x) {
|
| + return 2 * x;
|
| + }
|
| + sum += g(i);
|
| +
|
| + if (i == 1) {
|
| + // Run twice (i = 0, 1), then tier-up.
|
| + %OptimizeFunctionOnNextCall(g);
|
| + } else if (i == 2) {
|
| + // Tier-up at i = 2 should go up to turbofan.
|
| + assertEquals(7, %GetOptimizationStatus(g));
|
| + }
|
| + }
|
| +})()
|
|
|