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

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: Fixing build. 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
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 6ee6c094bd05ebefb228697f0ca778e3b94ff906..9fd911377e1efb99566f7ad4f255f49932b34562 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),
@@ -452,6 +460,25 @@ 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;
+ default:
+ UNREACHABLE();
+ }
+ return nullptr;
+}
+
+
void Heap::ClearAllICsByKind(Code::Kind kind) {
HeapObjectIterator it(code_space());

Powered by Google App Engine
This is Rietveld 408576698