Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: src/extensions/statistics-extension.cc

Issue 2095893002: Use source position table for unoptimized code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix gc mole Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/debug/liveedit.cc ('k') | src/factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/debug/liveedit.cc ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698