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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug/liveedit.cc ('k') | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/extensions/statistics-extension.cc
diff --git a/src/extensions/statistics-extension.cc b/src/extensions/statistics-extension.cc
index 387bd31e682764c6ed0f6227cc09c18101a1ea28..5aafb7a9748bff24f4d7fc2b56684b2834cf1904 100644
--- a/src/extensions/statistics-extension.cc
+++ b/src/extensions/statistics-extension.cc
@@ -138,6 +138,29 @@ void StatisticsExtension::GetCounters(
AddNumber64(args.GetIsolate(), result, heap->external_memory(),
"amount_of_external_allocated_memory");
args.GetReturnValue().Set(result);
+
+ HeapIterator iterator(reinterpret_cast<Isolate*>(args.GetIsolate())->heap());
+ HeapObject* obj;
+ int reloc_info_total = 0;
+ int source_position_table_total = 0;
+ while ((obj = iterator.next())) {
+ if (obj->IsCode()) {
+ Code* code = Code::cast(obj);
+ reloc_info_total += code->relocation_info()->Size();
+ ByteArray* source_position_table = code->source_position_table();
+ if (source_position_table->length() > 0) {
+ source_position_table_total += code->source_position_table()->Size();
+ }
+ } else if (obj->IsBytecodeArray()) {
+ source_position_table_total +=
+ BytecodeArray::cast(obj)->source_position_table()->Size();
+ }
+ }
+
+ AddNumber(args.GetIsolate(), result, reloc_info_total,
+ "reloc_info_total_size");
+ AddNumber(args.GetIsolate(), result, source_position_table_total,
+ "source_position_table_total_size");
}
} // namespace internal
« 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