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

Unified Diff: src/mark-compact.cc

Issue 27133: - Pass the knowledge whether the old GC is compacting to the GC prologue and ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 10 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
Index: src/mark-compact.cc
===================================================================
--- src/mark-compact.cc (revision 1355)
+++ src/mark-compact.cc (working copy)
@@ -58,11 +58,11 @@
int MarkCompactCollector::live_lo_objects_ = 0;
#endif
-void MarkCompactCollector::CollectGarbage(GCTracer* tracer) {
- // Rather than passing the tracer around we stash it in a static member
- // variable.
- tracer_ = tracer;
- Prepare();
+void MarkCompactCollector::CollectGarbage() {
+ // Make sure that Prepare() has been called. The individual steps below will
+ // update the state as they proceed.
+ ASSERT(state_ == PREPARE_GC);
+
// Prepare has selected whether to compact the old generation or not.
// Tell the tracer.
if (IsCompacting()) tracer_->set_is_compacting();
@@ -96,7 +96,11 @@
}
-void MarkCompactCollector::Prepare() {
+void MarkCompactCollector::Prepare(GCTracer* tracer) {
+ // Rather than passing the tracer around we stash it in a static member
+ // variable.
+ tracer_ = tracer;
+
static const int kFragmentationLimit = 50; // Percent.
#ifdef DEBUG
ASSERT(state_ == IDLE);
@@ -241,7 +245,6 @@
// Helper class for marking pointers in HeapObjects.
class MarkingVisitor : public ObjectVisitor {
public:
-
void VisitPointer(Object** p) {
MarkObjectByPointer(p);
}

Powered by Google App Engine
This is Rietveld 408576698