Commit 4c2b5f4d authored by Anton Bikineev's avatar Anton Bikineev Committed by V8 LUCI CQ

cppgc: Provide API to test if object is marked or freed

This is needed to support minor gc tests on the Blink side.

Bug: chromium:1029379
Change-Id: Ic7ce1ae8e626b87738d76663ceecf7198e425d18
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3437050Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78943}
parent fca5a7f3
...@@ -93,6 +93,8 @@ class V8_EXPORT StandaloneTestingHeap final { ...@@ -93,6 +93,8 @@ class V8_EXPORT StandaloneTestingHeap final {
HeapHandle& heap_handle_; HeapHandle& heap_handle_;
}; };
V8_EXPORT bool IsHeapObjectOld(void*);
} // namespace testing } // namespace testing
} // namespace cppgc } // namespace cppgc
......
...@@ -54,5 +54,13 @@ void StandaloneTestingHeap::ForceCompactionForNextGarbageCollection() { ...@@ -54,5 +54,13 @@ void StandaloneTestingHeap::ForceCompactionForNextGarbageCollection() {
.EnableForNextGCForTesting(); .EnableForNextGCForTesting();
} }
bool IsHeapObjectOld(void* object) {
#if defined(CPPGC_YOUNG_GENERATION)
return internal::HeapObjectHeader::FromObject(object).IsMarked();
#else
return true;
#endif
}
} // namespace testing } // namespace testing
} // namespace cppgc } // namespace cppgc
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