Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Unified Diff: src/global-handles.h

Issue 753553002: Phantom references support internal fields (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't forget to visit pointers to live objects so they can be updated to new location Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/global-handles.h
diff --git a/src/global-handles.h b/src/global-handles.h
index aacdcbc072d0ae26af7ce6264767d8366ee17f7a..46f2c7025e5764a25e1c7f1c8b7c36c06567fa3b 100644
--- a/src/global-handles.h
+++ b/src/global-handles.h
@@ -111,6 +111,7 @@ class GlobalHandles {
static void Destroy(Object** location);
typedef WeakCallbackData<v8::Value, void>::Callback WeakCallback;
+ typedef PhantomCallbackData<void>::Callback PhantomCallback;
// For a phantom weak reference, the callback does not have access to the
// dying object. Phantom weak references are preferred because they allow
@@ -127,9 +128,14 @@ class GlobalHandles {
// GC. For a phantom weak handle the handle is cleared (set to a Smi)
// before the callback is invoked, but the handle can still be identified
// in the callback by using the location() of the handle.
- static void MakeWeak(Object** location, void* parameter,
- WeakCallback weak_callback,
- PhantomState phantom = Nonphantom);
+ static void MakeWeak(
+ Object** location, void* parameter, WeakCallback weak_callback);
+
+ static void MakePhantom(
+ Object** location, void* parameter,
+ PhantomCallback weak_callback,
+ int internal_field_index1 = v8::Object::kNoInternalFieldIndex,
+ int internal_field_index2 = v8::Object::kNoInternalFieldIndex);
void RecordStats(HeapStats* stats);

Powered by Google App Engine
This is Rietveld 408576698