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

Unified Diff: src/heap/heap.cc

Issue 1302273002: [heap] Thread through GC flags in memory reducer and incremental marking. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix scavenger call in test Created 5 years, 4 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 | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index ef7030e7aaddb23b7e44519fb191fa3db35628d7..234bc9f563a14d148cc19967d902fb7cc1c4ff8e 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -740,7 +740,7 @@ void Heap::PreprocessStackTraces() {
void Heap::HandleGCRequest() {
if (incremental_marking()->request_type() ==
IncrementalMarking::COMPLETE_MARKING) {
- CollectAllGarbage(Heap::kNoGCFlags, "GC interrupt",
+ CollectAllGarbage(current_gc_flags(), "GC interrupt",
incremental_marking()->CallbackFlags());
return;
}
@@ -4748,10 +4748,14 @@ void Heap::ReduceNewSpaceSize() {
// TODO(ulan): Unify this constant with the similar constant in
// GCIdleTimeHandler once the change is merged to 4.5.
static const size_t kLowAllocationThroughput = 1000;
- size_t allocation_throughput =
+ const size_t allocation_throughput =
tracer()->CurrentAllocationThroughputInBytesPerMillisecond();
- if (FLAG_predictable || allocation_throughput == 0) return;
- if (allocation_throughput < kLowAllocationThroughput) {
+
+ if (FLAG_predictable) return;
+
+ if (ShouldReduceMemory() ||
+ ((allocation_throughput != 0) &&
+ (allocation_throughput < kLowAllocationThroughput))) {
new_space_.Shrink();
UncommitFromSpace();
}
@@ -4766,7 +4770,7 @@ void Heap::FinalizeIncrementalMarkingIfComplete(const char* comment) {
OverApproximateWeakClosure(comment);
} else if (incremental_marking()->IsComplete() ||
(mark_compact_collector_.marking_deque()->IsEmpty())) {
- CollectAllGarbage(kNoGCFlags, comment);
+ CollectAllGarbage(current_gc_flags(), comment);
}
}
@@ -4788,7 +4792,8 @@ bool Heap::TryFinalizeIdleIncrementalMarking(
gc_idle_time_handler_.ShouldDoFinalIncrementalMarkCompact(
static_cast<size_t>(idle_time_in_ms), size_of_objects,
final_incremental_mark_compact_speed_in_bytes_per_ms))) {
- CollectAllGarbage(kNoGCFlags, "idle notification: finalize incremental");
+ CollectAllGarbage(current_gc_flags(),
+ "idle notification: finalize incremental");
return true;
}
return false;
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698