Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index c01856d660ae13e39d16adfb14ad7eadf8b9e245..411c2f1169dd0051159e338e4634860a536afd72 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -388,6 +388,15 @@ template <class T> class Persistent : public Handle<T> { |
inline void ClearWeak(); |
/** |
+ * Marks the reference to this object independent. Garbage collector |
+ * is free to ignore any object groups containing this object. |
+ * Weak callback for an independent handle should not |
+ * assume that it will be preceded by a global GC prologue callback |
+ * or followed by a global GC epilogue callback. |
+ */ |
+ inline void MarkIndependent(); |
+ |
+ /** |
*Checks if the handle holds the only reference to an object. |
*/ |
inline bool IsNearDeath() const; |
@@ -3106,6 +3115,7 @@ class V8EXPORT V8 { |
void* data, |
WeakReferenceCallback); |
static void ClearWeak(internal::Object** global_handle); |
+ static void MarkIndependent(internal::Object** global_handle); |
static bool IsGlobalNearDeath(internal::Object** global_handle); |
static bool IsGlobalWeak(internal::Object** global_handle); |
static void SetWrapperClassId(internal::Object** global_handle, |
@@ -3809,6 +3819,11 @@ void Persistent<T>::ClearWeak() { |
} |
template <class T> |
+void Persistent<T>::MarkIndependent() { |
+ V8::MarkIndependent(reinterpret_cast<internal::Object**>(**this)); |
+} |
+ |
+template <class T> |
void Persistent<T>::SetWrapperClassId(uint16_t class_id) { |
V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**this), class_id); |
} |