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 9775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9786 return ToApiHandle<String>(name); | 9786 return ToApiHandle<String>(name); |
9787 } else { | 9787 } else { |
9788 // We do not expect this to fail. Change this if it does. | 9788 // We do not expect this to fail. Change this if it does. |
9789 i::Handle<i::String> cons = isolate->factory()->NewConsString( | 9789 i::Handle<i::String> cons = isolate->factory()->NewConsString( |
9790 isolate->factory()->InternalizeUtf8String(entry->name_prefix()), | 9790 isolate->factory()->InternalizeUtf8String(entry->name_prefix()), |
9791 name).ToHandleChecked(); | 9791 name).ToHandleChecked(); |
9792 return ToApiHandle<String>(cons); | 9792 return ToApiHandle<String>(cons); |
9793 } | 9793 } |
9794 } | 9794 } |
9795 | 9795 |
| 9796 int debug::Coverage::BlockData::StartOffset() const { return block_->start; } |
| 9797 int debug::Coverage::BlockData::EndOffset() const { return block_->end; } |
| 9798 uint32_t debug::Coverage::BlockData::Count() const { return block_->count; } |
| 9799 |
9796 int debug::Coverage::FunctionData::StartOffset() const { | 9800 int debug::Coverage::FunctionData::StartOffset() const { |
9797 return function_->start; | 9801 return function_->start; |
9798 } | 9802 } |
9799 int debug::Coverage::FunctionData::EndOffset() const { return function_->end; } | 9803 int debug::Coverage::FunctionData::EndOffset() const { return function_->end; } |
9800 uint32_t debug::Coverage::FunctionData::Count() const { | 9804 uint32_t debug::Coverage::FunctionData::Count() const { |
9801 return function_->count; | 9805 return function_->count; |
9802 } | 9806 } |
9803 | 9807 |
9804 MaybeLocal<String> debug::Coverage::FunctionData::Name() const { | 9808 MaybeLocal<String> debug::Coverage::FunctionData::Name() const { |
9805 return ToApiHandle<String>(function_->name); | 9809 return ToApiHandle<String>(function_->name); |
9806 } | 9810 } |
9807 | 9811 |
| 9812 size_t debug::Coverage::FunctionData::BlockCount() const { |
| 9813 return function_->blocks.size(); |
| 9814 } |
| 9815 |
| 9816 debug::Coverage::BlockData debug::Coverage::FunctionData::GetBlockData( |
| 9817 size_t i) const { |
| 9818 return BlockData(&function_->blocks.at(i)); |
| 9819 } |
| 9820 |
9808 Local<debug::Script> debug::Coverage::ScriptData::GetScript() const { | 9821 Local<debug::Script> debug::Coverage::ScriptData::GetScript() const { |
9809 return ToApiHandle<debug::Script>(script_->script); | 9822 return ToApiHandle<debug::Script>(script_->script); |
9810 } | 9823 } |
9811 | 9824 |
9812 size_t debug::Coverage::ScriptData::FunctionCount() const { | 9825 size_t debug::Coverage::ScriptData::FunctionCount() const { |
9813 return script_->functions.size(); | 9826 return script_->functions.size(); |
9814 } | 9827 } |
9815 | 9828 |
9816 debug::Coverage::FunctionData debug::Coverage::ScriptData::GetFunctionData( | 9829 debug::Coverage::FunctionData debug::Coverage::ScriptData::GetFunctionData( |
9817 size_t i) const { | 9830 size_t i) const { |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10501 Address callback_address = | 10514 Address callback_address = |
10502 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10515 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
10503 VMState<EXTERNAL> state(isolate); | 10516 VMState<EXTERNAL> state(isolate); |
10504 ExternalCallbackScope call_scope(isolate, callback_address); | 10517 ExternalCallbackScope call_scope(isolate, callback_address); |
10505 callback(info); | 10518 callback(info); |
10506 } | 10519 } |
10507 | 10520 |
10508 | 10521 |
10509 } // namespace internal | 10522 } // namespace internal |
10510 } // namespace v8 | 10523 } // namespace v8 |
OLD | NEW |