Chromium Code Reviews| 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 7235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7246 | 7246 |
| 7247 size_t Isolate::NumberOfHeapSpaces() { | 7247 size_t Isolate::NumberOfHeapSpaces() { |
| 7248 return i::LAST_SPACE - i::FIRST_SPACE + 1; | 7248 return i::LAST_SPACE - i::FIRST_SPACE + 1; |
| 7249 } | 7249 } |
| 7250 | 7250 |
| 7251 | 7251 |
| 7252 bool Isolate::GetHeapSpaceStatistics(HeapSpaceStatistics* space_statistics, | 7252 bool Isolate::GetHeapSpaceStatistics(HeapSpaceStatistics* space_statistics, |
| 7253 size_t index) { | 7253 size_t index) { |
| 7254 if (!space_statistics) | 7254 if (!space_statistics) |
| 7255 return false; | 7255 return false; |
| 7256 if (index > i::LAST_SPACE || index < i::FIRST_SPACE) | 7256 COMPILE_ASSERT(i::FIRST_SPACE == 0, first_space_assumed_to_be_zero); |
|
Sven Panne
2015/06/09 06:44:46
Sorry for chiming in so late, but IMHO this is sti
sejunho
2015/06/09 08:22:27
Thank you for comment sven.
First, I fixed like th
sejunho
2015/06/10 03:17:26
Done.
| |
| 7257 if (index > i::LAST_SPACE) | |
| 7257 return false; | 7258 return false; |
| 7258 | 7259 |
| 7259 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 7260 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 7260 i::Heap* heap = isolate->heap(); | 7261 i::Heap* heap = isolate->heap(); |
| 7261 i::Space* space = heap->space(static_cast<int>(index)); | 7262 i::Space* space = heap->space(static_cast<int>(index)); |
| 7262 | 7263 |
| 7263 space_statistics->space_name_ = heap->GetSpaceName(static_cast<int>(index)); | 7264 space_statistics->space_name_ = heap->GetSpaceName(static_cast<int>(index)); |
| 7264 space_statistics->space_size_ = space->CommittedMemory(); | 7265 space_statistics->space_size_ = space->CommittedMemory(); |
| 7265 space_statistics->space_used_size_ = space->SizeOfObjects(); | 7266 space_statistics->space_used_size_ = space->SizeOfObjects(); |
| 7266 space_statistics->space_available_size_ = space->Available(); | 7267 space_statistics->space_available_size_ = space->Available(); |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8428 Address callback_address = | 8429 Address callback_address = |
| 8429 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8430 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8430 VMState<EXTERNAL> state(isolate); | 8431 VMState<EXTERNAL> state(isolate); |
| 8431 ExternalCallbackScope call_scope(isolate, callback_address); | 8432 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8432 callback(info); | 8433 callback(info); |
| 8433 } | 8434 } |
| 8434 | 8435 |
| 8435 | 8436 |
| 8436 } // namespace internal | 8437 } // namespace internal |
| 8437 } // namespace v8 | 8438 } // namespace v8 |
| OLD | NEW |