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

Unified Diff: src/spaces.h

Issue 69953023: Add ability to disable inline bump-pointer allocation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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/heap-profiler.cc ('k') | src/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « src/heap-profiler.cc ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698