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/extensions/statistics-extension.h" | 5 #include "src/extensions/statistics-extension.h" |
6 | 6 |
7 #include "src/counters.h" | 7 #include "src/counters.h" |
8 #include "src/heap/heap-inl.h" | 8 #include "src/heap/heap-inl.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 | 10 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 struct StatisticNumber { | 114 struct StatisticNumber { |
115 intptr_t number; | 115 intptr_t number; |
116 const char* name; | 116 const char* name; |
117 }; | 117 }; |
118 | 118 |
119 const StatisticNumber numbers[] = { | 119 const StatisticNumber numbers[] = { |
120 {heap->memory_allocator()->Size(), "total_committed_bytes"}, | 120 {heap->memory_allocator()->Size(), "total_committed_bytes"}, |
121 {heap->new_space()->Size(), "new_space_live_bytes"}, | 121 {heap->new_space()->Size(), "new_space_live_bytes"}, |
122 {heap->new_space()->Available(), "new_space_available_bytes"}, | 122 {heap->new_space()->Available(), "new_space_available_bytes"}, |
123 {heap->new_space()->CommittedMemory(), "new_space_commited_bytes"}, | 123 {static_cast<intptr_t>(heap->new_space()->CommittedMemory()), |
| 124 "new_space_commited_bytes"}, |
124 {heap->old_space()->Size(), "old_space_live_bytes"}, | 125 {heap->old_space()->Size(), "old_space_live_bytes"}, |
125 {heap->old_space()->Available(), "old_space_available_bytes"}, | 126 {heap->old_space()->Available(), "old_space_available_bytes"}, |
126 {heap->old_space()->CommittedMemory(), "old_space_commited_bytes"}, | 127 {static_cast<intptr_t>(heap->old_space()->CommittedMemory()), |
| 128 "old_space_commited_bytes"}, |
127 {heap->code_space()->Size(), "code_space_live_bytes"}, | 129 {heap->code_space()->Size(), "code_space_live_bytes"}, |
128 {heap->code_space()->Available(), "code_space_available_bytes"}, | 130 {heap->code_space()->Available(), "code_space_available_bytes"}, |
129 {heap->code_space()->CommittedMemory(), "code_space_commited_bytes"}, | 131 {static_cast<intptr_t>(heap->code_space()->CommittedMemory()), |
| 132 "code_space_commited_bytes"}, |
130 {heap->lo_space()->Size(), "lo_space_live_bytes"}, | 133 {heap->lo_space()->Size(), "lo_space_live_bytes"}, |
131 {heap->lo_space()->Available(), "lo_space_available_bytes"}, | 134 {heap->lo_space()->Available(), "lo_space_available_bytes"}, |
132 {heap->lo_space()->CommittedMemory(), "lo_space_commited_bytes"}, | 135 {static_cast<intptr_t>(heap->lo_space()->CommittedMemory()), |
| 136 "lo_space_commited_bytes"}, |
133 }; | 137 }; |
134 | 138 |
135 for (size_t i = 0; i < arraysize(numbers); i++) { | 139 for (size_t i = 0; i < arraysize(numbers); i++) { |
136 AddNumber(args.GetIsolate(), result, numbers[i].number, numbers[i].name); | 140 AddNumber(args.GetIsolate(), result, numbers[i].number, numbers[i].name); |
137 } | 141 } |
138 | 142 |
139 AddNumber64(args.GetIsolate(), result, heap->external_memory(), | 143 AddNumber64(args.GetIsolate(), result, heap->external_memory(), |
140 "amount_of_external_allocated_memory"); | 144 "amount_of_external_allocated_memory"); |
141 args.GetReturnValue().Set(result); | 145 args.GetReturnValue().Set(result); |
142 | 146 |
(...skipping 16 matching lines...) Expand all Loading... |
159 } | 163 } |
160 | 164 |
161 AddNumber(args.GetIsolate(), result, reloc_info_total, | 165 AddNumber(args.GetIsolate(), result, reloc_info_total, |
162 "reloc_info_total_size"); | 166 "reloc_info_total_size"); |
163 AddNumber(args.GetIsolate(), result, source_position_table_total, | 167 AddNumber(args.GetIsolate(), result, source_position_table_total, |
164 "source_position_table_total_size"); | 168 "source_position_table_total_size"); |
165 } | 169 } |
166 | 170 |
167 } // namespace internal | 171 } // namespace internal |
168 } // namespace v8 | 172 } // namespace v8 |
OLD | NEW |