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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 AddCounter(args.GetIsolate(), result, counter_list[i].counter, | 109 AddCounter(args.GetIsolate(), result, counter_list[i].counter, |
110 counter_list[i].name); | 110 counter_list[i].name); |
111 } | 111 } |
112 | 112 |
113 struct StatisticNumber { | 113 struct StatisticNumber { |
114 intptr_t number; | 114 intptr_t number; |
115 const char* name; | 115 const char* name; |
116 }; | 116 }; |
117 | 117 |
118 const StatisticNumber numbers[] = { | 118 const StatisticNumber numbers[] = { |
119 {isolate->memory_allocator()->Size(), "total_committed_bytes"}, | 119 {heap->memory_allocator()->Size(), "total_committed_bytes"}, |
120 {heap->new_space()->Size(), "new_space_live_bytes"}, | 120 {heap->new_space()->Size(), "new_space_live_bytes"}, |
121 {heap->new_space()->Available(), "new_space_available_bytes"}, | 121 {heap->new_space()->Available(), "new_space_available_bytes"}, |
122 {heap->new_space()->CommittedMemory(), "new_space_commited_bytes"}, | 122 {heap->new_space()->CommittedMemory(), "new_space_commited_bytes"}, |
123 {heap->old_space()->Size(), "old_space_live_bytes"}, | 123 {heap->old_space()->Size(), "old_space_live_bytes"}, |
124 {heap->old_space()->Available(), "old_space_available_bytes"}, | 124 {heap->old_space()->Available(), "old_space_available_bytes"}, |
125 {heap->old_space()->CommittedMemory(), "old_space_commited_bytes"}, | 125 {heap->old_space()->CommittedMemory(), "old_space_commited_bytes"}, |
126 {heap->code_space()->Size(), "code_space_live_bytes"}, | 126 {heap->code_space()->Size(), "code_space_live_bytes"}, |
127 {heap->code_space()->Available(), "code_space_available_bytes"}, | 127 {heap->code_space()->Available(), "code_space_available_bytes"}, |
128 {heap->code_space()->CommittedMemory(), "code_space_commited_bytes"}, | 128 {heap->code_space()->CommittedMemory(), "code_space_commited_bytes"}, |
129 {heap->lo_space()->Size(), "lo_space_live_bytes"}, | 129 {heap->lo_space()->Size(), "lo_space_live_bytes"}, |
130 {heap->lo_space()->Available(), "lo_space_available_bytes"}, | 130 {heap->lo_space()->Available(), "lo_space_available_bytes"}, |
131 {heap->lo_space()->CommittedMemory(), "lo_space_commited_bytes"}, | 131 {heap->lo_space()->CommittedMemory(), "lo_space_commited_bytes"}, |
132 }; | 132 }; |
133 | 133 |
134 for (size_t i = 0; i < arraysize(numbers); i++) { | 134 for (size_t i = 0; i < arraysize(numbers); i++) { |
135 AddNumber(args.GetIsolate(), result, numbers[i].number, numbers[i].name); | 135 AddNumber(args.GetIsolate(), result, numbers[i].number, numbers[i].name); |
136 } | 136 } |
137 | 137 |
138 AddNumber64(args.GetIsolate(), result, | 138 AddNumber64(args.GetIsolate(), result, |
139 heap->amount_of_external_allocated_memory(), | 139 heap->amount_of_external_allocated_memory(), |
140 "amount_of_external_allocated_memory"); | 140 "amount_of_external_allocated_memory"); |
141 args.GetReturnValue().Set(result); | 141 args.GetReturnValue().Set(result); |
142 } | 142 } |
143 | 143 |
144 } // namespace internal | 144 } // namespace internal |
145 } // namespace v8 | 145 } // namespace v8 |
OLD | NEW |