| 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 14128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14139 } | 14139 } |
| 14140 } | 14140 } |
| 14141 | 14141 |
| 14142 | 14142 |
| 14143 void Instance::PrintJSONImpl(JSONStream* stream, bool ref) const { | 14143 void Instance::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 14144 JSONObject jsobj(stream); | 14144 JSONObject jsobj(stream); |
| 14145 | 14145 |
| 14146 // Handle certain special instance values. | 14146 // Handle certain special instance values. |
| 14147 if (raw() == Object::sentinel().raw()) { | 14147 if (raw() == Object::sentinel().raw()) { |
| 14148 jsobj.AddProperty("type", "Sentinel"); | 14148 jsobj.AddProperty("type", "Sentinel"); |
| 14149 jsobj.AddFixedServiceId("objects/not-initialized"); | 14149 jsobj.AddProperty("kind", "NotInitialized"); |
| 14150 jsobj.AddProperty("valueAsString", "<not initialized>"); | 14150 jsobj.AddProperty("valueAsString", "<not initialized>"); |
| 14151 return; | 14151 return; |
| 14152 } else if (raw() == Object::transition_sentinel().raw()) { | 14152 } else if (raw() == Object::transition_sentinel().raw()) { |
| 14153 jsobj.AddProperty("type", "Sentinel"); | 14153 jsobj.AddProperty("type", "Sentinel"); |
| 14154 jsobj.AddFixedServiceId("objects/being-initialized"); | 14154 jsobj.AddProperty("kind", "BeingInitialized"); |
| 14155 jsobj.AddProperty("valueAsString", "<being initialized>"); | 14155 jsobj.AddProperty("valueAsString", "<being initialized>"); |
| 14156 return; | 14156 return; |
| 14157 } | 14157 } |
| 14158 | 14158 |
| 14159 AddTypeProperties(&jsobj, "Instance", JSONType(), ref); | 14159 AddTypeProperties(&jsobj, "Instance", JSONType(), ref); |
| 14160 PrintSharedInstanceJSON(&jsobj, ref); | 14160 PrintSharedInstanceJSON(&jsobj, ref); |
| 14161 jsobj.AddServiceId(*this); | 14161 jsobj.AddServiceId(*this); |
| 14162 if (IsClosure()) { | 14162 if (IsClosure()) { |
| 14163 jsobj.AddProperty("function", Function::Handle(Closure::function(*this))); | 14163 jsobj.AddProperty("function", Function::Handle(Closure::function(*this))); |
| 14164 jsobj.AddProperty("context", Context::Handle(Closure::context(*this))); | 14164 jsobj.AddProperty("context", Context::Handle(Closure::context(*this))); |
| (...skipping 4095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18260 } | 18260 } |
| 18261 | 18261 |
| 18262 | 18262 |
| 18263 void String::PrintJSONImpl(JSONStream* stream, bool ref) const { | 18263 void String::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 18264 JSONObject jsobj(stream); | 18264 JSONObject jsobj(stream); |
| 18265 if (raw() == Symbols::OptimizedOut().raw()) { | 18265 if (raw() == Symbols::OptimizedOut().raw()) { |
| 18266 // TODO(turnidge): This is a hack. The user could have this | 18266 // TODO(turnidge): This is a hack. The user could have this |
| 18267 // special string in their program. Fixing this involves updating | 18267 // special string in their program. Fixing this involves updating |
| 18268 // the debugging api a bit. | 18268 // the debugging api a bit. |
| 18269 jsobj.AddProperty("type", "Sentinel"); | 18269 jsobj.AddProperty("type", "Sentinel"); |
| 18270 jsobj.AddFixedServiceId("objects/optimized-out"); | 18270 jsobj.AddProperty("kind", "OptimizedOut"); |
| 18271 jsobj.AddProperty("valueAsString", "<optimized out>"); | 18271 jsobj.AddProperty("valueAsString", "<optimized out>"); |
| 18272 return; | 18272 return; |
| 18273 } | 18273 } |
| 18274 AddTypeProperties(&jsobj, "String", JSONType(), ref); | 18274 AddTypeProperties(&jsobj, "String", JSONType(), ref); |
| 18275 PrintSharedInstanceJSON(&jsobj, ref); | 18275 PrintSharedInstanceJSON(&jsobj, ref); |
| 18276 jsobj.AddServiceId(*this); | 18276 jsobj.AddServiceId(*this); |
| 18277 if (ref) { | 18277 if (ref) { |
| 18278 bool did_truncate = jsobj.AddPropertyStr("valueAsString", *this, 128); | 18278 bool did_truncate = jsobj.AddPropertyStr("valueAsString", *this, 128); |
| 18279 if (did_truncate) { | 18279 if (did_truncate) { |
| 18280 jsobj.AddProperty("valueAsStringIsTruncated", did_truncate); | 18280 jsobj.AddProperty("valueAsStringIsTruncated", did_truncate); |
| (...skipping 2458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20739 return tag_label.ToCString(); | 20739 return tag_label.ToCString(); |
| 20740 } | 20740 } |
| 20741 | 20741 |
| 20742 | 20742 |
| 20743 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20743 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 20744 Instance::PrintJSONImpl(stream, ref); | 20744 Instance::PrintJSONImpl(stream, ref); |
| 20745 } | 20745 } |
| 20746 | 20746 |
| 20747 | 20747 |
| 20748 } // namespace dart | 20748 } // namespace dart |
| OLD | NEW |