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

Unified Diff: src/spaces.cc

Issue 7281006: Fix bug in semispace shrink-to. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: And a little cleanup. 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index 1d980cc05d2bd9077d531fabbe1b32420e3ed3ad..ae7542da98f83234b8e994da420e993661fb015d 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -1222,18 +1222,18 @@ bool SemiSpace::ShrinkTo(int new_capacity) {
ASSERT((new_capacity & Page::kPageAlignmentMask) == 0);
ASSERT(new_capacity >= initial_capacity_);
ASSERT(new_capacity < capacity_);
- Address end = start_ + maximum_capacity_;
- Address start = end - new_capacity;
+ Address space_end = start_ + maximum_capacity_;
+ Address old_start = space_end - capacity_;
Vyacheslav Egorov (Chromium) 2011/06/29 11:16:59 please add a comment about new space growing backw
Lasse Reichstein 2011/06/29 11:31:13 Done.
size_t delta = capacity_ - new_capacity;
ASSERT(IsAligned(delta, OS::AllocateAlignment()));
- if (!heap()->isolate()->memory_allocator()->UncommitBlock(start, delta)) {
+ if (!heap()->isolate()->memory_allocator()->UncommitBlock(old_start, delta)) {
Vyacheslav Egorov (Chromium) 2011/06/29 11:16:59 I am a bit concerned about uncommiting piece of th
Lasse Reichstein 2011/06/29 11:31:13 And you are correct to be worried. It won't happen
return false;
}
capacity_ = new_capacity;
int pages_after = capacity_ / Page::kPageSize;
NewSpacePage* new_last_page =
- NewSpacePage::FromAddress(end - pages_after * Page::kPageSize);
+ NewSpacePage::FromAddress(space_end - pages_after * Page::kPageSize);
new_last_page->set_next_page(anchor());
anchor()->set_prev_page(new_last_page);
ASSERT(current_page_ == first_page());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698