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

Unified Diff: src/heap/heap.cc

Issue 1404523002: [heap] inline allocation steps refactor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add tests and comments Created 5 years, 2 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
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 75b7ec1fa698f824e2e82c57da0cb9947132b08f..38868156cd2d363bd1ee6df0ce99646b34aec701 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -781,6 +781,13 @@ void Heap::HandleGCRequest() {
}
+void Heap::ScheduleIdleScavengeIfNeededCallback(int bytes_allocated,
+ void* arg) {
+ Heap* heap = static_cast<Heap*>(arg);
+ heap->ScheduleIdleScavengeIfNeeded(bytes_allocated);
+}
+
+
void Heap::ScheduleIdleScavengeIfNeeded(int bytes_allocated) {
scavenge_job_->ScheduleIdleTaskIfNeeded(this, bytes_allocated);
}
@@ -4971,17 +4978,6 @@ void Heap::DisableInlineAllocation() {
}
-void Heap::LowerInlineAllocationLimit(intptr_t step) {
- new_space()->LowerInlineAllocationLimit(step);
-}
-
-
-void Heap::ResetInlineAllocationLimit() {
- new_space()->LowerInlineAllocationLimit(
- ScavengeJob::kBytesAllocatedBeforeNextIdleTask);
-}
-
-
V8_DECLARE_ONCE(initialize_gc_once);
static void InitializeGCOnce() {
@@ -5090,7 +5086,9 @@ bool Heap::SetUp() {
mark_compact_collector()->SetUp();
- ResetInlineAllocationLimit();
+ new_space()->AddInlineAllocationObserver(
+ ScavengeJob::kBytesAllocatedBeforeNextIdleTask,
+ ScheduleIdleScavengeIfNeededCallback, this);
return true;
}
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/incremental-marking.h » ('j') | src/heap/spaces.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698