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

Side by Side Diff: src/heap/heap.cc

Issue 1280703002: Use conservative estimate for GC speed instead of bailing out when computing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 4667 matching lines...) Expand 10 before | Expand all | Expand 10 after
4678 } 4678 }
4679 if (mark_compact_collector()->sweeping_in_progress()) { 4679 if (mark_compact_collector()->sweeping_in_progress()) {
4680 mark_compact_collector()->EnsureSweepingCompleted(); 4680 mark_compact_collector()->EnsureSweepingCompleted();
4681 } 4681 }
4682 DCHECK(IsHeapIterable()); 4682 DCHECK(IsHeapIterable());
4683 } 4683 }
4684 4684
4685 4685
4686 static double ComputeMutatorUtilization(double mutator_speed, double gc_speed) { 4686 static double ComputeMutatorUtilization(double mutator_speed, double gc_speed) {
4687 const double kMinMutatorUtilization = 0.0; 4687 const double kMinMutatorUtilization = 0.0;
4688 if (mutator_speed == 0 || gc_speed == 0) return kMinMutatorUtilization; 4688 const double kConservativeGcSpeedInBytesPerMillisecond = 200000;
4689 if (mutator_speed == 0) return kMinMutatorUtilization;
4690 if (gc_speed == 0) gc_speed = kConservativeGcSpeedInBytesPerMillisecond;
4689 // Derivation: 4691 // Derivation:
4690 // mutator_utilization = mutator_time / (mutator_time + gc_time) 4692 // mutator_utilization = mutator_time / (mutator_time + gc_time)
4691 // mutator_time = 1 / mutator_speed 4693 // mutator_time = 1 / mutator_speed
4692 // gc_time = 1 / gc_speed 4694 // gc_time = 1 / gc_speed
4693 // mutator_utilization = (1 / mutator_speed) / 4695 // mutator_utilization = (1 / mutator_speed) /
4694 // (1 / mutator_speed + 1 / gc_speed) 4696 // (1 / mutator_speed + 1 / gc_speed)
4695 // mutator_utilization = gc_speed / (mutator_speed + gc_speed) 4697 // mutator_utilization = gc_speed / (mutator_speed + gc_speed)
4696 return gc_speed / (mutator_speed + gc_speed); 4698 return gc_speed / (mutator_speed + gc_speed);
4697 } 4699 }
4698 4700
(...skipping 2202 matching lines...) Expand 10 before | Expand all | Expand 10 after
6901 *object_type = "CODE_TYPE"; \ 6903 *object_type = "CODE_TYPE"; \
6902 *object_sub_type = "CODE_AGE/" #name; \ 6904 *object_sub_type = "CODE_AGE/" #name; \
6903 return true; 6905 return true;
6904 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) 6906 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME)
6905 #undef COMPARE_AND_RETURN_NAME 6907 #undef COMPARE_AND_RETURN_NAME
6906 } 6908 }
6907 return false; 6909 return false;
6908 } 6910 }
6909 } // namespace internal 6911 } // namespace internal
6910 } // namespace v8 6912 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698