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

Unified Diff: include/v8.h

Issue 1358703003: Changed scavenge GC to collect unmodified references (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Checks if the object is not active inaddition to unmodified before reclaiming it. The browser test … 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..d624c926eb87246ee89a787d083bb757123fb0db 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 MarkInactive();
+
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);
+
+
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 kNodeIsInactiveShift = 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>::MarkInactive() {
+ typedef internal::Internals I;
+ if (this->IsEmpty()) return;
+ I::UpdateNodeFlag(reinterpret_cast<internal::Object**>(this->val_), true,
+ I::kNodeIsInactiveShift);
+}
+
+
+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