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

Side by Side Diff: runtime/observatory/lib/src/models/objects/instance.dart

Issue 2291233002: Converted Observatory instance-view element (Closed)
Patch Set: Addressed comments Created 4 years, 3 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 part of models; 5 part of models;
6 6
7 enum InstanceKind { 7 enum InstanceKind {
8 /// A general instance of the Dart class Object. 8 /// A general instance of the Dart class Object.
9 plainInstance, 9 plainInstance,
10 /// null instance. 10 /// null instance.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 switch (kind) { 118 switch (kind) {
119 case InstanceKind.float32x4: 119 case InstanceKind.float32x4:
120 case InstanceKind.float64x2: 120 case InstanceKind.float64x2:
121 case InstanceKind.int32x4: 121 case InstanceKind.int32x4:
122 return true; 122 return true;
123 default: 123 default:
124 return false; 124 return false;
125 } 125 }
126 } 126 }
127 127
128 bool isAbstractType(InstanceKind kind) {
129 switch (kind) {
130 case InstanceKind.type:
131 case InstanceKind.typeRef:
132 case InstanceKind.typeParameter:
133 case InstanceKind.boundedType:
134 return true;
135 default:
136 return false;
137 }
138 }
139
128 abstract class InstanceRef extends ObjectRef { 140 abstract class InstanceRef extends ObjectRef {
129 /// What kind of instance is this? 141 /// What kind of instance is this?
130 InstanceKind get kind; 142 InstanceKind get kind;
131 143
132 /// Instance references always include their class. 144 /// Instance references always include their class.
133 ClassRef get clazz; 145 ClassRef get clazz;
134 146
135 /// [optional] The value of this instance as a string. 147 /// [optional] The value of this instance as a string.
136 /// 148 ///
137 /// Provided for the instance kinds: 149 /// Provided for the instance kinds:
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 /// 211 ///
200 /// Provided for instance kinds: 212 /// Provided for instance kinds:
201 /// RegExp 213 /// RegExp
202 InstanceRef get pattern; 214 InstanceRef get pattern;
203 215
204 /// [optional] The function associated with a Closure instance. 216 /// [optional] The function associated with a Closure instance.
205 /// 217 ///
206 /// Provided for instance kinds: 218 /// Provided for instance kinds:
207 /// Closure 219 /// Closure
208 FunctionRef get closureFunction; 220 FunctionRef get closureFunction;
221
222 /// [optional] The context associated with a Closure instance.
223 ///
224 /// Provided for instance kinds:
225 /// Closure
226 ContextRef get closureContext;
209 } 227 }
210 228
211 abstract class Instance extends Object implements InstanceRef { 229 abstract class Instance extends Object implements InstanceRef {
212 /// [optional] The index of the first element or association or codeunit 230 /// [optional] The index of the first element or association or codeunit
213 /// returned. This is only provided when it is non-zero. 231 /// returned. This is only provided when it is non-zero.
214 /// 232 ///
215 /// Provided for instance kinds: 233 /// Provided for instance kinds:
216 /// String 234 /// String
217 /// List 235 /// List
218 /// Map 236 /// Map
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 /// Int16List 285 /// Int16List
268 /// Int32List 286 /// Int32List
269 /// Int64List 287 /// Int64List
270 /// Float32List 288 /// Float32List
271 /// Float64List 289 /// Float64List
272 /// Int32x4List 290 /// Int32x4List
273 /// Float32x4List 291 /// Float32x4List
274 /// Float64x2List 292 /// Float64x2List
275 Iterable<dynamic> get typedElements; 293 Iterable<dynamic> get typedElements;
276 294
277 /// [optional]The fields of this Instance. 295 /// [optional] The native fields of this Instance.
296 Iterable<NativeField> get nativeFields;
297
298 /// [optional] The fields of this Instance.
278 Iterable<BoundField> get fields; 299 Iterable<BoundField> get fields;
279 300
280 /// [optional] The elements of a List instance. 301 /// [optional] The elements of a List instance.
281 /// 302 ///
282 /// Provided for instance kinds: 303 /// Provided for instance kinds:
283 /// List 304 /// List
284 Iterable<Guarded<ObjectRef>> get elements; 305 Iterable<Guarded<ObjectRef>> get elements;
285 // It should be: 306 // It should be:
286 // Iterable<Guarded<InstanceRef>> get elements; 307 // Iterable<Guarded<InstanceRef>> get elements;
287 // In some situations we obtain lists of non Instances 308 // In some situations we obtain lists of non Instances
(...skipping 14 matching lines...) Expand all
302 /// 323 ///
303 /// Provided for instance kinds: 324 /// Provided for instance kinds:
304 /// WeakProperty 325 /// WeakProperty
305 InstanceRef get value; 326 InstanceRef get value;
306 327
307 /// [optional] The referent of a MirrorReference instance. 328 /// [optional] The referent of a MirrorReference instance.
308 /// 329 ///
309 /// Provided for instance kinds: 330 /// Provided for instance kinds:
310 /// MirrorReference 331 /// MirrorReference
311 ObjectRef get referent; 332 ObjectRef get referent;
333
334 /// [optional] The type arguments for this type.
335 ///
336 /// Provided for instance kinds:
337 /// Type
338 TypeArgumentsRef get typeArguments;
339
340 /// [optional] The index of a TypeParameter instance.
341 ///
342 /// Provided for instance kinds:
343 /// TypeParameter
344 int get parameterIndex;
345
346 /// [optional] The type bounded by a BoundedType instance
347 /// - or -
348 /// the referent of a TypeRef instance.
349 ///
350 /// The value will always be of one of the kinds:
351 /// Type, TypeRef, TypeParameter, BoundedType.
352 ///
353 /// Provided for instance kinds:
354 /// BoundedType
355 /// TypeRef
356 InstanceRef get targetType;
357
358 /// [optional] The bound of a TypeParameter or BoundedType.
359 ///
360 /// The value will always be of one of the kinds:
361 /// Type, TypeRef, TypeParameter, BoundedType.
362 ///
363 /// Provided for instance kinds:
364 /// BoundedType
365 /// TypeParameter
366 InstanceRef get bound;
367
368 /// [optional]
369 ///
370 /// Provided for instance kinds:
371 /// Closure
372 Breakpoint get activationBreakpoint;
373
374 /// [optional]
375 ///
376 /// Provided for instance kinds:
377 /// RegExp
378 bool get isCaseSensitive;
379
380 /// [optional]
381 ///
382 /// Provided for instance kinds:
383 /// RegExp
384 bool get isMultiLine;
385
386 /// [optional]
387 ///
388 /// Provided for instance kinds:
389 /// RegExp
390 Function get oneByteFunction;
391
392 /// [optional]
393 ///
394 /// Provided for instance kinds:
395 /// RegExp
396 Function get twoByteFunction;
397
398 /// [optional]
399 ///
400 /// Provided for instance kinds:
401 /// RegExp
402 Function get externalOneByteFunction;
403
404 /// [optional]
405 ///
406 /// Provided for instance kinds:
407 /// RegExp
408 Function get externalTwoByteFunction;
409
410 /// [optional]
411 ///
412 /// Provided for instance kinds:
413 /// RegExp
414 Instance get oneByteBytecode;
415
416 /// [optional]
417 ///
418 /// Provided for instance kinds:
419 /// RegExp
420 Instance get twoByteBytecode;
312 } 421 }
422
423 abstract class BoundField {
424 FieldRef get decl;
425 Guarded<InstanceRef> get value;
426 }
427
428 abstract class NativeField {
429 int get value;
430 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698