Commit 754c32ec authored by hpayer@chromium.org's avatar hpayer@chromium.org

Make Isolate::GetHeapStatistics robust against half-initialized isolates.

The (deprecated) non-Isolate GetHeapStatistics contains the same check.

BUG=2591

Review URL: https://codereview.chromium.org/12965013
Patch from Marja Hölttä <marja@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14079 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a942fcd9
......@@ -5971,6 +5971,14 @@ void Isolate::Exit() {
void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
if (!isolate->IsInitialized()) {
heap_statistics->total_heap_size_ = 0;
heap_statistics->total_heap_size_executable_ = 0;
heap_statistics->total_physical_size_ = 0;
heap_statistics->used_heap_size_ = 0;
heap_statistics->heap_size_limit_ = 0;
return;
}
i::Heap* heap = isolate->heap();
heap_statistics->total_heap_size_ = heap->CommittedMemory();
heap_statistics->total_heap_size_executable_ =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment