OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/debugger.h" | 5 #include "vm/debugger.h" |
6 #include "vm/disassembler.h" | 6 #include "vm/disassembler.h" |
7 #include "vm/object.h" | 7 #include "vm/object.h" |
8 #include "vm/object_store.h" | 8 #include "vm/object_store.h" |
9 #include "vm/stub_code.h" | 9 #include "vm/stub_code.h" |
10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 if (ref) { | 1137 if (ref) { |
1138 return; | 1138 return; |
1139 } | 1139 } |
1140 const TypeArguments& typeArgs = TypeArguments::Handle(arguments()); | 1140 const TypeArguments& typeArgs = TypeArguments::Handle(arguments()); |
1141 if (!typeArgs.IsNull()) { | 1141 if (!typeArgs.IsNull()) { |
1142 jsobj.AddProperty("typeArguments", typeArgs); | 1142 jsobj.AddProperty("typeArguments", typeArgs); |
1143 } | 1143 } |
1144 } | 1144 } |
1145 | 1145 |
1146 | 1146 |
1147 void FunctionType::PrintJSONImpl(JSONStream* stream, bool ref) const { | |
1148 JSONObject jsobj(stream); | |
1149 PrintSharedInstanceJSON(&jsobj, ref); | |
1150 jsobj.AddProperty("kind", "FunctionType"); | |
1151 if (IsCanonical()) { | |
1152 const Class& scope_cls = Class::Handle(scope_class()); | |
1153 intptr_t id = scope_cls.FindCanonicalTypeIndex(*this); | |
1154 ASSERT(id >= 0); | |
1155 intptr_t cid = scope_cls.id(); | |
1156 jsobj.AddFixedServiceId("classes/%" Pd "/types/%" Pd "", cid, id); | |
1157 jsobj.AddProperty("scopeClass", scope_cls); | |
1158 } else { | |
1159 jsobj.AddServiceId(*this); | |
1160 } | |
1161 const String& user_name = String::Handle(UserVisibleName()); | |
1162 const String& vm_name = String::Handle(Name()); | |
1163 AddNameProperties(&jsobj, user_name, vm_name); | |
1164 if (ref) { | |
1165 return; | |
1166 } | |
1167 const TypeArguments& typeArgs = TypeArguments::Handle(arguments()); | |
1168 if (!typeArgs.IsNull()) { | |
1169 jsobj.AddProperty("typeArguments", typeArgs); | |
1170 } | |
1171 } | |
1172 | |
1173 | |
1174 void TypeRef::PrintJSONImpl(JSONStream* stream, bool ref) const { | 1147 void TypeRef::PrintJSONImpl(JSONStream* stream, bool ref) const { |
1175 JSONObject jsobj(stream); | 1148 JSONObject jsobj(stream); |
1176 PrintSharedInstanceJSON(&jsobj, ref); | 1149 PrintSharedInstanceJSON(&jsobj, ref); |
1177 jsobj.AddProperty("kind", "TypeRef"); | 1150 jsobj.AddProperty("kind", "TypeRef"); |
1178 jsobj.AddServiceId(*this); | 1151 jsobj.AddServiceId(*this); |
1179 const String& user_name = String::Handle(UserVisibleName()); | 1152 const String& user_name = String::Handle(UserVisibleName()); |
1180 const String& vm_name = String::Handle(Name()); | 1153 const String& vm_name = String::Handle(Name()); |
1181 AddNameProperties(&jsobj, user_name, vm_name); | 1154 AddNameProperties(&jsobj, user_name, vm_name); |
1182 if (ref) { | 1155 if (ref) { |
1183 return; | 1156 return; |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1602 jsobj.AddProperty("mirrorReferent", referent_handle); | 1575 jsobj.AddProperty("mirrorReferent", referent_handle); |
1603 } | 1576 } |
1604 | 1577 |
1605 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 1578 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
1606 Instance::PrintJSONImpl(stream, ref); | 1579 Instance::PrintJSONImpl(stream, ref); |
1607 } | 1580 } |
1608 | 1581 |
1609 #endif | 1582 #endif |
1610 | 1583 |
1611 } // namespace dart | 1584 } // namespace dart |
OLD | NEW |