Skip to content

Commit

Permalink
Revert TracedReference deref API removal
Browse files Browse the repository at this point in the history
This API was removed in V8 12.7, but we don't know how to safely replace our use of it yet.
  • Loading branch information
harrishancock committed Jun 28, 2024
1 parent 4e80382 commit 7a77689
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ http_archive(
"//:patches/v8/0014-Modify-where-to-look-for-fp16-dependency.-This-depen.patch",
"//:patches/v8/0015-Expose-v8-Symbol-GetDispose.patch",
"//:patches/v8/0016-Rename-V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE-V8_COMPR.patch",
"//:patches/v8/0017-Revert-TracedReference-deref-API-removal.patch",
],
integrity = "sha256-A5gcTFlyFPytY8/xVz9okQzqXB3f6Zo3vQNOMhEyKyY=",
strip_prefix = "v8-12.7.224.1",
Expand Down
29 changes: 29 additions & 0 deletions patches/v8/0017-Revert-TracedReference-deref-API-removal.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From e35a1f2acb6b61c1a74788c7e772376e307f9aba Mon Sep 17 00:00:00 2001
From: Harris Hancock <harris@cloudflare.com>
Date: Fri, 28 Jun 2024 14:19:25 +0100
Subject: Revert TracedReference deref API removal

This previously-deprecated API was removed in 7cd2b0c434bd5ea7bd253a97958c7348557fd72e, but we don't know how to safely replace our usage of it yet.

diff --git a/include/v8-traced-handle.h b/include/v8-traced-handle.h
index 04752c4f2aeed025364326fb0a0d85c03ba3347c..f1a41b1d8cd756358b536ee90ca9bd8c6b601e69 100644
--- a/include/v8-traced-handle.h
+++ b/include/v8-traced-handle.h
@@ -135,6 +135,17 @@ class BasicTracedReference : public TracedReferenceBase {
const_cast<BasicTracedReference<T>&>(*this));
}

+ V8_DEPRECATED("Use Get to convert to Local instead")
+ V8_INLINE T* operator->() const {
+#ifdef V8_ENABLE_CHECKS
+ CheckValue();
+#endif // V8_ENABLE_CHECKS
+ return this->template value<T>();
+ }
+
+ V8_DEPRECATED("Use Get to convert to Local instead")
+ V8_INLINE T* operator*() const { return this->operator->(); }
+
private:
/**
* An empty BasicTracedReference without storage cell.

0 comments on commit 7a77689

Please sign in to comment.