17d4868c06
- serializer-*: In some stress configuration, the new map of x was GC'd at the beginning of optimization, thus generating a soft-deopt for the store to x (thus in turn skipping inlining of f). - native-context-*: In some stress configuration, f had its feedback flushed. Bug: v8:10892 Change-Id: Icd9f9c0ba6feb938ae8c3b0031b02b766f2e3f91 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2404764 Commit-Queue: Georg Neis <neis@chromium.org> Commit-Queue: Mythri Alle <mythria@chromium.org> Reviewed-by: Mythri Alle <mythria@chromium.org> Auto-Submit: Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/master@{#69837}
39 lines
821 B
JavaScript
39 lines
821 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 --opt --no-always-opt
|
|
|
|
function f(x) {
|
|
%TurbofanStaticAssert(x.foo === 42);
|
|
return %IsBeingInterpreted();
|
|
}
|
|
|
|
function main(b, ret) {
|
|
const x = new Object();
|
|
const y = x;
|
|
if (b) {
|
|
return ret;
|
|
} else {
|
|
x.foo = 42;
|
|
out = x; // Prevent x's new map from dying too early.
|
|
return f(y);
|
|
}
|
|
}
|
|
|
|
|
|
%PrepareFunctionForOptimization(f);
|
|
%PrepareFunctionForOptimization(main);
|
|
|
|
f({a: 1});
|
|
f({b: 1});
|
|
f({c: 1});
|
|
f({d: 1});
|
|
|
|
assertTrue(main(true, true));
|
|
assertTrue(main(true, true));
|
|
assertTrue(main(false, true));
|
|
assertTrue(main(false, true));
|
|
%OptimizeFunctionOnNextCall(main);
|
|
assertFalse(main(false));
|