OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 OS::Print("%s\n", ToCString()); | 1542 OS::Print("%s\n", ToCString()); |
1543 } | 1543 } |
1544 | 1544 |
1545 | 1545 |
1546 void Object::PrintJSON(JSONStream* stream, bool ref) const { | 1546 void Object::PrintJSON(JSONStream* stream, bool ref) const { |
1547 if (IsNull()) { | 1547 if (IsNull()) { |
1548 JSONObject jsobj(stream); | 1548 JSONObject jsobj(stream); |
1549 jsobj.AddProperty("type", ref ? "@Null" : "Null"); | 1549 jsobj.AddProperty("type", ref ? "@Null" : "Null"); |
1550 jsobj.AddProperty("id", "objects/null"); | 1550 jsobj.AddProperty("id", "objects/null"); |
1551 jsobj.AddProperty("valueAsString", "null"); | 1551 jsobj.AddProperty("valueAsString", "null"); |
| 1552 if (!ref) { |
| 1553 const Class& cls = Class::Handle(this->clazz()); |
| 1554 jsobj.AddProperty("class", cls); |
| 1555 jsobj.AddProperty("size", raw()->Size()); |
| 1556 } |
1552 } else { | 1557 } else { |
1553 PrintJSONImpl(stream, ref); | 1558 PrintJSONImpl(stream, ref); |
1554 } | 1559 } |
1555 } | 1560 } |
1556 | 1561 |
1557 | 1562 |
1558 RawString* Object::DictionaryName() const { | 1563 RawString* Object::DictionaryName() const { |
1559 return String::null(); | 1564 return String::null(); |
1560 } | 1565 } |
1561 | 1566 |
(...skipping 18011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19573 return tag_label.ToCString(); | 19578 return tag_label.ToCString(); |
19574 } | 19579 } |
19575 | 19580 |
19576 | 19581 |
19577 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 19582 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
19578 Instance::PrintJSONImpl(stream, ref); | 19583 Instance::PrintJSONImpl(stream, ref); |
19579 } | 19584 } |
19580 | 19585 |
19581 | 19586 |
19582 } // namespace dart | 19587 } // namespace dart |
OLD | NEW |