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

Side by Side Diff: runtime/vm/object_service.cc

Issue 2592263004: Fix resolution and canonicalization of typedefs and function types in (Closed)
Patch Set: work in progress Created 3 years, 12 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 unified diff | Download patch
OLDNEW
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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 return; 271 return;
272 } 272 }
273 // Oddball functions (not known to their owner) fall back to use the object 273 // Oddball functions (not known to their owner) fall back to use the object
274 // id ring. Current known examples are signature functions of closures 274 // id ring. Current known examples are signature functions of closures
275 // and stubs like 'megamorphic_miss'. 275 // and stubs like 'megamorphic_miss'.
276 jsobj.AddServiceId(f); 276 jsobj.AddServiceId(f);
277 } 277 }
278 278
279 279
280 void Function::PrintJSONImpl(JSONStream* stream, bool ref) const { 280 void Function::PrintJSONImpl(JSONStream* stream, bool ref) const {
281 // TODO(regis): Handle signature functions separately.
281 Class& cls = Class::Handle(Owner()); 282 Class& cls = Class::Handle(Owner());
282 ASSERT(!cls.IsNull()); 283 ASSERT(!cls.IsNull());
283 Error& err = Error::Handle(); 284 Error& err = Error::Handle();
284 err ^= cls.EnsureIsFinalized(Thread::Current()); 285 err ^= cls.EnsureIsFinalized(Thread::Current());
285 ASSERT(err.IsNull()); 286 ASSERT(err.IsNull());
286 JSONObject jsobj(stream); 287 JSONObject jsobj(stream);
287 AddCommonObjectProperties(&jsobj, "Function", ref); 288 AddCommonObjectProperties(&jsobj, "Function", ref);
288 AddFunctionServiceId(jsobj, *this, cls); 289 AddFunctionServiceId(jsobj, *this, cls);
289 const String& user_name = String::Handle(UserVisibleName()); 290 const String& user_name = String::Handle(UserVisibleName());
290 const String& vm_name = String::Handle(name()); 291 const String& vm_name = String::Handle(name());
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 } 1093 }
1093 } 1094 }
1094 1095
1095 1096
1096 void AbstractType::PrintJSONImpl(JSONStream* stream, bool ref) const { 1097 void AbstractType::PrintJSONImpl(JSONStream* stream, bool ref) const {
1097 UNREACHABLE(); 1098 UNREACHABLE();
1098 } 1099 }
1099 1100
1100 1101
1101 void Type::PrintJSONImpl(JSONStream* stream, bool ref) const { 1102 void Type::PrintJSONImpl(JSONStream* stream, bool ref) const {
1103 // TODO(regis): Function types are not handled properly.
1102 JSONObject jsobj(stream); 1104 JSONObject jsobj(stream);
1103 PrintSharedInstanceJSON(&jsobj, ref); 1105 PrintSharedInstanceJSON(&jsobj, ref);
1104 jsobj.AddProperty("kind", "Type"); 1106 jsobj.AddProperty("kind", "Type");
1105 if (HasResolvedTypeClass()) { 1107 if (HasResolvedTypeClass()) {
1106 const Class& type_cls = Class::Handle(type_class()); 1108 const Class& type_cls = Class::Handle(type_class());
1107 if (type_cls.CanonicalType() == raw()) { 1109 if (type_cls.CanonicalType() == raw()) {
1108 intptr_t cid = type_cls.id(); 1110 intptr_t cid = type_cls.id();
1109 jsobj.AddFixedServiceId("classes/%" Pd "/types/%d", cid, 0); 1111 jsobj.AddFixedServiceId("classes/%" Pd "/types/%d", cid, 0);
1110 } else { 1112 } else {
1111 jsobj.AddServiceId(*this); 1113 jsobj.AddServiceId(*this);
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 jsobj.AddProperty("mirrorReferent", referent_handle); 1581 jsobj.AddProperty("mirrorReferent", referent_handle);
1580 } 1582 }
1581 1583
1582 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 1584 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
1583 Instance::PrintJSONImpl(stream, ref); 1585 Instance::PrintJSONImpl(stream, ref);
1584 } 1586 }
1585 1587
1586 #endif 1588 #endif
1587 1589
1588 } // namespace dart 1590 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698