| OLD | NEW |
| 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 5480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5491 } | 5491 } |
| 5492 | 5492 |
| 5493 HeapStatistics::HeapStatistics() | 5493 HeapStatistics::HeapStatistics() |
| 5494 : total_heap_size_(0), | 5494 : total_heap_size_(0), |
| 5495 total_heap_size_executable_(0), | 5495 total_heap_size_executable_(0), |
| 5496 total_physical_size_(0), | 5496 total_physical_size_(0), |
| 5497 total_available_size_(0), | 5497 total_available_size_(0), |
| 5498 used_heap_size_(0), | 5498 used_heap_size_(0), |
| 5499 heap_size_limit_(0), | 5499 heap_size_limit_(0), |
| 5500 malloced_memory_(0), | 5500 malloced_memory_(0), |
| 5501 malloced_peak_memory_(0), |
| 5501 does_zap_garbage_(0) {} | 5502 does_zap_garbage_(0) {} |
| 5502 | 5503 |
| 5503 HeapSpaceStatistics::HeapSpaceStatistics(): space_name_(0), | 5504 HeapSpaceStatistics::HeapSpaceStatistics(): space_name_(0), |
| 5504 space_size_(0), | 5505 space_size_(0), |
| 5505 space_used_size_(0), | 5506 space_used_size_(0), |
| 5506 space_available_size_(0), | 5507 space_available_size_(0), |
| 5507 physical_space_size_(0) { } | 5508 physical_space_size_(0) { } |
| 5508 | 5509 |
| 5509 | 5510 |
| 5510 HeapObjectStatistics::HeapObjectStatistics() | 5511 HeapObjectStatistics::HeapObjectStatistics() |
| (...skipping 1873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7384 i::Heap* heap = isolate->heap(); | 7385 i::Heap* heap = isolate->heap(); |
| 7385 heap_statistics->total_heap_size_ = heap->CommittedMemory(); | 7386 heap_statistics->total_heap_size_ = heap->CommittedMemory(); |
| 7386 heap_statistics->total_heap_size_executable_ = | 7387 heap_statistics->total_heap_size_executable_ = |
| 7387 heap->CommittedMemoryExecutable(); | 7388 heap->CommittedMemoryExecutable(); |
| 7388 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory(); | 7389 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory(); |
| 7389 heap_statistics->total_available_size_ = heap->Available(); | 7390 heap_statistics->total_available_size_ = heap->Available(); |
| 7390 heap_statistics->used_heap_size_ = heap->SizeOfObjects(); | 7391 heap_statistics->used_heap_size_ = heap->SizeOfObjects(); |
| 7391 heap_statistics->heap_size_limit_ = heap->MaxReserved(); | 7392 heap_statistics->heap_size_limit_ = heap->MaxReserved(); |
| 7392 heap_statistics->malloced_memory_ = | 7393 heap_statistics->malloced_memory_ = |
| 7393 isolate->allocator()->GetCurrentMemoryUsage(); | 7394 isolate->allocator()->GetCurrentMemoryUsage(); |
| 7395 heap_statistics->malloced_peak_memory_ = |
| 7396 isolate->allocator()->GetPeakMemoryUsage(); |
| 7394 heap_statistics->does_zap_garbage_ = heap->ShouldZapGarbage(); | 7397 heap_statistics->does_zap_garbage_ = heap->ShouldZapGarbage(); |
| 7395 } | 7398 } |
| 7396 | 7399 |
| 7397 | 7400 |
| 7398 size_t Isolate::NumberOfHeapSpaces() { | 7401 size_t Isolate::NumberOfHeapSpaces() { |
| 7399 return i::LAST_SPACE - i::FIRST_SPACE + 1; | 7402 return i::LAST_SPACE - i::FIRST_SPACE + 1; |
| 7400 } | 7403 } |
| 7401 | 7404 |
| 7402 | 7405 |
| 7403 bool Isolate::GetHeapSpaceStatistics(HeapSpaceStatistics* space_statistics, | 7406 bool Isolate::GetHeapSpaceStatistics(HeapSpaceStatistics* space_statistics, |
| (...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8824 Address callback_address = | 8827 Address callback_address = |
| 8825 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8828 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8826 VMState<EXTERNAL> state(isolate); | 8829 VMState<EXTERNAL> state(isolate); |
| 8827 ExternalCallbackScope call_scope(isolate, callback_address); | 8830 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8828 callback(info); | 8831 callback(info); |
| 8829 } | 8832 } |
| 8830 | 8833 |
| 8831 | 8834 |
| 8832 } // namespace internal | 8835 } // namespace internal |
| 8833 } // namespace v8 | 8836 } // namespace v8 |
| OLD | NEW |