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 8069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8080 size_t Isolate::NumberOfTrackedHeapObjectTypes() { | 8080 size_t Isolate::NumberOfTrackedHeapObjectTypes() { |
8081 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8081 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8082 i::Heap* heap = isolate->heap(); | 8082 i::Heap* heap = isolate->heap(); |
8083 return heap->NumberOfTrackedHeapObjectTypes(); | 8083 return heap->NumberOfTrackedHeapObjectTypes(); |
8084 } | 8084 } |
8085 | 8085 |
8086 | 8086 |
8087 bool Isolate::GetHeapObjectStatisticsAtLastGC( | 8087 bool Isolate::GetHeapObjectStatisticsAtLastGC( |
8088 HeapObjectStatistics* object_statistics, size_t type_index) { | 8088 HeapObjectStatistics* object_statistics, size_t type_index) { |
8089 if (!object_statistics) return false; | 8089 if (!object_statistics) return false; |
8090 if (V8_LIKELY(!i::FLAG_gc_stats)) return false; | 8090 if (!i::FLAG_track_gc_object_stats) return false; |
8091 | 8091 |
8092 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8092 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8093 i::Heap* heap = isolate->heap(); | 8093 i::Heap* heap = isolate->heap(); |
8094 if (type_index >= heap->NumberOfTrackedHeapObjectTypes()) return false; | 8094 if (type_index >= heap->NumberOfTrackedHeapObjectTypes()) return false; |
8095 | 8095 |
8096 const char* object_type; | 8096 const char* object_type; |
8097 const char* object_sub_type; | 8097 const char* object_sub_type; |
8098 size_t object_count = heap->ObjectCountAtLastGC(type_index); | 8098 size_t object_count = heap->ObjectCountAtLastGC(type_index); |
8099 size_t object_size = heap->ObjectSizeAtLastGC(type_index); | 8099 size_t object_size = heap->ObjectSizeAtLastGC(type_index); |
8100 if (!heap->GetObjectTypeName(type_index, &object_type, &object_sub_type)) { | 8100 if (!heap->GetObjectTypeName(type_index, &object_type, &object_sub_type)) { |
(...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9672 Address callback_address = | 9672 Address callback_address = |
9673 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9673 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9674 VMState<EXTERNAL> state(isolate); | 9674 VMState<EXTERNAL> state(isolate); |
9675 ExternalCallbackScope call_scope(isolate, callback_address); | 9675 ExternalCallbackScope call_scope(isolate, callback_address); |
9676 callback(info); | 9676 callback(info); |
9677 } | 9677 } |
9678 | 9678 |
9679 | 9679 |
9680 } // namespace internal | 9680 } // namespace internal |
9681 } // namespace v8 | 9681 } // namespace v8 |
OLD | NEW |