| 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 6918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6929 if (!i::FLAG_track_gc_object_stats) return false; | 6929 if (!i::FLAG_track_gc_object_stats) return false; |
| 6930 | 6930 |
| 6931 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 6931 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 6932 i::Heap* heap = isolate->heap(); | 6932 i::Heap* heap = isolate->heap(); |
| 6933 const char* object_type; | 6933 const char* object_type; |
| 6934 const char* object_sub_type; | 6934 const char* object_sub_type; |
| 6935 size_t object_count = heap->object_count_last_gc(type_index); | 6935 size_t object_count = heap->object_count_last_gc(type_index); |
| 6936 size_t object_size = heap->object_size_last_gc(type_index); | 6936 size_t object_size = heap->object_size_last_gc(type_index); |
| 6937 if (!heap->GetObjectTypeName(type_index, &object_type, &object_sub_type)) { | 6937 if (!heap->GetObjectTypeName(type_index, &object_type, &object_sub_type)) { |
| 6938 // There should be no objects counted when the type is unknown. | 6938 // There should be no objects counted when the type is unknown. |
| 6939 DCHECK_EQ(object_count, 0); | 6939 DCHECK_EQ(object_count, 0U); |
| 6940 DCHECK_EQ(object_size, 0); | 6940 DCHECK_EQ(object_size, 0U); |
| 6941 return false; | 6941 return false; |
| 6942 } | 6942 } |
| 6943 | 6943 |
| 6944 object_statistics->object_type_ = object_type; | 6944 object_statistics->object_type_ = object_type; |
| 6945 object_statistics->object_sub_type_ = object_sub_type; | 6945 object_statistics->object_sub_type_ = object_sub_type; |
| 6946 object_statistics->object_count_ = object_count; | 6946 object_statistics->object_count_ = object_count; |
| 6947 object_statistics->object_size_ = object_size; | 6947 object_statistics->object_size_ = object_size; |
| 6948 return true; | 6948 return true; |
| 6949 } | 6949 } |
| 6950 | 6950 |
| (...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8071 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 8071 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 8072 Address callback_address = | 8072 Address callback_address = |
| 8073 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8073 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8074 VMState<EXTERNAL> state(isolate); | 8074 VMState<EXTERNAL> state(isolate); |
| 8075 ExternalCallbackScope call_scope(isolate, callback_address); | 8075 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8076 callback(info); | 8076 callback(info); |
| 8077 } | 8077 } |
| 8078 | 8078 |
| 8079 | 8079 |
| 8080 } } // namespace v8::internal | 8080 } } // namespace v8::internal |
| OLD | NEW |