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); |
} |