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

Unified Diff: runtime/vm/object.cc

Issue 1150303004: Switch to using SourceLocation universally in service protocol. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: post merge Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/message.cc ('k') | runtime/vm/service/service.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 5ae1fce2e3818488f3e0a6e6322ca7ad50346cc7..6629bf1b74928035c3c638e1d2371b1dc4d1725a 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -4141,9 +4141,7 @@ void Class::PrintJSONImpl(JSONStream* stream, bool ref) const {
jsobj.AddProperty("library", Object::Handle(library()));
const Script& script = Script::Handle(this->script());
if (!script.IsNull()) {
- jsobj.AddProperty("script", script);
- jsobj.AddProperty("tokenPos", token_pos());
- jsobj.AddProperty("endTokenPos", ComputeEndTokenPos());
+ jsobj.AddLocation(script, token_pos(), ComputeEndTokenPos());
}
{
JSONArray interfaces_array(&jsobj, "interfaces");
@@ -6930,9 +6928,7 @@ void Function::PrintJSONImpl(JSONStream* stream, bool ref) const {
const Script& script = Script::Handle(this->script());
if (!script.IsNull()) {
- jsobj.AddProperty("script", script);
- jsobj.AddProperty("tokenPos", token_pos());
- jsobj.AddProperty("endTokenPos", end_token_pos());
+ jsobj.AddLocation(script, token_pos(), end_token_pos());
}
}
@@ -7287,8 +7283,7 @@ void Field::PrintJSONImpl(JSONStream* stream, bool ref) const {
const Class& origin_cls = Class::Handle(origin());
const Script& script = Script::Handle(origin_cls.script());
if (!script.IsNull()) {
- jsobj.AddProperty("script", script);
- jsobj.AddProperty("tokenPos", token_pos());
+ jsobj.AddLocation(script, token_pos());
}
}
@@ -10788,6 +10783,7 @@ void PcDescriptors::PrintToJSONObject(JSONObject* jsobj, bool ref) const {
descriptor.AddPropertyF("pcOffset", "%" Px "", iter.PcOffset());
descriptor.AddProperty("kind", KindAsStr(iter.Kind()));
descriptor.AddProperty("deoptId", iter.DeoptId());
+ // TODO(turnidge): Use AddLocation instead.
descriptor.AddProperty("tokenPos", iter.TokenPos());
descriptor.AddProperty("tryIndex", iter.TryIndex());
}
@@ -12001,6 +11997,7 @@ void ICData::PrintToJSONArray(const JSONArray& jsarray,
JSONObject jsobj(&jsarray);
jsobj.AddProperty("name", String::Handle(target_name()).ToCString());
+ // TODO(turnidge): Use AddLocation instead.
jsobj.AddProperty("tokenPos", token_pos);
// TODO(rmacnak): Figure out how to stringify DeoptReasons().
// jsobj.AddProperty("deoptReasons", ...);
« no previous file with comments | « runtime/vm/message.cc ('k') | runtime/vm/service/service.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698