Chromium Code Reviews| Index: include/v8.h |
| diff --git a/include/v8.h b/include/v8.h |
| index 29f2508fd638c4d2187e748a1265a31b03303045..ba29d85dc1c037031df0df476b39550af0e96b40 100644 |
| --- a/include/v8.h |
| +++ b/include/v8.h |
| @@ -603,6 +603,13 @@ template <class T> class PersistentBase { |
| */ |
| V8_INLINE void MarkPartiallyDependent(); |
| + /** |
| + * Marks the reference to this object as active. The scavenge garbage |
| + * collection should not reclaim the objects marked as active. |
| + * This bit is cleared after the each garbage collection pass. |
| + */ |
| + V8_INLINE void MarkActive(); |
| + |
| V8_INLINE bool IsIndependent() const; |
| /** Checks if the handle holds the only reference to an object. */ |
| @@ -5927,6 +5934,14 @@ class V8_EXPORT Isolate { |
| */ |
| void VisitHandlesForPartialDependence(PersistentHandleVisitor* visitor); |
| + /** |
| + * Iterates through all the persistent handles in the current isolate's heap |
| + * that have class_ids and are weak to be marked as inactive if there is no |
| + * pending activity for the handle. |
| + */ |
| + void VisitWeakHandles(PersistentHandleVisitor* visitor); |
| + |
| + |
|
rmcilroy
2015/10/21 13:36:50
nit - remove extra newline
mythria
2015/10/21 14:43:51
Done.
|
| private: |
| template <class K, class V, class Traits> |
| friend class PersistentValueMapBase; |
| @@ -7009,6 +7024,7 @@ class Internals { |
| static const int kNodeStateIsNearDeathValue = 4; |
| static const int kNodeIsIndependentShift = 3; |
| static const int kNodeIsPartiallyDependentShift = 4; |
| + static const int kNodeIsActiveShift = 4; |
| static const int kJSObjectType = 0xb7; |
| static const int kFirstNonstringType = 0x80; |
| @@ -7336,6 +7352,15 @@ void PersistentBase<T>::MarkPartiallyDependent() { |
| template <class T> |
| +void PersistentBase<T>::MarkActive() { |
| + typedef internal::Internals I; |
| + if (this->IsEmpty()) return; |
| + I::UpdateNodeFlag(reinterpret_cast<internal::Object**>(this->val_), true, |
| + I::kNodeIsActiveShift); |
| +} |
| + |
| + |
| +template <class T> |
| void PersistentBase<T>::SetWrapperClassId(uint16_t class_id) { |
| typedef internal::Internals I; |
| if (this->IsEmpty()) return; |