Chromium Code Reviews

Unified Diff: src/spaces-inl.h

Issue 6542047: Basic implementation of incremental marking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/spaces-inl.h
diff --git a/src/spaces-inl.h b/src/spaces-inl.h
index 08a6171ceef1de63f29571433c3738ceb3d876e2..41a40683387e0a0f9a68bc4dee81b96a93599ac9 100644
--- a/src/spaces-inl.h
+++ b/src/spaces-inl.h
@@ -202,11 +202,18 @@ HeapObject* PagedSpace::AllocateLinearly(AllocationInfo* alloc_info,
MaybeObject* PagedSpace::AllocateRaw(int size_in_bytes) {
ASSERT(HasBeenSetup());
ASSERT_OBJECT_SIZE(size_in_bytes);
+
HeapObject* object = AllocateLinearly(&allocation_info_, size_in_bytes);
- if (object != NULL) return object;
+ if (object != NULL) {
+ IncrementalMarking::Step(size_in_bytes);
+ return object;
+ }
object = SlowAllocateRaw(size_in_bytes);
- if (object != NULL) return object;
+ if (object != NULL) {
+ IncrementalMarking::Step(size_in_bytes);
+ return object;
+ }
return Failure::RetryAfterGC(identity());
}
@@ -229,6 +236,9 @@ MaybeObject* NewSpace::AllocateRawInternal(int size_in_bytes,
&& alloc_info->top <= space->high()
&& alloc_info->limit == space->high());
#endif
+
+ IncrementalMarking::Step(size_in_bytes);
+
return obj;
}

Powered by Google App Engine