Commit ee41a8a8 authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

api: Mark explicit write barrier methods as soon deprecated

Explicit write barriers for internal fields are deprecated as they are
automatically emitted by V8.

Depends on:
  https://crrev.com/c/3263924

Bug: v8:12356
Change-Id: I171ba5b42a6570ce52e2e2ea1b7c1029d5a8a3a7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3263888Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77772}
parent 670399fa
......@@ -235,9 +235,13 @@ class V8_EXPORT JSHeapConsistency final {
* \returns whether a write barrier is needed and which barrier to invoke.
*/
template <typename HeapHandleCallback>
static V8_INLINE WriteBarrierType GetWriteBarrierType(
v8::Local<v8::Object>& wrapper, int wrapper_index, const void* wrappable,
WriteBarrierParams& params, HeapHandleCallback callback) {
V8_DEPRECATE_SOON(
"Write barriers automatically emitted when using "
"`SetAlignedPointerInInternalFields()`.")
static V8_INLINE WriteBarrierType
GetWriteBarrierType(v8::Local<v8::Object>& wrapper, int wrapper_index,
const void* wrappable, WriteBarrierParams& params,
HeapHandleCallback callback) {
#if V8_ENABLE_CHECKS
CheckWrapper(wrapper, wrapper_index, wrappable);
#endif // V8_ENABLE_CHECKS
......@@ -270,6 +274,9 @@ class V8_EXPORT JSHeapConsistency final {
* \param object The pointer to the object. May be an interior pointer to a
* an interface of the actual object.
*/
V8_DEPRECATE_SOON(
"Write barriers automatically emitted when using "
"`SetAlignedPointerInInternalFields()`.")
static V8_INLINE void DijkstraMarkingBarrier(const WriteBarrierParams& params,
cppgc::HeapHandle& heap_handle,
const void* object) {
......
......@@ -93,7 +93,12 @@ TEST_F(UnifiedHeapTest, WriteBarrierV8ToCppReference) {
EXPECT_EQ(0u, Wrappable::destructor_callcount);
}
#if !defined(_MSC_VER) || defined(__clang__)
TEST_F(UnifiedHeapTest, WriteBarrierV8ToCppReferenceWithExplicitAPI) {
// TODO(v8:12356): Remove test when fully removing the deprecated API.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
if (!FLAG_incremental_marking) return;
v8::HandleScope scope(v8_isolate());
v8::Local<v8::Context> context = v8::Context::New(v8_isolate());
......@@ -118,10 +123,9 @@ TEST_F(UnifiedHeapTest, WriteBarrierV8ToCppReferenceWithExplicitAPI) {
}
CollectGarbageWithoutEmbedderStack(cppgc::Heap::SweepingType::kAtomic);
EXPECT_EQ(0u, Wrappable::destructor_callcount);
#pragma GCC diagnostic pop
}
#if !defined(_MSC_VER) || defined(__clang__)
TEST_F(UnifiedHeapTest, WriteBarrierCppToV8Reference) {
// TODO(v8:12165): Remove test when fully removing the deprecated API.
#pragma GCC diagnostic push
......
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