Skip to content

Commit 5c4a937

Browse files
backesV8 LUCI CQ
authored andcommitted
[api] Deprecate some GetIsolate methods
Reading the isolate from on-heap objects is deprecated. It is already being checked though that this returns the same as the "current" isolate. Hence start the deprecation process. Uses within V8 have been moved to `Isolate::GetCurrent()` already (https://crrev.com/c/6564467). [email protected] Bug: 396607238 Change-Id: If51112c2b6c53c40d7872de646253d32bb4cf0d3 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6563615 Reviewed-by: Leszek Swirski <[email protected]> Commit-Queue: Clemens Backes <[email protected]> Cr-Commit-Position: refs/heads/main@{#100398}
1 parent 6699f06 commit 5c4a937

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

include/v8-context.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ class V8_EXPORT Context : public Data {
256256
Maybe<void> DeepFreeze(DeepFreezeDelegate* delegate = nullptr);
257257

258258
/** Returns the isolate associated with a current context. */
259+
V8_DEPRECATE_SOON(
260+
"Use Isolate::GetCurrent() instead, which is guaranteed to return the "
261+
"same isolate since https://crrev.com/c/6458560.")
259262
Isolate* GetIsolate();
260263

261264
/** Returns the microtask queue associated with a current context. */

include/v8-function-callback.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ class ReturnValue {
6666
V8_INLINE void Set(uint16_t i);
6767
V8_INLINE void Set(uint32_t i);
6868
V8_INLINE void Set(uint64_t i);
69-
// Fast JS primitive setters
69+
// Fast JS primitive setters.
7070
V8_INLINE void SetNull();
7171
V8_INLINE void SetUndefined();
7272
V8_INLINE void SetFalse();
7373
V8_INLINE void SetEmptyString();
74-
// Convenience getter for Isolate
74+
// Convenience getter for the Isolate.
7575
V8_INLINE Isolate* GetIsolate() const;
7676

7777
// Pointer setter: Uncompilable to prevent inadvertent misuse.

include/v8-message.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ class V8_EXPORT Message {
111111
/**
112112
* Return the isolate to which the Message belongs.
113113
*/
114+
V8_DEPRECATE_SOON(
115+
"Use Isolate::GetCurrent() instead, which is guaranteed to return the "
116+
"same isolate since https://crrev.com/c/6458560.")
114117
Isolate* GetIsolate() const;
115118

116119
V8_WARN_UNUSED_RESULT MaybeLocal<String> GetSource(

include/v8-object.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,8 +795,14 @@ class V8_EXPORT Object : public Value {
795795
/**
796796
* Return the isolate to which the Object belongs to.
797797
*/
798+
V8_DEPRECATE_SOON(
799+
"Use Isolate::GetCurrent() instead, which is guaranteed to return the "
800+
"same isolate since https://crrev.com/c/6458560.")
798801
Isolate* GetIsolate();
799802

803+
V8_DEPRECATE_SOON(
804+
"Use Isolate::GetCurrent() instead, which is guaranteed to return the "
805+
"same isolate since https://crrev.com/c/6458560.")
800806
V8_INLINE static Isolate* GetIsolate(const TracedReference<Object>& handle) {
801807
return handle.template value<Object>()->GetIsolate();
802808
}

0 commit comments

Comments
 (0)