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

Unified Diff: src/spaces.cc

Issue 9086005: When shrinking semispace don't relink pages if semispace is not committed (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 12 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 84b0f1bcb49c8191521ad1497aa2d3e67aac8ea3..b82d06c49f21f8d34f4c3a8ae93858cb85cfc1a8 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -1263,11 +1263,16 @@ bool SemiSpace::ShrinkTo(int new_capacity) {
Address old_start = space_end - capacity_;
size_t delta = capacity_ - new_capacity;
ASSERT(IsAligned(delta, OS::AllocateAlignment()));
- if (!heap()->isolate()->memory_allocator()->UncommitBlock(old_start, delta)) {
+ if (is_committed() &&
+ !heap()->isolate()->memory_allocator()->UncommitBlock(old_start, delta)) {
return false;
}
capacity_ = new_capacity;
+ if (!is_committed()) {
Michael Starzinger 2012/01/04 14:38:28 Can we invert the condition and place the block be
Sven Panne 2012/01/04 14:46:54 Drive-by comment: I *do* like guard clauses, they
+ return true;
+ }
+
int pages_after = capacity_ / Page::kPageSize;
NewSpacePage* new_last_page =
NewSpacePage::FromAddress(space_end - pages_after * Page::kPageSize);
« 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