Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: src/api.cc

Issue 2882973002: [coverage] Block coverage with support for IfStatements (Closed)
Patch Set: Comment nit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/ast/ast.h » ('j') | src/ast/ast.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 9738 matching lines...) Expand 10 before | Expand all | Expand 10 after
9749 return ToApiHandle<String>(name); 9749 return ToApiHandle<String>(name);
9750 } else { 9750 } else {
9751 // We do not expect this to fail. Change this if it does. 9751 // We do not expect this to fail. Change this if it does.
9752 i::Handle<i::String> cons = isolate->factory()->NewConsString( 9752 i::Handle<i::String> cons = isolate->factory()->NewConsString(
9753 isolate->factory()->InternalizeUtf8String(entry->name_prefix()), 9753 isolate->factory()->InternalizeUtf8String(entry->name_prefix()),
9754 name).ToHandleChecked(); 9754 name).ToHandleChecked();
9755 return ToApiHandle<String>(cons); 9755 return ToApiHandle<String>(cons);
9756 } 9756 }
9757 } 9757 }
9758 9758
9759 int debug::Coverage::BlockData::StartOffset() const { return block_->start; }
9760 int debug::Coverage::BlockData::EndOffset() const { return block_->end; }
9761 uint32_t debug::Coverage::BlockData::Count() const { return block_->count; }
9762
9759 int debug::Coverage::FunctionData::StartOffset() const { 9763 int debug::Coverage::FunctionData::StartOffset() const {
9760 return function_->start; 9764 return function_->start;
9761 } 9765 }
9762 int debug::Coverage::FunctionData::EndOffset() const { return function_->end; } 9766 int debug::Coverage::FunctionData::EndOffset() const { return function_->end; }
9763 uint32_t debug::Coverage::FunctionData::Count() const { 9767 uint32_t debug::Coverage::FunctionData::Count() const {
9764 return function_->count; 9768 return function_->count;
9765 } 9769 }
9766 9770
9767 MaybeLocal<String> debug::Coverage::FunctionData::Name() const { 9771 MaybeLocal<String> debug::Coverage::FunctionData::Name() const {
9768 return ToApiHandle<String>(function_->name); 9772 return ToApiHandle<String>(function_->name);
9769 } 9773 }
9770 9774
9775 size_t debug::Coverage::FunctionData::BlockCount() const {
9776 return function_->blocks.size();
9777 }
9778
9779 debug::Coverage::BlockData debug::Coverage::FunctionData::GetBlockData(
9780 size_t i) const {
9781 return BlockData(&function_->blocks.at(i));
9782 }
9783
9771 Local<debug::Script> debug::Coverage::ScriptData::GetScript() const { 9784 Local<debug::Script> debug::Coverage::ScriptData::GetScript() const {
9772 return ToApiHandle<debug::Script>(script_->script); 9785 return ToApiHandle<debug::Script>(script_->script);
9773 } 9786 }
9774 9787
9775 size_t debug::Coverage::ScriptData::FunctionCount() const { 9788 size_t debug::Coverage::ScriptData::FunctionCount() const {
9776 return script_->functions.size(); 9789 return script_->functions.size();
9777 } 9790 }
9778 9791
9779 debug::Coverage::FunctionData debug::Coverage::ScriptData::GetFunctionData( 9792 debug::Coverage::FunctionData debug::Coverage::ScriptData::GetFunctionData(
9780 size_t i) const { 9793 size_t i) const {
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
10464 Address callback_address = 10477 Address callback_address =
10465 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10478 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10466 VMState<EXTERNAL> state(isolate); 10479 VMState<EXTERNAL> state(isolate);
10467 ExternalCallbackScope call_scope(isolate, callback_address); 10480 ExternalCallbackScope call_scope(isolate, callback_address);
10468 callback(info); 10481 callback(info);
10469 } 10482 }
10470 10483
10471 10484
10472 } // namespace internal 10485 } // namespace internal
10473 } // namespace v8 10486 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/ast/ast.h » ('j') | src/ast/ast.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698