| 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 12 matching lines...) Expand all Loading... |
| 23 #include "src/code-stubs.h" | 23 #include "src/code-stubs.h" |
| 24 #include "src/compiler.h" | 24 #include "src/compiler.h" |
| 25 #include "src/contexts.h" | 25 #include "src/contexts.h" |
| 26 #include "src/conversions-inl.h" | 26 #include "src/conversions-inl.h" |
| 27 #include "src/counters.h" | 27 #include "src/counters.h" |
| 28 #include "src/cpu-profiler.h" | 28 #include "src/cpu-profiler.h" |
| 29 #include "src/debug.h" | 29 #include "src/debug.h" |
| 30 #include "src/deoptimizer.h" | 30 #include "src/deoptimizer.h" |
| 31 #include "src/execution.h" | 31 #include "src/execution.h" |
| 32 #include "src/global-handles.h" | 32 #include "src/global-handles.h" |
| 33 #include "src/heap/spaces.h" |
| 33 #include "src/heap-profiler.h" | 34 #include "src/heap-profiler.h" |
| 34 #include "src/heap-snapshot-generator-inl.h" | 35 #include "src/heap-snapshot-generator-inl.h" |
| 35 #include "src/icu_util.h" | 36 #include "src/icu_util.h" |
| 36 #include "src/json-parser.h" | 37 #include "src/json-parser.h" |
| 37 #include "src/messages.h" | 38 #include "src/messages.h" |
| 38 #include "src/parser.h" | 39 #include "src/parser.h" |
| 39 #include "src/pending-compilation-error-handler.h" | 40 #include "src/pending-compilation-error-handler.h" |
| 40 #include "src/profile-generator-inl.h" | 41 #include "src/profile-generator-inl.h" |
| 41 #include "src/property.h" | 42 #include "src/property.h" |
| 42 #include "src/property-details.h" | 43 #include "src/property-details.h" |
| (...skipping 5413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5456 } | 5457 } |
| 5457 | 5458 |
| 5458 | 5459 |
| 5459 HeapStatistics::HeapStatistics(): total_heap_size_(0), | 5460 HeapStatistics::HeapStatistics(): total_heap_size_(0), |
| 5460 total_heap_size_executable_(0), | 5461 total_heap_size_executable_(0), |
| 5461 total_physical_size_(0), | 5462 total_physical_size_(0), |
| 5462 used_heap_size_(0), | 5463 used_heap_size_(0), |
| 5463 heap_size_limit_(0) { } | 5464 heap_size_limit_(0) { } |
| 5464 | 5465 |
| 5465 | 5466 |
| 5467 HeapSpaceStatistics::HeapSpaceStatistics(): space_name_(0), |
| 5468 space_size_(0), |
| 5469 space_used_size_(0), |
| 5470 space_available_size_(0), |
| 5471 physical_space_size_(0) { } |
| 5472 |
| 5473 |
| 5466 bool v8::V8::InitializeICU(const char* icu_data_file) { | 5474 bool v8::V8::InitializeICU(const char* icu_data_file) { |
| 5467 return i::InitializeICU(icu_data_file); | 5475 return i::InitializeICU(icu_data_file); |
| 5468 } | 5476 } |
| 5469 | 5477 |
| 5470 | 5478 |
| 5471 const char* v8::V8::GetVersion() { | 5479 const char* v8::V8::GetVersion() { |
| 5472 return i::Version::GetVersion(); | 5480 return i::Version::GetVersion(); |
| 5473 } | 5481 } |
| 5474 | 5482 |
| 5475 | 5483 |
| (...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6993 i::Heap* heap = isolate->heap(); | 7001 i::Heap* heap = isolate->heap(); |
| 6994 heap_statistics->total_heap_size_ = heap->CommittedMemory(); | 7002 heap_statistics->total_heap_size_ = heap->CommittedMemory(); |
| 6995 heap_statistics->total_heap_size_executable_ = | 7003 heap_statistics->total_heap_size_executable_ = |
| 6996 heap->CommittedMemoryExecutable(); | 7004 heap->CommittedMemoryExecutable(); |
| 6997 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory(); | 7005 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory(); |
| 6998 heap_statistics->used_heap_size_ = heap->SizeOfObjects(); | 7006 heap_statistics->used_heap_size_ = heap->SizeOfObjects(); |
| 6999 heap_statistics->heap_size_limit_ = heap->MaxReserved(); | 7007 heap_statistics->heap_size_limit_ = heap->MaxReserved(); |
| 7000 } | 7008 } |
| 7001 | 7009 |
| 7002 | 7010 |
| 7011 size_t Isolate::NumberOfHeapSpaces() { |
| 7012 return i::LAST_SPACE - i::FIRST_SPACE + 1; |
| 7013 } |
| 7014 |
| 7015 |
| 7016 bool Isolate::GetHeapSpaceStatistics(HeapSpaceStatistics* space_statistics, |
| 7017 size_t index) { |
| 7018 if (!space_statistics) |
| 7019 return false; |
| 7020 if (index > i::LAST_SPACE || index < i::FIRST_SPACE) |
| 7021 return false; |
| 7022 |
| 7023 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 7024 i::Heap* heap = isolate->heap(); |
| 7025 i::Space* space = heap->space(static_cast<int>(index)); |
| 7026 |
| 7027 space_statistics->space_name_ = heap->GetSpaceName(static_cast<int>(index)); |
| 7028 space_statistics->space_size_ = space->CommittedMemory(); |
| 7029 space_statistics->space_used_size_ = space->Size(); |
| 7030 space_statistics->space_available_size_ = space->Available(); |
| 7031 space_statistics->physical_space_size_ = space->CommittedPhysicalMemory(); |
| 7032 return true; |
| 7033 } |
| 7034 |
| 7035 |
| 7003 void Isolate::GetStackSample(const RegisterState& state, void** frames, | 7036 void Isolate::GetStackSample(const RegisterState& state, void** frames, |
| 7004 size_t frames_limit, SampleInfo* sample_info) { | 7037 size_t frames_limit, SampleInfo* sample_info) { |
| 7005 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 7038 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 7006 i::TickSample::GetStackSample(isolate, state, i::TickSample::kSkipCEntryFrame, | 7039 i::TickSample::GetStackSample(isolate, state, i::TickSample::kSkipCEntryFrame, |
| 7007 frames, frames_limit, sample_info); | 7040 frames, frames_limit, sample_info); |
| 7008 } | 7041 } |
| 7009 | 7042 |
| 7010 | 7043 |
| 7011 void Isolate::SetEventLogger(LogEventCallback that) { | 7044 void Isolate::SetEventLogger(LogEventCallback that) { |
| 7012 // Do not overwrite the event logger if we want to log explicitly. | 7045 // Do not overwrite the event logger if we want to log explicitly. |
| (...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8110 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 8143 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 8111 Address callback_address = | 8144 Address callback_address = |
| 8112 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8145 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8113 VMState<EXTERNAL> state(isolate); | 8146 VMState<EXTERNAL> state(isolate); |
| 8114 ExternalCallbackScope call_scope(isolate, callback_address); | 8147 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8115 callback(info); | 8148 callback(info); |
| 8116 } | 8149 } |
| 8117 | 8150 |
| 8118 | 8151 |
| 8119 } } // namespace v8::internal | 8152 } } // namespace v8::internal |
| OLD | NEW |