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

Unified Diff: src/heap/spaces.cc

Issue 1352453004: Perform scavenge in idle tasks. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 3 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 | « src/heap/scavenge-job.cc ('k') | test/cctest/cctest.h » ('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 b973a4ae60552bcaa707e659bc5cdbe8aadedef0..cd8a72951c6b3d162f783628d629fb28e93a43ae 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -1410,7 +1410,7 @@ void NewSpace::UpdateInlineAllocationLimit(int size_in_bytes) {
Address high = to_space_.page_high();
Address new_top = allocation_info_.top() + size_in_bytes;
allocation_info_.set_limit(Min(new_top, high));
- } else if (inline_allocation_limit_step() == 0) {
+ } else if (inline_allocation_limit_step_ == 0) {
// Normal limit is the end of the current page.
allocation_info_.set_limit(to_space_.page_high());
} else {
@@ -1491,8 +1491,9 @@ bool NewSpace::EnsureAllocation(int size_in_bytes,
if (allocation_info_.limit() < high) {
// Either the limit has been lowered because linear allocation was disabled
- // or because incremental marking wants to get a chance to do a step. Set
- // the new limit accordingly.
+ // or because incremental marking wants to get a chance to do a step,
+ // or because idle scavenge job wants to get a chance to post a task.
+ // Set the new limit accordingly.
Address new_top = old_top + aligned_size_in_bytes;
InlineAllocationStep(new_top, new_top);
UpdateInlineAllocationLimit(aligned_size_in_bytes);
@@ -1504,6 +1505,7 @@ bool NewSpace::EnsureAllocation(int size_in_bytes,
void NewSpace::InlineAllocationStep(Address top, Address new_top) {
if (top_on_previous_step_) {
int bytes_allocated = static_cast<int>(top - top_on_previous_step_);
+ heap()->ScheduleIdleScavengeIfNeeded(bytes_allocated);
heap()->incremental_marking()->Step(bytes_allocated,
IncrementalMarking::GC_VIA_STACK_GUARD);
top_on_previous_step_ = new_top;
« no previous file with comments | « src/heap/scavenge-job.cc ('k') | test/cctest/cctest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698