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()); |