Commit 22543d70 authored by Omer Katz's avatar Omer Katz Committed by V8 LUCI CQ

[test] Make SamplingHeapProfilerRateAgnosticEstimates more robust.

Inlining of bar into foo required taking allocation in foo into account
as well (crrev.com/c/1021734), but this makes the test vulnerable to gc
timing changes since other allocations are also inlined into foo and may
die at arbitrary times (as observed when enabling MinorMC).
Fix by preventing inlining of bar into foo.

Bug: v8:12612
Change-Id: I2d8848d4002334d329c4b2cc8f18bff1296f5cc1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3882970Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83080}
parent ead6620e
......@@ -3688,6 +3688,7 @@ static int NumberOfAllocations(const v8::AllocationProfile::Node* node) {
static const char* simple_sampling_heap_profiler_script =
"var A = [];\n"
"function bar(size) { return new Array(size); }\n"
"%NeverOptimizeFunction(bar);\n"
"var foo = function() {\n"
" for (var i = 0; i < 1024; ++i) {\n"
" A[i] = bar(1024);\n"
......@@ -3696,6 +3697,7 @@ static const char* simple_sampling_heap_profiler_script =
"foo();";
TEST(SamplingHeapProfiler) {
i::v8_flags.allow_natives_syntax = true;
v8::HandleScope scope(CcTest::isolate());
LocalContext env;
v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
......@@ -3779,6 +3781,7 @@ TEST(SamplingHeapProfiler) {
}
TEST(SamplingHeapProfilerRateAgnosticEstimates) {
i::v8_flags.allow_natives_syntax = true;
v8::HandleScope scope(CcTest::isolate());
LocalContext env;
v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
......
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