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) { |