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

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

Issue 183023011: Use HasResolvedTypeClass to avoid crash in Field::PrintToJSONStream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6379 matching lines...) Expand 10 before | Expand all | Expand 10 after
6390 jsobj.AddProperty("type", JSONType(ref)); 6390 jsobj.AddProperty("type", JSONType(ref));
6391 jsobj.AddPropertyF("id", "classes/%" Pd "/fields/%" Pd "", cid, id); 6391 jsobj.AddPropertyF("id", "classes/%" Pd "/fields/%" Pd "", cid, id);
6392 jsobj.AddProperty("name", internal_field_name); 6392 jsobj.AddProperty("name", internal_field_name);
6393 jsobj.AddProperty("user_name", field_name); 6393 jsobj.AddProperty("user_name", field_name);
6394 if (is_static()) { 6394 if (is_static()) {
6395 const Instance& valueObj = Instance::Handle(value()); 6395 const Instance& valueObj = Instance::Handle(value());
6396 jsobj.AddProperty("value", valueObj); 6396 jsobj.AddProperty("value", valueObj);
6397 } 6397 }
6398 6398
6399 jsobj.AddProperty("owner", cls); 6399 jsobj.AddProperty("owner", cls);
6400
6401 // TODO(turnidge): Once the vmservice supports returning types,
6402 // return the type here instead of the class.
6400 AbstractType& declared_type = AbstractType::Handle(type()); 6403 AbstractType& declared_type = AbstractType::Handle(type());
6401 cls = declared_type.type_class(); 6404 if (declared_type.HasResolvedTypeClass()) {
6402 jsobj.AddProperty("declared_type", cls); 6405 cls = declared_type.type_class();
6406 jsobj.AddProperty("declared_type", cls);
6407 }
6408
6403 jsobj.AddProperty("static", is_static()); 6409 jsobj.AddProperty("static", is_static());
6404 jsobj.AddProperty("final", is_final()); 6410 jsobj.AddProperty("final", is_final());
6405 jsobj.AddProperty("const", is_const()); 6411 jsobj.AddProperty("const", is_const());
6406 if (ref) { 6412 if (ref) {
6407 return; 6413 return;
6408 } 6414 }
6409 jsobj.AddProperty("guard_nullable", is_nullable()); 6415 jsobj.AddProperty("guard_nullable", is_nullable());
6410 if (guarded_cid() == kIllegalCid) { 6416 if (guarded_cid() == kIllegalCid) {
6411 jsobj.AddProperty("guard_class", "unknown"); 6417 jsobj.AddProperty("guard_class", "unknown");
6412 } else if (guarded_cid() == kDynamicCid) { 6418 } else if (guarded_cid() == kDynamicCid) {
(...skipping 11085 matching lines...) Expand 10 before | Expand all | Expand 10 after
17498 return "_MirrorReference"; 17504 return "_MirrorReference";
17499 } 17505 }
17500 17506
17501 17507
17502 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 17508 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
17503 Instance::PrintToJSONStream(stream, ref); 17509 Instance::PrintToJSONStream(stream, ref);
17504 } 17510 }
17505 17511
17506 17512
17507 } // namespace dart 17513 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698