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

Unified Diff: src/spaces-inl.h

Issue 6756006: Exponentially increase incremental marking factor each 512 steps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 9 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/spaces.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces-inl.h
diff --git a/src/spaces-inl.h b/src/spaces-inl.h
index 6bc1b4f71a68028a8c4766de096846e41c1601de..91382c1397829023b5d15879c30d39677df61535 100644
--- a/src/spaces-inl.h
+++ b/src/spaces-inl.h
@@ -203,22 +203,26 @@ MaybeObject* PagedSpace::AllocateRaw(int size_in_bytes) {
// -----------------------------------------------------------------------------
// NewSpace
-MaybeObject* NewSpace::AllocateRawInternal(int size_in_bytes,
- AllocationInfo* alloc_info) {
- Address new_top = alloc_info->top + size_in_bytes;
- if (new_top > alloc_info->limit) return Failure::RetryAfterGC();
+MaybeObject* NewSpace::AllocateRawInternal(int size_in_bytes) {
+ Address new_top = allocation_info_.top + size_in_bytes;
+ if (new_top > allocation_info_.limit) {
+ Address high = to_space_.high();
+ if (allocation_info_.limit < high) {
+ allocation_info_.limit = Min(
+ allocation_info_.limit + inline_alloction_limit_step_,
+ high);
+ return AllocateRawInternal(size_in_bytes);
+ }
+ return Failure::RetryAfterGC();
+ }
- Object* obj = HeapObject::FromAddress(alloc_info->top);
- alloc_info->top = new_top;
-#ifdef DEBUG
- SemiSpace* space =
- (alloc_info == &allocation_info_) ? &to_space_ : &from_space_;
- ASSERT(space->low() <= alloc_info->top
- && alloc_info->top <= space->high()
- && alloc_info->limit == space->high());
-#endif
+ Object* obj = HeapObject::FromAddress(allocation_info_.top);
+ allocation_info_.top = new_top;
+ ASSERT_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_);
- IncrementalMarking::Step(size_in_bytes);
+ int bytes_allocated = new_top - top_on_previous_step_;
+ IncrementalMarking::Step(bytes_allocated);
+ top_on_previous_step_ = new_top;
return obj;
}
« no previous file with comments | « src/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698