Index: src/spaces.h |
diff --git a/src/spaces.h b/src/spaces.h |
index 83793e300e4270c4c9cbdb74d7c2248961fa8241..ee11b6b496efd27f74f5693cb124322401d4fbc6 100644 |
--- a/src/spaces.h |
+++ b/src/spaces.h |
@@ -1783,7 +1783,7 @@ class PagedSpace : public Space { |
} |
// Set space allocation info. |
- void SetTop(Address top, Address limit) { |
+ void SetTopAndLimit(Address top, Address limit) { |
ASSERT(top == limit || |
Page::FromAddress(top) == Page::FromAddress(limit - 1)); |
MemoryChunk::UpdateHighWaterMark(allocation_info_.top()); |
@@ -1791,6 +1791,15 @@ class PagedSpace : public Space { |
allocation_info_.set_limit(limit); |
} |
+ // Empty space allocation info, returning unused area to free list. |
+ void EmptyAllocationInfo() { |
+ // Mark the old linear allocation area with a free space map so it can be |
+ // skipped when scanning the heap. |
+ int old_linear_size = static_cast<int>(limit() - top()); |
+ Free(top(), old_linear_size); |
+ SetTopAndLimit(NULL, NULL); |
+ } |
+ |
void Allocate(int bytes) { |
accounting_stats_.AllocateBytes(bytes); |
} |
@@ -2478,16 +2487,10 @@ class NewSpace : public Space { |
// Reset the allocation pointer to the beginning of the active semispace. |
void ResetAllocationInfo(); |
+ void UpdateInlineAllocationLimit(int size_in_bytes); |
void LowerInlineAllocationLimit(intptr_t step) { |
inline_allocation_limit_step_ = step; |
- if (step == 0) { |
- allocation_info_.set_limit(to_space_.page_high()); |
- } else { |
- Address new_limit = Min( |
- allocation_info_.top() + inline_allocation_limit_step_, |
- allocation_info_.limit()); |
- allocation_info_.set_limit(new_limit); |
- } |
+ UpdateInlineAllocationLimit(0); |
top_on_previous_step_ = allocation_info_.top(); |
} |