v8/test/mjsunit/modules-turbo.js
neis cc3195abda [modules] Disable Crankshaft for functions referencing module variables.
Also add a primitive mjsunit test that uses such a function optimized by
Turbofan.

R=mstarzinger@chromium.org
CC=adamk@chromium.org
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2472143002
Cr-Commit-Position: refs/heads/master@{#40826}
2016-11-08 11:45:34 +00:00

15 lines
344 B
JavaScript

// 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.
// MODULE
// Flags: --allow-natives-syntax
export let x = 0;
function foo() { x++ };
foo();
%OptimizeFunctionOnNextCall(foo);
foo();
assertOptimized(foo);
assertEquals(2, x);