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

Unified Diff: src/api.cc

Issue 1997363002: Adds support for collecting statistics about code and its metadata. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments from Hannes. Created 4 years, 7 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 | « include/v8.h ('k') | src/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index a4e047c9b64a6b9c66c8618a3376f9a5ba12e540..a9e13f755a03c1b8fa0bedfbda43d6f7fef1d34f 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -5504,6 +5504,8 @@ HeapObjectStatistics::HeapObjectStatistics()
object_count_(0),
object_size_(0) {}
+HeapCodeStatistics::HeapCodeStatistics()
+ : code_and_metadata_size_(0), bytecode_and_metadata_size_(0) {}
bool v8::V8::InitializeICU(const char* icu_data_file) {
return i::InitializeICU(icu_data_file);
@@ -7458,6 +7460,18 @@ bool Isolate::GetHeapObjectStatisticsAtLastGC(
return true;
}
+bool Isolate::GetHeapCodeAndMetadataStatistics(
+ HeapCodeStatistics* code_statistics) {
+ if (!code_statistics) return false;
+
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
+ isolate->heap()->CollectCodeStatistics();
+
+ code_statistics->code_and_metadata_size_ = isolate->code_and_metadata_size();
+ code_statistics->bytecode_and_metadata_size_ =
+ isolate->bytecode_and_metadata_size();
+ return true;
+}
void Isolate::GetStackSample(const RegisterState& state, void** frames,
size_t frames_limit, SampleInfo* sample_info) {
« no previous file with comments | « include/v8.h ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698