diff options
author | Michaël Zasso <targos@protonmail.com> | 2016-09-06 22:49:51 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2016-09-22 09:51:19 +0200 |
commit | ec02b811a8a5c999bab4de312be2d732b7d9d50b (patch) | |
tree | ca3068017254f238cf413a451c57a803572983a4 /deps/v8/src/global-handles.h | |
parent | d2eb7ce0105369a9cad82787cb33a665e9bd00ad (diff) | |
download | android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.tar.gz android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.tar.bz2 android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.zip |
deps: update V8 to 5.4.500.27
Pick up latest commit from the 5.4-lkgr branch.
deps: edit V8 gitignore to allow trace event copy
deps: update V8 trace event to 315bf1e2d45be7d53346c31cfcc37424a32c30c8
deps: edit V8 gitignore to allow gtest_prod.h copy
deps: update V8 gtest to 6f8a66431cb592dad629028a50b3dd418a408c87
PR-URL: https://github.com/nodejs/node/pull/8317
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'deps/v8/src/global-handles.h')
-rw-r--r-- | deps/v8/src/global-handles.h | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/deps/v8/src/global-handles.h b/deps/v8/src/global-handles.h index ac8487b19f..24a2273e36 100644 --- a/deps/v8/src/global-handles.h +++ b/deps/v8/src/global-handles.h @@ -96,19 +96,21 @@ struct ObjectGroupRetainerInfo { RetainedObjectInfo* info; }; - enum WeaknessType { - NORMAL_WEAK, // Embedder gets a handle to the dying object. + // Embedder gets a handle to the dying object. + FINALIZER_WEAK, // In the following cases, the embedder gets the parameter they passed in // earlier, and 0 or 2 first internal fields. Note that the internal // fields must contain aligned non-V8 pointers. Getting pointers to V8 // objects through this interface would be GC unsafe so in that case the // embedder gets a null pointer instead. PHANTOM_WEAK, - PHANTOM_WEAK_2_INTERNAL_FIELDS + PHANTOM_WEAK_2_INTERNAL_FIELDS, + // The handle is automatically reset by the garbage collector when + // the object is no longer reachable. + PHANTOM_WEAK_RESET_HANDLE }; - class GlobalHandles { public: ~GlobalHandles(); @@ -122,14 +124,6 @@ class GlobalHandles { // Destroy a global handle. static void Destroy(Object** location); - typedef WeakCallbackData<v8::Value, void>::Callback WeakCallback; - - // For a phantom weak reference, the callback does not have access to the - // dying object. Phantom weak references are preferred because they allow - // memory to be reclaimed in one GC cycle rather than two. However, for - // historical reasons the default is non-phantom. - enum PhantomState { Nonphantom, Phantom }; - // Make the global handle weak and set the callback parameter for the // handle. When the garbage collector recognizes that only weak global // handles point to an object the callback function is invoked (for each @@ -140,14 +134,11 @@ class GlobalHandles { // 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); - - // It would be nice to template this one, but it's really hard to get - // the template instantiator to work right if you do. - static void MakeWeak(Object** location, void* parameter, WeakCallbackInfo<void>::Callback weak_callback, v8::WeakCallbackType type); + static void MakeWeak(Object*** location_addr); + void RecordStats(HeapStats* stats); // Returns the current number of weak handles. @@ -162,6 +153,14 @@ class GlobalHandles { return number_of_global_handles_; } + size_t NumberOfPhantomHandleResets() { + return number_of_phantom_handle_resets_; + } + + void ResetNumberOfPhantomHandleResets() { + number_of_phantom_handle_resets_ = 0; + } + // Clear the weakness of a global handle. static void* ClearWeakness(Object** location); @@ -344,6 +343,8 @@ class GlobalHandles { int post_gc_processing_count_; + size_t number_of_phantom_handle_resets_; + // Object groups and implicit references, public and more efficient // representation. List<ObjectGroup*> object_groups_; |