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

Unified Diff: src/mark-compact.cc

Issue 8043021: Fix bug in PointersUpdatingVisitor::UpdatePointer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 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 | « src/flag-definitions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 54a293685f2875b2a8935b6586b0cfe0788acc18..422d44b307af2d7e4bc444f1e148ec339234808f 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -244,7 +244,10 @@ bool MarkCompactCollector::StartCompaction() {
CollectEvacuationCandidates(heap()->old_pointer_space());
CollectEvacuationCandidates(heap()->old_data_space());
- CollectEvacuationCandidates(heap()->code_space());
+
+ if (FLAG_compact_code_space) {
+ CollectEvacuationCandidates(heap()->code_space());
+ }
heap()->old_pointer_space()->EvictEvacuationCandidatesFromFreeLists();
heap()->old_data_space()->EvictEvacuationCandidatesFromFreeLists();
@@ -480,7 +483,7 @@ void MarkCompactCollector::Prepare(GCTracer* tracer) {
ASSERT(state_ == IDLE);
state_ = PREPARE_GC;
#endif
- ASSERT(!FLAG_always_compact || !FLAG_never_compact);
+ if (FLAG_never_compact) FLAG_always_compact = false;
if (collect_maps_) CreateBackPointers();
#ifdef ENABLE_GDB_JIT_INTERFACE
@@ -2451,11 +2454,13 @@ class PointersUpdatingVisitor: public ObjectVisitor {
HeapObject* obj = HeapObject::cast(*p);
- if (heap_->InNewSpace(obj) ||
- MarkCompactCollector::IsOnEvacuationCandidate(obj)) {
- ASSERT(obj->map_word().IsForwardingAddress());
+ MapWord map_word = obj->map_word();
+ if (map_word.IsForwardingAddress()) {
+ ASSERT(heap_->InFromSpace(obj) ||
+ MarkCompactCollector::IsOnEvacuationCandidate(obj));
*p = obj->map_word().ToForwardingAddress();
- ASSERT(!MarkCompactCollector::IsOnEvacuationCandidate(*p));
+ ASSERT(!heap_->InFromSpace(*p) &&
+ !MarkCompactCollector::IsOnEvacuationCandidate(*p));
}
}
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698