diff options
Diffstat (limited to 'deps/v8/test/mjsunit/compiler/generator-jump-targets.js')
-rw-r--r-- | deps/v8/test/mjsunit/compiler/generator-jump-targets.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/compiler/generator-jump-targets.js b/deps/v8/test/mjsunit/compiler/generator-jump-targets.js new file mode 100644 index 0000000000..85251b5d19 --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/generator-jump-targets.js @@ -0,0 +1,21 @@ +// Copyright 2019 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: --allow-natives-syntax + +var gaga = 42; + +function* foo(x, b) { + if (b) return; + x.p; + while (true) { + gaga; + yield; + } +} +%PrepareFunctionForOptimization(foo); +foo({p:42}, true); +foo({p:42}, true); +%OptimizeFunctionOnNextCall(foo); +const g = foo({p:42}, false); |