Commit ea04708e authored by Mythri A's avatar Mythri A Committed by Commit Bot

[mjsunit] Fix tests failing with lazy feedback allocation in gc stress

We need to hold onto the bytecode array so it doesn't get flushed.

Bug: v8:8394
Change-Id: Ia583a0a662740e369fcbc1c94041895e463be26e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1645329
Commit-Queue: Mythri Alle <mythria@chromium.org>
Auto-Submit: Mythri Alle <mythria@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62011}
parent 0ea2a34b
......@@ -28,6 +28,7 @@
%TurbofanStaticAssert(Object.is(v2, 123));
}
%PrepareFunctionForOptimization(lit_const_smi);
lit_const_smi(); lit_const_smi();
%OptimizeFunctionOnNextCall(lit_const_smi); lit_const_smi();
......@@ -43,6 +44,7 @@
%TurbofanStaticAssert(Object.is(v2, o));
}
%PrepareFunctionForOptimization(lit_const_object);
lit_const_object(); lit_const_object();
%OptimizeFunctionOnNextCall(lit_const_object); lit_const_object();
......@@ -58,6 +60,7 @@
%TurbofanStaticAssert(Object.is(v2, kk));
}
%PrepareFunctionForOptimization(lit_computed_smi);
lit_computed_smi(1); lit_computed_smi(2);
%OptimizeFunctionOnNextCall(lit_computed_smi); lit_computed_smi(3);
......@@ -76,6 +79,7 @@
%TurbofanStaticAssert(Object.is(v2, k));
}
%PrepareFunctionForOptimization(lit_param_object);
lit_param_object({x: 1}); lit_param_object({x: 2});
%OptimizeFunctionOnNextCall(lit_param_object); lit_param_object({x: 3});
......@@ -90,6 +94,7 @@
%TurbofanStaticAssert(Object.is(v2, k));
}
%PrepareFunctionForOptimization(nested_lit_param);
nested_lit_param(1); nested_lit_param(2);
%OptimizeFunctionOnNextCall(nested_lit_param); nested_lit_param(3);
......@@ -108,12 +113,12 @@
%TurbofanStaticAssert(Object.is(v2, k));
}
%PrepareFunctionForOptimization(nested_lit_param_object);
nested_lit_param_object({x: 1}); nested_lit_param_object({x: 2});
%OptimizeFunctionOnNextCall(nested_lit_param_object);
nested_lit_param_object({x: 3});
%EnsureFeedbackVectorForFunction(inst_param);
function inst_param(k) {
let b = new B(k);
maybe_sideeffect(b);
......@@ -124,6 +129,8 @@
%TurbofanStaticAssert(Object.is(v2, k));
}
%EnsureFeedbackVectorForFunction(B);
%PrepareFunctionForOptimization(inst_param);
inst_param(1); inst_param(2);
%OptimizeFunctionOnNextCall(inst_param); inst_param(3);
......@@ -132,11 +139,11 @@
// inst_param(1.1); inst_param(2.2);
// %OptimizeFunctionOnNextCall(inst_param); inst_param(3.3);
%PrepareFunctionForOptimization(inst_param);
inst_param({x: 1}); inst_param({x: 2});
%OptimizeFunctionOnNextCall(inst_param); inst_param({x: 3});
%EnsureFeedbackVectorForFunction(inst_computed);
function inst_computed(k) {
let kk = 2 * k;
let b = new B(kk);
......@@ -148,9 +155,12 @@
%TurbofanStaticAssert(Object.is(v2, kk));
}
%EnsureFeedbackVectorForFunction(B);
%PrepareFunctionForOptimization(inst_computed);
inst_computed(1); inst_computed(2);
%OptimizeFunctionOnNextCall(inst_computed); inst_computed(3);
%PrepareFunctionForOptimization(inst_computed);
inst_computed(1.1); inst_computed(2.2);
%OptimizeFunctionOnNextCall(inst_computed); inst_computed(3.3);
})();
......@@ -21,7 +21,6 @@ A.prototype = proto;
function foo(o) {
return o.a0;
}
%EnsureFeedbackVectorForFunction(foo);
// Ensure |proto| is in old space.
gc();
......@@ -30,6 +29,7 @@ gc();
// Ensure |proto| is marked as "should be fast".
var o = new A();
%EnsureFeedbackVectorForFunction(foo);
foo(o);
foo(o);
foo(o);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment