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

Unified Diff: src/mark-compact.cc

Issue 5745005: Provide baseline GC version. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years 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
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index b570db9e348d48726ae6cfd2f2aee3e1c2d53c31..1d89e6ab70265ac48170efd4416010bd4173b38f 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -82,6 +82,7 @@ void MarkCompactCollector::CollectGarbage() {
SweepLargeObjectSpace();
if (IsCompacting()) {
+#ifndef BASELINE_GC
GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_COMPACT);
EncodeForwardingAddresses();
@@ -91,6 +92,9 @@ void MarkCompactCollector::CollectGarbage() {
PcToCodeCache::FlushPcToCodeCache();
RelocateObjects();
+#else
+ UNREACHABLE();
+#endif
} else {
SweepSpaces();
PcToCodeCache::FlushPcToCodeCache();
@@ -107,6 +111,12 @@ void MarkCompactCollector::CollectGarbage() {
void MarkCompactCollector::Prepare(GCTracer* tracer) {
+#ifdef BASELINE_GC
+ FLAG_flush_code = false;
+ FLAG_always_compact = false;
+ FLAG_never_compact = true;
+#endif
+
// Rather than passing the tracer around we stash it in a static member
// variable.
tracer_ = tracer;
@@ -1472,7 +1482,7 @@ void MarkCompactCollector::ClearNonLiveTransitions() {
// words) to indicate free regions in the page found during computation of
// forwarding addresses and skipped over in subsequent sweeps.
-
+#ifndef BASELINE_GC
// Encode a free region, defined by the given start address and size, in the
// first word or two of the region.
void EncodeFreeRegion(Address free_start, int free_size) {
@@ -1689,7 +1699,7 @@ void MarkCompactCollector::EncodeForwardingAddressesInPagedSpace(
&offset);
}
}
-
+#endif
// We scavange new space simultaneously with sweeping. This is done in two
// passes.
@@ -2062,7 +2072,7 @@ static void SweepSpace(PagedSpace* space) {
}
}
-
+#ifndef BASELINE_GC
void MarkCompactCollector::EncodeForwardingAddresses() {
ASSERT(state_ == ENCODE_FORWARDING_ADDRESSES);
// Objects in the active semispace of the young generation may be
@@ -2317,7 +2327,7 @@ class MapCompact {
};
MapCompact::MapUpdatingVisitor MapCompact::map_updating_visitor_;
-
+#endif
void MarkCompactCollector::SweepSpaces() {
GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_SWEEP);
@@ -2347,6 +2357,7 @@ void MarkCompactCollector::SweepSpaces() {
int live_maps = static_cast<int>(live_maps_size / Map::kSize);
ASSERT(live_map_objects_size_ == live_maps_size);
+#ifndef BASELINE_GC
if (Heap::map_space()->NeedsCompaction(live_maps)) {
MapCompact map_compact(live_maps);
@@ -2364,6 +2375,9 @@ void MarkCompactCollector::SweepSpaces() {
map_compact.Finish();
}
+#else
+ USE(live_maps);
+#endif
}
@@ -2416,6 +2430,7 @@ int MarkCompactCollector::IterateLiveObjects(PagedSpace* space,
}
+#ifndef BASELINE_GC
// -------------------------------------------------------------------------
// Phase 3: Update pointers
@@ -2898,6 +2913,7 @@ int MarkCompactCollector::RelocateNewObject(HeapObject* obj) {
return obj_size;
}
+#endif
void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj) {
« src/ia32/codegen-ia32.cc ('K') | « src/mark-compact.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698