[gcmole] Add regression test with multiple safepoints

Bug: v8:13536
Change-Id: I1cac6a34b6948f7e5365c5454ad6d3f928d906d4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4134164
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85111}
This commit is contained in:
Michael Achenbach 2023-01-03 21:32:02 +01:00 committed by V8 LUCI CQ
parent ca3a939da8
commit 43fd63554e
2 changed files with 20 additions and 1 deletions

View File

@ -349,5 +349,15 @@ void TestGuardedDeadVarAnalysisMidFunction2(Isolate* isolate) {
raw_obj.Print();
}
void TestGuardedDeadVarAnalysisMultipleSafepoints(Isolate* isolate) {
// TODO(https://crbug.com/v8/13536): The analysis points to this safepoint,
// while it should point to the one below.
Safepoint();
JSObject raw_obj = *isolate->factory()->NewJSObjectWithNullProto();
DisallowGarbageCollection no_gc;
Safepoint();
raw_obj.Print();
}
} // namespace internal
} // namespace v8

View File

@ -214,4 +214,13 @@ tools/gcmole/gcmole-test.cc:345:3: note: Call might cause unexpected GC.
tools/gcmole/gcmole-test.cc:27:1: note: GC call here.
Object CauseGCRaw(Object obj, Isolate* isolate) {
^
24 warnings generated.
tools/gcmole/gcmole-test.cc:359:3: warning: Possibly stale variable due to GCs.
raw_obj.Print();
^
tools/gcmole/gcmole-test.cc:355:3: note: Call might cause unexpected GC.
Safepoint();
^
tools/gcmole/gcmole-test.cc:19:1: note: GC call here.
void Safepoint() { LocalHeap::Current()->Safepoint(); }
^
25 warnings generated.