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 4932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4943 double idle_time_in_ms = deadline_in_ms - start_ms; | 4943 double idle_time_in_ms = deadline_in_ms - start_ms; |
4944 double current_time = MonotonicallyIncreasingTimeInMs(); | 4944 double current_time = MonotonicallyIncreasingTimeInMs(); |
4945 last_idle_notification_time_ = current_time; | 4945 last_idle_notification_time_ = current_time; |
4946 double deadline_difference = deadline_in_ms - current_time; | 4946 double deadline_difference = deadline_in_ms - current_time; |
4947 | 4947 |
4948 contexts_disposed_ = 0; | 4948 contexts_disposed_ = 0; |
4949 | 4949 |
4950 isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample( | 4950 isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample( |
4951 static_cast<int>(idle_time_in_ms)); | 4951 static_cast<int>(idle_time_in_ms)); |
4952 | 4952 |
| 4953 if (deadline_in_ms - start_ms > |
| 4954 GCIdleTimeHandler::kMaxFrameRenderingIdleTime) { |
| 4955 int committed_memory = static_cast<int>(CommittedMemory() / KB); |
| 4956 int used_memory = static_cast<int>(heap_state.size_of_objects / KB); |
| 4957 isolate()->counters()->aggregated_memory_heap_committed()->AddSample( |
| 4958 start_ms, committed_memory); |
| 4959 isolate()->counters()->aggregated_memory_heap_used()->AddSample( |
| 4960 start_ms, used_memory); |
| 4961 } |
| 4962 |
4953 if (deadline_difference >= 0) { | 4963 if (deadline_difference >= 0) { |
4954 if (action.type != DONE && action.type != DO_NOTHING) { | 4964 if (action.type != DONE && action.type != DO_NOTHING) { |
4955 isolate()->counters()->gc_idle_time_limit_undershot()->AddSample( | 4965 isolate()->counters()->gc_idle_time_limit_undershot()->AddSample( |
4956 static_cast<int>(deadline_difference)); | 4966 static_cast<int>(deadline_difference)); |
4957 } | 4967 } |
4958 } else { | 4968 } else { |
4959 isolate()->counters()->gc_idle_time_limit_overshot()->AddSample( | 4969 isolate()->counters()->gc_idle_time_limit_overshot()->AddSample( |
4960 static_cast<int>(-deadline_difference)); | 4970 static_cast<int>(-deadline_difference)); |
4961 } | 4971 } |
4962 | 4972 |
(...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6935 *object_type = "CODE_TYPE"; \ | 6945 *object_type = "CODE_TYPE"; \ |
6936 *object_sub_type = "CODE_AGE/" #name; \ | 6946 *object_sub_type = "CODE_AGE/" #name; \ |
6937 return true; | 6947 return true; |
6938 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6948 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
6939 #undef COMPARE_AND_RETURN_NAME | 6949 #undef COMPARE_AND_RETURN_NAME |
6940 } | 6950 } |
6941 return false; | 6951 return false; |
6942 } | 6952 } |
6943 } // namespace internal | 6953 } // namespace internal |
6944 } // namespace v8 | 6954 } // namespace v8 |
OLD | NEW |