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

Unified Diff: src/mark-compact.h

Issue 100344: More special handling of the symbol table during garbage collection.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 8 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/mark-compact.cc » ('j') | src/mark-compact.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.h
===================================================================
--- src/mark-compact.h (revision 1845)
+++ src/mark-compact.h (working copy)
@@ -142,6 +142,7 @@
friend class RootMarkingVisitor;
friend class MarkingVisitor;
+ friend class UnmarkingVisitor;
// Marking operations for objects reachable from roots.
static void MarkLiveObjects();
@@ -155,11 +156,23 @@
static inline void SetMark(HeapObject* obj) {
tracer_->increment_marked_count();
#ifdef DEBUG
- UpdateLiveObjectCount(obj);
+ UpdateLiveObjectCount(obj, 1);
#endif
obj->SetMark();
}
+ // Used to clear mark bits during marking for objects that are not
+ // actually live. Since it updates bookkeeping state, it is not
+ // used when clearing mark bits on live objects (eg, during
+ // sweeping).
+ static inline void ClearMark(HeapObject* obj) {
+ obj->ClearMark();
+ tracer_->decrement_marked_count();
+#ifdef DEBUG
+ UpdateLiveObjectCount(obj, -1);
+#endif
+ }
+
// Creates back pointers for all map transitions, stores them in
// the prototype field. The original prototype pointers are restored
// in ClearNonLiveTransitions(). All JSObject maps
@@ -202,7 +215,10 @@
static bool MustBeMarked(Object** p);
#ifdef DEBUG
- static void UpdateLiveObjectCount(HeapObject* obj);
+ // The scale argument is positive 1 if we are marking an object and
+ // -1 if we are clearing the mark bit of an object that we didn't
+ // actually want marked.
+ static void UpdateLiveObjectCount(HeapObject* obj, int scale);
#endif
// We sweep the large object space in the same way whether we are
« no previous file with comments | « no previous file | src/mark-compact.cc » ('j') | src/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698