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

Unified Diff: include/v8.h

Issue 1410593005: Adds a scavenge GC pass to collect unmodified references (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Forgot a fix in the last patch Created 5 years, 2 months 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
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 29f2508fd638c4d2187e748a1265a31b03303045..e9dd2c5cd3046cf0c953894d084c32af9683e3e0 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,13 @@ 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);
+
private:
template <class K, class V, class Traits>
friend class PersistentValueMapBase;
@@ -7009,6 +7023,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 +7351,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;
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698