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

Unified Diff: src/spaces-inl.h

Issue 7149016: Multi-page growing and shrinking new-space (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Address review comments Created 9 years, 6 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 a1f41d071daf3d17a79c20117dc0bb4ba3c0f9d1..c01b7f262a0bb9156cad0c40f6b3796d68b6b326 100644
--- a/src/spaces-inl.h
+++ b/src/spaces-inl.h
@@ -63,18 +63,21 @@ Page* PageIterator::next() {
// NewSpacePageIterator
+NewSpacePageIterator::NewSpacePageIterator(NewSpace* space)
+ : prev_page_(NewSpacePage::FromAddress(space->ToSpaceLow())->prev_page()),
+ next_page_(NewSpacePage::FromAddress(space->ToSpaceLow())),
+ last_page_(NewSpacePage::FromLimit(space->ToSpaceHigh())) { }
+
NewSpacePageIterator::NewSpacePageIterator(SemiSpace* space)
- : prev_page_(&space->anchor_),
+ : prev_page_(space->anchor()),
next_page_(prev_page_->next_page()),
last_page_(prev_page_->prev_page()) { }
- NewSpacePageIterator::NewSpacePageIterator(Address start, Address limit)
+NewSpacePageIterator::NewSpacePageIterator(Address start, Address limit)
: prev_page_(NewSpacePage::FromAddress(start)->prev_page()),
next_page_(NewSpacePage::FromAddress(start)),
last_page_(NewSpacePage::FromLimit(limit)) {
-#ifdef DEBUG
- SemiSpace::ValidateRange(start, limit);
-#endif
+ SemiSpace::AssertValidRange(start, limit);
}
@@ -286,8 +289,10 @@ MaybeObject* NewSpace::AllocateRawInternal(int size_in_bytes) {
if (new_top > allocation_info_.limit) {
Address high = to_space_.page_high();
if (allocation_info_.limit < high) {
+ // Incremental marking has lowered the limit to get a
+ // chance to do a step.
allocation_info_.limit = Min(
- allocation_info_.limit + inline_alloction_limit_step_,
+ allocation_info_.limit + inline_allocation_limit_step_,
high);
int bytes_allocated = new_top - top_on_previous_step_;
heap()->incremental_marking()->Step(bytes_allocated);
« 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