| OLD | NEW |
| 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 4739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4750 // gc_time = 1 / gc_speed | 4750 // gc_time = 1 / gc_speed |
| 4751 // mutator_utilization = (1 / mutator_speed) / | 4751 // mutator_utilization = (1 / mutator_speed) / |
| 4752 // (1 / mutator_speed + 1 / gc_speed) | 4752 // (1 / mutator_speed + 1 / gc_speed) |
| 4753 // mutator_utilization = gc_speed / (mutator_speed + gc_speed) | 4753 // mutator_utilization = gc_speed / (mutator_speed + gc_speed) |
| 4754 return gc_speed / (mutator_speed + gc_speed); | 4754 return gc_speed / (mutator_speed + gc_speed); |
| 4755 } | 4755 } |
| 4756 | 4756 |
| 4757 | 4757 |
| 4758 double Heap::YoungGenerationMutatorUtilization() { | 4758 double Heap::YoungGenerationMutatorUtilization() { |
| 4759 double mutator_speed = static_cast<double>( | 4759 double mutator_speed = static_cast<double>( |
| 4760 tracer()->NewSpaceAllocationThroughputInBytesPerMillisecond()); | 4760 tracer()->CurrentNewSpaceAllocationThroughputInBytesPerMillisecond()); |
| 4761 double gc_speed = static_cast<double>( | 4761 double gc_speed = static_cast<double>( |
| 4762 tracer()->ScavengeSpeedInBytesPerMillisecond(kForSurvivedObjects)); | 4762 tracer()->ScavengeSpeedInBytesPerMillisecond(kForSurvivedObjects)); |
| 4763 double result = ComputeMutatorUtilization(mutator_speed, gc_speed); | 4763 double result = ComputeMutatorUtilization(mutator_speed, gc_speed); |
| 4764 if (FLAG_trace_mutator_utilization) { | 4764 if (FLAG_trace_mutator_utilization) { |
| 4765 PrintIsolate(isolate(), | 4765 PrintIsolate(isolate(), |
| 4766 "Young generation mutator utilization = %.3f (" | 4766 "Young generation mutator utilization = %.3f (" |
| 4767 "mutator_speed=%.f, gc_speed=%.f)\n", | 4767 "mutator_speed=%.f, gc_speed=%.f)\n", |
| 4768 result, mutator_speed, gc_speed); | 4768 result, mutator_speed, gc_speed); |
| 4769 } | 4769 } |
| 4770 return result; | 4770 return result; |
| 4771 } | 4771 } |
| 4772 | 4772 |
| 4773 | 4773 |
| 4774 double Heap::OldGenerationMutatorUtilization() { | 4774 double Heap::OldGenerationMutatorUtilization() { |
| 4775 double mutator_speed = static_cast<double>( | 4775 double mutator_speed = static_cast<double>( |
| 4776 tracer()->OldGenerationAllocationThroughputInBytesPerMillisecond()); | 4776 tracer() |
| 4777 ->CurrentOldGenerationAllocationThroughputInBytesPerMillisecond()); |
| 4777 double gc_speed = static_cast<double>( | 4778 double gc_speed = static_cast<double>( |
| 4778 tracer()->CombinedMarkCompactSpeedInBytesPerMillisecond()); | 4779 tracer()->CombinedMarkCompactSpeedInBytesPerMillisecond()); |
| 4779 double result = ComputeMutatorUtilization(mutator_speed, gc_speed); | 4780 double result = ComputeMutatorUtilization(mutator_speed, gc_speed); |
| 4780 if (FLAG_trace_mutator_utilization) { | 4781 if (FLAG_trace_mutator_utilization) { |
| 4781 PrintIsolate(isolate(), | 4782 PrintIsolate(isolate(), |
| 4782 "Old generation mutator utilization = %.3f (" | 4783 "Old generation mutator utilization = %.3f (" |
| 4783 "mutator_speed=%.f, gc_speed=%.f)\n", | 4784 "mutator_speed=%.f, gc_speed=%.f)\n", |
| 4784 result, mutator_speed, gc_speed); | 4785 result, mutator_speed, gc_speed); |
| 4785 } | 4786 } |
| 4786 return result; | 4787 return result; |
| (...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6927 *object_type = "CODE_TYPE"; \ | 6928 *object_type = "CODE_TYPE"; \ |
| 6928 *object_sub_type = "CODE_AGE/" #name; \ | 6929 *object_sub_type = "CODE_AGE/" #name; \ |
| 6929 return true; | 6930 return true; |
| 6930 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6931 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
| 6931 #undef COMPARE_AND_RETURN_NAME | 6932 #undef COMPARE_AND_RETURN_NAME |
| 6932 } | 6933 } |
| 6933 return false; | 6934 return false; |
| 6934 } | 6935 } |
| 6935 } // namespace internal | 6936 } // namespace internal |
| 6936 } // namespace v8 | 6937 } // namespace v8 |
| OLD | NEW |