| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 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, heap->external_memory(), | 138   AddNumber64(args.GetIsolate(), result, heap->external_memory(), | 
| 139               "amount_of_external_allocated_memory"); | 139               "amount_of_external_allocated_memory"); | 
| 140   args.GetReturnValue().Set(result); | 140   args.GetReturnValue().Set(result); | 
|  | 141 | 
|  | 142   HeapIterator iterator(reinterpret_cast<Isolate*>(args.GetIsolate())->heap()); | 
|  | 143   HeapObject* obj; | 
|  | 144   int reloc_info_total = 0; | 
|  | 145   int source_position_table_total = 0; | 
|  | 146   while ((obj = iterator.next())) { | 
|  | 147     if (obj->IsCode()) { | 
|  | 148       Code* code = Code::cast(obj); | 
|  | 149       reloc_info_total += code->relocation_info()->Size(); | 
|  | 150       ByteArray* source_position_table = code->source_position_table(); | 
|  | 151       if (source_position_table->length() > 0) { | 
|  | 152         source_position_table_total += code->source_position_table()->Size(); | 
|  | 153       } | 
|  | 154     } else if (obj->IsBytecodeArray()) { | 
|  | 155       source_position_table_total += | 
|  | 156           BytecodeArray::cast(obj)->source_position_table()->Size(); | 
|  | 157     } | 
|  | 158   } | 
|  | 159 | 
|  | 160   AddNumber(args.GetIsolate(), result, reloc_info_total, | 
|  | 161             "reloc_info_total_size"); | 
|  | 162   AddNumber(args.GetIsolate(), result, source_position_table_total, | 
|  | 163             "source_position_table_total_size"); | 
| 141 } | 164 } | 
| 142 | 165 | 
| 143 }  // namespace internal | 166 }  // namespace internal | 
| 144 }  // namespace v8 | 167 }  // namespace v8 | 
| OLD | NEW | 
|---|