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

Unified Diff: runtime/vm/json_stream.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/json_stream.cc
diff --git a/runtime/vm/json_stream.cc b/runtime/vm/json_stream.cc
index 4851875703cd3b4c12c6e552b63d2a039c1169fc..ddc760ca5c7b1ef671b27cd5a87ae9b00f1233b8 100644
--- a/runtime/vm/json_stream.cc
+++ b/runtime/vm/json_stream.cc
@@ -749,14 +749,14 @@ void JSONObject::AddFixedServiceId(const char* format, ...) const {
void JSONObject::AddLocation(const Script& script,
- intptr_t token_pos,
- intptr_t end_token_pos) const {
+ TokenDescriptor token_pos,
+ TokenDescriptor end_token_pos) const {
JSONObject location(this, "location");
location.AddProperty("type", "SourceLocation");
location.AddProperty("script", script);
- location.AddProperty("tokenPos", token_pos);
- if (end_token_pos >= 0) {
- location.AddProperty("endTokenPos", end_token_pos);
+ location.AddProperty("tokenPos", token_pos.value());
+ if (end_token_pos.IsReal()) {
+ location.AddProperty("endTokenPos", end_token_pos.value());
}
}
@@ -767,7 +767,7 @@ void JSONObject::AddLocation(const BreakpointLocation* bpt_loc) const {
Zone* zone = Thread::Current()->zone();
Library& library = Library::Handle(zone);
Script& script = Script::Handle(zone);
- intptr_t token_pos;
+ TokenDescriptor token_pos = TokenDescriptor::kNoSource;
bpt_loc->GetCodeLocation(&library, &script, &token_pos);
AddLocation(script, token_pos);
}
@@ -780,7 +780,7 @@ void JSONObject::AddUnresolvedLocation(
Zone* zone = Thread::Current()->zone();
Library& library = Library::Handle(zone);
Script& script = Script::Handle(zone);
- intptr_t token_pos;
+ TokenDescriptor token_pos = TokenDescriptor::kNoSource;
bpt_loc->GetCodeLocation(&library, &script, &token_pos);
JSONObject location(this, "location");
@@ -800,7 +800,7 @@ void JSONObject::AddUnresolvedLocation(
}
} else {
// This unresolved breakpoint was requested at some function entry.
- location.AddProperty("tokenPos", token_pos);
+ location.AddProperty("tokenPos", token_pos.value());
}
}

Powered by Google App Engine
This is Rietveld 408576698