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

Unified Diff: runtime/vm/coverage.cc

Issue 1644793002: Replace intptr_t with TokenDescriptor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/coverage.cc
diff --git a/runtime/vm/coverage.cc b/runtime/vm/coverage.cc
index 42dff5ec35d673118ee88aa843d895f8a7c0f0bf..705e1e5b36d666610e3c2c7da5c0da3bcfbc45ca 100644
--- a/runtime/vm/coverage.cc
+++ b/runtime/vm/coverage.cc
@@ -87,8 +87,8 @@ void CodeCoverage::CompileAndAdd(const Function& function,
const PcDescriptors& descriptors = PcDescriptors::Handle(
zone, code.pc_descriptors());
- const intptr_t begin_pos = function.token_pos();
- const intptr_t end_pos = function.end_token_pos();
+ const TokenDescriptor begin_pos = function.token_pos();
+ const TokenDescriptor end_pos = function.end_token_pos();
intptr_t last_line = -1;
intptr_t last_count = 0;
// Only IC based calls have counting.
@@ -98,16 +98,18 @@ void CodeCoverage::CompileAndAdd(const Function& function,
HANDLESCOPE(thread);
const ICData* ic_data = (*ic_data_array)[iter.DeoptId()];
if (!ic_data->IsNull()) {
- const intptr_t token_pos = iter.TokenPos();
+ const TokenDescriptor token_pos = TokenDescriptor(iter.TokenPos());
// Filter out descriptors that do not map to tokens in the source code.
if ((token_pos < begin_pos) || (token_pos > end_pos)) {
continue;
}
if (as_call_sites) {
bool is_static_call = iter.Kind() == RawPcDescriptors::kUnoptStaticCall;
- ic_data->PrintToJSONArray(hits_or_sites, token_pos, is_static_call);
+ ic_data->PrintToJSONArray(hits_or_sites,
+ token_pos,
+ is_static_call);
} else {
- intptr_t line = pos_to_line[token_pos];
+ intptr_t line = pos_to_line[token_pos.value()];
#if defined(DEBUG)
const Script& script = Script::Handle(zone, function.script());
intptr_t test_line = -1;

Powered by Google App Engine
This is Rietveld 408576698