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

Unified Diff: src/heap/spaces.cc

Issue 1427973006: [heap] make inline allocation step size dynamic (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/spaces.h ('k') | test/cctest/test-spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index a5e2760bb09d0004cfc8dec007121f946fda583c..3cfd4c4e75815033e5be277626a3f1f01c43ea1c 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -1516,7 +1516,15 @@ void NewSpace::UpdateInlineAllocationLimit(int size_in_bytes) {
// Lower limit during incremental marking.
Address high = to_space_.page_high();
Address new_top = allocation_info_.top() + size_in_bytes;
- Address new_limit = new_top + inline_allocation_limit_step_;
+
+ intptr_t next_step = 0;
+ for (int i = 0; i < inline_allocation_observers_.length(); ++i) {
Hannes Payer (out of office) 2015/11/09 19:26:39 Can we move that code into a helper function?
ofrobots 2015/11/09 23:00:32 Done.
+ InlineAllocationObserver* o = inline_allocation_observers_[i];
+ next_step = next_step ? Min(next_step, o->bytes_to_next_step())
+ : o->bytes_to_next_step();
+ }
+ DCHECK(next_step != 0);
+ Address new_limit = new_top + next_step;
allocation_info_.set_limit(Min(new_limit, high));
}
DCHECK_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_);
@@ -1602,13 +1610,8 @@ bool NewSpace::EnsureAllocation(int size_in_bytes,
void NewSpace::UpdateInlineAllocationLimitStep() {
- intptr_t step = 0;
- for (int i = 0; i < inline_allocation_observers_.length(); ++i) {
- InlineAllocationObserver* observer = inline_allocation_observers_[i];
- step = step ? Min(step, observer->step_size()) : observer->step_size();
- }
- inline_allocation_limit_step_ = step;
- top_on_previous_step_ = step ? allocation_info_.top() : 0;
+ top_on_previous_step_ =
Hannes Payer (out of office) 2015/11/09 19:26:39 This method is now just updating top_on_previous_s
ofrobots 2015/11/09 23:00:32 Done.
+ inline_allocation_observers_.length() ? allocation_info_.top() : 0;
UpdateInlineAllocationLimit(0);
}
« no previous file with comments | « src/heap/spaces.h ('k') | test/cctest/test-spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698