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

Unified Diff: src/heap/heap.cc

Issue 1058253003: Adding V8 api to get memory statistics of spaces in V8::Heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adding new APIs for space statistics. Created 5 years, 8 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
« src/api.cc ('K') | « src/heap/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index b911ad1ee68006ba6358f33c4f4c50996f4b094b..00b3d1aa4f5f5324858b565a562e374bb8224bb7 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -54,6 +54,14 @@
namespace v8 {
namespace internal {
+namespace {
+const char* kNewSpaceName = "new_space";
+const char* kOldSpaceName = "old_space";
+const char* kCodeSpaceName = "code_space";
+const char* kMapSpaceName = "map_space";
+const char* kLoSpaceName = "large_object_space";
+} // namespace
+
Heap::Heap()
: amount_of_external_allocated_memory_(0),
@@ -451,6 +459,23 @@ intptr_t Heap::SizeOfObjects() {
}
+const char* Heap::GetSpaceName(int idx) {
+ switch (idx) {
+ case NEW_SPACE:
+ return kNewSpaceName;
+ case OLD_SPACE:
+ return kOldSpaceName;
+ case MAP_SPACE:
+ return kMapSpaceName;
+ case CODE_SPACE:
+ return kCodeSpaceName;
+ case LO_SPACE:
+ return kLoSpaceName;
rmcilroy 2015/04/15 10:21:42 add 'default' case with UNREACHABLE(); to ensure w
ssid 2015/04/15 10:43:58 Added UNREACHABLE and keeping return null since co
+ }
+ return nullptr;
+}
+
+
void Heap::ClearAllICsByKind(Code::Kind kind) {
HeapObjectIterator it(code_space());
« src/api.cc ('K') | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698