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

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
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/megamorphic_cache_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/json_stream.cc
diff --git a/runtime/vm/json_stream.cc b/runtime/vm/json_stream.cc
index 4d2f27bea542c4c3ee6ef2dfabb4c5e83be3ce95..6a2694a94e4d824d4fbaa975b2c7c5767e68af91 100644
--- a/runtime/vm/json_stream.cc
+++ b/runtime/vm/json_stream.cc
@@ -444,6 +444,12 @@ void JSONStream::PrintValue(Breakpoint* bpt) {
}
+void JSONStream::PrintValue(TokenPosition tp) {
+ PrintCommaIfNeeded();
+ PrintValue(tp.value());
+}
+
+
void JSONStream::PrintValue(const ServiceEvent* event) {
PrintCommaIfNeeded();
event->PrintJSON(this);
@@ -561,6 +567,12 @@ void JSONStream::PrintProperty(const char* name, Breakpoint* bpt) {
}
+void JSONStream::PrintProperty(const char* name, TokenPosition tp) {
+ PrintPropertyName(name);
+ PrintValue(tp);
+}
+
+
void JSONStream::PrintProperty(const char* name, Metric* metric) {
PrintPropertyName(name);
PrintValue(metric);
@@ -753,13 +765,13 @@ void JSONObject::AddFixedServiceId(const char* format, ...) const {
void JSONObject::AddLocation(const Script& script,
- intptr_t token_pos,
- intptr_t end_token_pos) const {
+ TokenPosition token_pos,
+ TokenPosition 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) {
+ if (end_token_pos.IsReal()) {
location.AddProperty("endTokenPos", end_token_pos);
}
}
@@ -771,7 +783,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;
+ TokenPosition token_pos = TokenPosition::kNoSource;
bpt_loc->GetCodeLocation(&library, &script, &token_pos);
AddLocation(script, token_pos);
}
@@ -784,7 +796,7 @@ void JSONObject::AddUnresolvedLocation(
Zone* zone = Thread::Current()->zone();
Library& library = Library::Handle(zone);
Script& script = Script::Handle(zone);
- intptr_t token_pos;
+ TokenPosition token_pos = TokenPosition::kNoSource;
bpt_loc->GetCodeLocation(&library, &script, &token_pos);
JSONObject location(this, "location");
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/megamorphic_cache_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698