v8/test/mjsunit/compiler/generator-jump-targets.js
Georg Neis e5678a6536 [turbofan] Make serializer properly handle resume targets
The bytecode graph builder may insert additional jumps for the
SwitchOnGeneratorState bytecode and for loop headers. This plays into
what the graph builder considers dead/alive. We want the serializer to
process all the bytecodes that the graph builder will process, so the
serializer needs to do something similar.

Bug: v8:7790
Change-Id: I1f1d51f4a8951149e365b3c998cef7f613bb4953
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1647694
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62712}
2019-07-15 12:48:07 +00:00

22 lines
442 B
JavaScript

// 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);