OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import 'dart:html'; | 5 import 'dart:html'; |
6 import 'package:observatory/models.dart' as M; | 6 import 'package:observatory/models.dart' as M; |
7 import 'package:observatory/src/elements/class_ref.dart'; | 7 import 'package:observatory/src/elements/class_ref.dart'; |
8 import 'package:observatory/src/elements/code_ref.dart'; | 8 import 'package:observatory/src/elements/code_ref.dart'; |
9 import 'package:observatory/src/elements/context_ref.dart'; | 9 import 'package:observatory/src/elements/context_ref.dart'; |
10 import 'package:observatory/src/elements/error_ref.dart'; | 10 import 'package:observatory/src/elements/error_ref.dart'; |
(...skipping 11 matching lines...) Expand all Loading... |
22 import 'package:observatory/src/elements/script_ref.dart'; | 22 import 'package:observatory/src/elements/script_ref.dart'; |
23 import 'package:observatory/src/elements/sentinel_value.dart'; | 23 import 'package:observatory/src/elements/sentinel_value.dart'; |
24 import 'package:observatory/src/elements/singletargetcache_ref.dart'; | 24 import 'package:observatory/src/elements/singletargetcache_ref.dart'; |
25 import 'package:observatory/src/elements/subtypetestcache_ref.dart'; | 25 import 'package:observatory/src/elements/subtypetestcache_ref.dart'; |
26 import 'package:observatory/src/elements/token_stream_ref.dart'; | 26 import 'package:observatory/src/elements/token_stream_ref.dart'; |
27 import 'package:observatory/src/elements/type_arguments_ref.dart'; | 27 import 'package:observatory/src/elements/type_arguments_ref.dart'; |
28 import 'package:observatory/src/elements/unknown_ref.dart'; | 28 import 'package:observatory/src/elements/unknown_ref.dart'; |
29 import 'package:observatory/src/elements/unlinkedcall_ref.dart'; | 29 import 'package:observatory/src/elements/unlinkedcall_ref.dart'; |
30 | 30 |
31 Element anyRef(M.IsolateRef isolate, ref, M.ObjectRepository objects, | 31 Element anyRef(M.IsolateRef isolate, ref, M.ObjectRepository objects, |
32 {RenderingQueue queue}) { | 32 {RenderingQueue queue, bool expandable: true}) { |
33 if (ref is M.Guarded) { | 33 if (ref is M.Guarded) { |
34 if (ref.isSentinel) { | 34 if (ref.isSentinel) { |
35 return anyRef(isolate, ref.asSentinel, objects, queue: queue); | 35 return anyRef(isolate, ref.asSentinel, objects, |
| 36 queue: queue, expandable: expandable); |
36 } else { | 37 } else { |
37 return anyRef(isolate, ref.asValue, objects, queue: queue); | 38 return anyRef(isolate, ref.asValue, objects, |
| 39 queue: queue, expandable: expandable); |
38 } | 40 } |
39 } else if (ref is M.ObjectRef) { | 41 } else if (ref is M.ObjectRef) { |
40 if (ref is M.ClassRef) { | 42 if (ref is M.ClassRef) { |
41 return new ClassRefElement(isolate, ref, queue: queue); | 43 return new ClassRefElement(isolate, ref, queue: queue); |
42 } else if (ref is M.CodeRef) { | 44 } else if (ref is M.CodeRef) { |
43 return new CodeRefElement(isolate, ref, queue: queue); | 45 return new CodeRefElement(isolate, ref, queue: queue); |
44 } else if (ref is M.ContextRef) { | 46 } else if (ref is M.ContextRef) { |
45 return new ContextRefElement(isolate, ref, objects, queue: queue); | 47 return new ContextRefElement(isolate, ref, objects, |
| 48 queue: queue, expandable: expandable); |
46 } else if (ref is M.Error) { | 49 } else if (ref is M.Error) { |
47 return new ErrorRefElement(ref, queue: queue); | 50 return new ErrorRefElement(ref, queue: queue); |
48 } else if (ref is M.FieldRef) { | 51 } else if (ref is M.FieldRef) { |
49 return new FieldRefElement(isolate, ref, objects, queue: queue); | 52 return new FieldRefElement(isolate, ref, objects, |
| 53 queue: queue, expandable: expandable); |
50 } else if (ref is M.FunctionRef) { | 54 } else if (ref is M.FunctionRef) { |
51 return new FunctionRefElement(isolate, ref, queue: queue); | 55 return new FunctionRefElement(isolate, ref, queue: queue); |
52 } else if (ref is M.ICDataRef) { | 56 } else if (ref is M.ICDataRef) { |
53 return new ICDataRefElement(isolate, ref, queue: queue); | 57 return new ICDataRefElement(isolate, ref, queue: queue); |
54 } else if (ref is M.InstanceRef) { | 58 } else if (ref is M.InstanceRef) { |
55 return new InstanceRefElement(isolate, ref, objects, queue: queue); | 59 return new InstanceRefElement(isolate, ref, objects, |
| 60 queue: queue, expandable: expandable); |
56 } else if (ref is M.LibraryRef) { | 61 } else if (ref is M.LibraryRef) { |
57 return new LibraryRefElement(isolate, ref, queue: queue); | 62 return new LibraryRefElement(isolate, ref, queue: queue); |
58 } else if (ref is M.LocalVarDescriptorsRef) { | 63 } else if (ref is M.LocalVarDescriptorsRef) { |
59 return new LocalVarDescriptorsRefElement(isolate, ref, queue: queue); | 64 return new LocalVarDescriptorsRefElement(isolate, ref, queue: queue); |
60 } else if (ref is M.MegamorphicCacheRef) { | 65 } else if (ref is M.MegamorphicCacheRef) { |
61 return new MegamorphicCacheRefElement(isolate, ref, queue: queue); | 66 return new MegamorphicCacheRefElement(isolate, ref, queue: queue); |
62 } else if (ref is M.ObjectPoolRef) { | 67 } else if (ref is M.ObjectPoolRef) { |
63 return new ObjectPoolRefElement(isolate, ref, queue: queue); | 68 return new ObjectPoolRefElement(isolate, ref, queue: queue); |
64 } else if (ref is M.PcDescriptorsRef) { | 69 } else if (ref is M.PcDescriptorsRef) { |
65 return new PcDescriptorsRefElement(isolate, ref, queue: queue); | 70 return new PcDescriptorsRefElement(isolate, ref, queue: queue); |
(...skipping 13 matching lines...) Expand all Loading... |
79 return new UnlinkedCallRefElement(isolate, ref, queue: queue); | 84 return new UnlinkedCallRefElement(isolate, ref, queue: queue); |
80 } else { | 85 } else { |
81 return new AnchorElement(href: Uris.inspect(isolate, object: ref)) | 86 return new AnchorElement(href: Uris.inspect(isolate, object: ref)) |
82 ..text = 'object'; | 87 ..text = 'object'; |
83 } | 88 } |
84 } else if (ref is M.Sentinel) { | 89 } else if (ref is M.Sentinel) { |
85 return new SentinelValueElement(ref, queue: queue); | 90 return new SentinelValueElement(ref, queue: queue); |
86 } | 91 } |
87 throw new Exception('Unknown ref type (${ref.runtimeType})'); | 92 throw new Exception('Unknown ref type (${ref.runtimeType})'); |
88 } | 93 } |
OLD | NEW |