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

Unified Diff: src/heap/heap.cc

Issue 1841043002: Represent speed in GCTracer functions as double instead of int. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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/gc-tracer.cc ('k') | src/heap/incremental-marking.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 aca86484bd01b8a1dc372ac0fac8a175dd2b266c..d827154192d6504066c9d532b1710ca4bf718113 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -1354,9 +1354,8 @@ bool Heap::PerformGarbageCollection(
Relocatable::PostGarbageCollectionProcessing(isolate_);
double gc_speed = tracer()->CombinedMarkCompactSpeedInBytesPerMillisecond();
- double mutator_speed = static_cast<double>(
- tracer()
- ->CurrentOldGenerationAllocationThroughputInBytesPerMillisecond());
+ double mutator_speed =
+ tracer()->CurrentOldGenerationAllocationThroughputInBytesPerMillisecond();
intptr_t old_gen_size = PromotedSpaceSizeOfObjects();
if (collector == MARK_COMPACTOR) {
// Register the amount of external allocated memory.
@@ -4135,8 +4134,8 @@ static double ComputeMutatorUtilization(double mutator_speed, double gc_speed) {
double Heap::YoungGenerationMutatorUtilization() {
double mutator_speed = static_cast<double>(
tracer()->NewSpaceAllocationThroughputInBytesPerMillisecond());
- double gc_speed = static_cast<double>(
- tracer()->ScavengeSpeedInBytesPerMillisecond(kForSurvivedObjects));
+ double gc_speed =
+ tracer()->ScavengeSpeedInBytesPerMillisecond(kForSurvivedObjects);
double result = ComputeMutatorUtilization(mutator_speed, gc_speed);
if (FLAG_trace_mutator_utilization) {
PrintIsolate(isolate(),
@@ -4215,7 +4214,7 @@ 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;
- const size_t allocation_throughput =
+ const double allocation_throughput =
tracer()->CurrentAllocationThroughputInBytesPerMillisecond();
if (FLAG_predictable) return;
@@ -4244,21 +4243,20 @@ void Heap::FinalizeIncrementalMarkingIfComplete(const char* comment) {
bool Heap::TryFinalizeIdleIncrementalMarking(double idle_time_in_ms) {
size_t size_of_objects = static_cast<size_t>(SizeOfObjects());
- size_t final_incremental_mark_compact_speed_in_bytes_per_ms =
- static_cast<size_t>(
- tracer()->FinalIncrementalMarkCompactSpeedInBytesPerMillisecond());
+ double final_incremental_mark_compact_speed_in_bytes_per_ms =
+ tracer()->FinalIncrementalMarkCompactSpeedInBytesPerMillisecond();
if (incremental_marking()->IsReadyToOverApproximateWeakClosure() ||
(!incremental_marking()->finalize_marking_completed() &&
mark_compact_collector()->marking_deque()->IsEmpty() &&
gc_idle_time_handler_->ShouldDoOverApproximateWeakClosure(
- static_cast<size_t>(idle_time_in_ms)))) {
+ idle_time_in_ms))) {
FinalizeIncrementalMarking(
"Idle notification: finalize incremental marking");
return true;
} else if (incremental_marking()->IsComplete() ||
(mark_compact_collector()->marking_deque()->IsEmpty() &&
gc_idle_time_handler_->ShouldDoFinalIncrementalMarkCompact(
- static_cast<size_t>(idle_time_in_ms), size_of_objects,
+ idle_time_in_ms, size_of_objects,
final_incremental_mark_compact_speed_in_bytes_per_ms))) {
CollectAllGarbage(current_gc_flags_,
"idle notification: finalize incremental marking");
« no previous file with comments | « src/heap/gc-tracer.cc ('k') | src/heap/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698