9091eb19be
This also introduces exhaustive switch-cases for instance types. BUG=chromium:681383 Review-Url: https://codereview.chromium.org/2646433002 Cr-Commit-Position: refs/heads/master@{#42447}
20 lines
431 B
JavaScript
20 lines
431 B
JavaScript
// Copyright 2017 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
|
|
|
|
function f(deopt) {
|
|
let array = [42];
|
|
let it = array[Symbol.iterator]();
|
|
if (deopt) {
|
|
%_DeoptimizeNow();
|
|
return it.next().value;
|
|
}
|
|
}
|
|
|
|
f(false);
|
|
f(false);
|
|
%OptimizeFunctionOnNextCall(f);
|
|
assertEquals(f(true), 42);
|