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

Side by Side Diff: src/api.cc

Issue 1104123002: Extending v8::GetHeapStatistics to return total available size. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 6851 matching lines...) Expand 10 before | Expand all | Expand 10 after
6862 } 6862 }
6863 6863
6864 6864
6865 void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) { 6865 void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) {
6866 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 6866 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
6867 i::Heap* heap = isolate->heap(); 6867 i::Heap* heap = isolate->heap();
6868 heap_statistics->total_heap_size_ = heap->CommittedMemory(); 6868 heap_statistics->total_heap_size_ = heap->CommittedMemory();
6869 heap_statistics->total_heap_size_executable_ = 6869 heap_statistics->total_heap_size_executable_ =
6870 heap->CommittedMemoryExecutable(); 6870 heap->CommittedMemoryExecutable();
6871 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory(); 6871 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory();
6872 heap_statistics->total_available_size_ = heap->Available();
6872 heap_statistics->used_heap_size_ = heap->SizeOfObjects(); 6873 heap_statistics->used_heap_size_ = heap->SizeOfObjects();
6873 heap_statistics->heap_size_limit_ = heap->MaxReserved(); 6874 heap_statistics->heap_size_limit_ = heap->MaxReserved();
6874 } 6875 }
6875 6876
6876 6877
6877 size_t Isolate::NumberOfHeapSpaces() { 6878 size_t Isolate::NumberOfHeapSpaces() {
6878 return i::LAST_SPACE - i::FIRST_SPACE + 1; 6879 return i::LAST_SPACE - i::FIRST_SPACE + 1;
6879 } 6880 }
6880 6881
6881 6882
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after
8009 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 8010 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
8010 Address callback_address = 8011 Address callback_address =
8011 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8012 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8012 VMState<EXTERNAL> state(isolate); 8013 VMState<EXTERNAL> state(isolate);
8013 ExternalCallbackScope call_scope(isolate, callback_address); 8014 ExternalCallbackScope call_scope(isolate, callback_address);
8014 callback(info); 8015 callback(info);
8015 } 8016 }
8016 8017
8017 8018
8018 } } // namespace v8::internal 8019 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698