| OLD | NEW |
| 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 |
| 10 /// null instance. | 11 /// null instance. |
| 11 vNull, | 12 vNull, |
| 13 |
| 12 /// true or false. | 14 /// true or false. |
| 13 bool, | 15 bool, |
| 16 |
| 14 /// An instance of the Dart class double. | 17 /// An instance of the Dart class double. |
| 15 double, | 18 double, |
| 19 |
| 16 /// An instance of the Dart class int. | 20 /// An instance of the Dart class int. |
| 17 int, | 21 int, |
| 22 |
| 18 /// An instance of the Dart class String. | 23 /// An instance of the Dart class String. |
| 19 string, | 24 string, |
| 25 |
| 20 /// An instance of the built-in VM List implementation. User-defined | 26 /// An instance of the built-in VM List implementation. User-defined |
| 21 /// Lists will be PlainInstance. | 27 /// Lists will be PlainInstance. |
| 22 list, | 28 list, |
| 29 |
| 23 /// An instance of the built-in VM Map implementation. User-defined | 30 /// An instance of the built-in VM Map implementation. User-defined |
| 24 /// Maps will be PlainInstance. | 31 /// Maps will be PlainInstance. |
| 25 map, | 32 map, |
| 33 |
| 26 /// Vector instance kinds. | 34 /// Vector instance kinds. |
| 27 float32x4, | 35 float32x4, |
| 36 |
| 28 /// Vector instance kinds. | 37 /// Vector instance kinds. |
| 29 float64x2, | 38 float64x2, |
| 39 |
| 30 /// Vector instance kinds. | 40 /// Vector instance kinds. |
| 31 int32x4, | 41 int32x4, |
| 42 |
| 32 /// An instance of the built-in VM TypedData implementations. User-defined | 43 /// An instance of the built-in VM TypedData implementations. User-defined |
| 33 /// TypedDatas will be PlainInstance. | 44 /// TypedDatas will be PlainInstance. |
| 34 uint8ClampedList, | 45 uint8ClampedList, |
| 46 |
| 35 /// An instance of the built-in VM TypedData implementations. User-defined | 47 /// An instance of the built-in VM TypedData implementations. User-defined |
| 36 /// TypedDatas will be PlainInstance. | 48 /// TypedDatas will be PlainInstance. |
| 37 uint8List, | 49 uint8List, |
| 50 |
| 38 /// An instance of the built-in VM TypedData implementations. User-defined | 51 /// An instance of the built-in VM TypedData implementations. User-defined |
| 39 /// TypedDatas will be PlainInstance. | 52 /// TypedDatas will be PlainInstance. |
| 40 uint16List, | 53 uint16List, |
| 54 |
| 41 /// An instance of the built-in VM TypedData implementations. User-defined | 55 /// An instance of the built-in VM TypedData implementations. User-defined |
| 42 /// TypedDatas will be PlainInstance. | 56 /// TypedDatas will be PlainInstance. |
| 43 uint32List, | 57 uint32List, |
| 58 |
| 44 /// An instance of the built-in VM TypedData implementations. User-defined | 59 /// An instance of the built-in VM TypedData implementations. User-defined |
| 45 /// TypedDatas will be PlainInstance. | 60 /// TypedDatas will be PlainInstance. |
| 46 uint64List, | 61 uint64List, |
| 62 |
| 47 /// An instance of the built-in VM TypedData implementations. User-defined | 63 /// An instance of the built-in VM TypedData implementations. User-defined |
| 48 /// TypedDatas will be PlainInstance. | 64 /// TypedDatas will be PlainInstance. |
| 49 int8List, | 65 int8List, |
| 66 |
| 50 /// An instance of the built-in VM TypedData implementations. User-defined | 67 /// An instance of the built-in VM TypedData implementations. User-defined |
| 51 /// TypedDatas will be PlainInstance. | 68 /// TypedDatas will be PlainInstance. |
| 52 int16List, | 69 int16List, |
| 70 |
| 53 /// An instance of the built-in VM TypedData implementations. User-defined | 71 /// An instance of the built-in VM TypedData implementations. User-defined |
| 54 /// TypedDatas will be PlainInstance. | 72 /// TypedDatas will be PlainInstance. |
| 55 int32List, | 73 int32List, |
| 74 |
| 56 /// An instance of the built-in VM TypedData implementations. User-defined | 75 /// An instance of the built-in VM TypedData implementations. User-defined |
| 57 /// TypedDatas will be PlainInstance. | 76 /// TypedDatas will be PlainInstance. |
| 58 int64List, | 77 int64List, |
| 78 |
| 59 /// An instance of the built-in VM TypedData implementations. User-defined | 79 /// An instance of the built-in VM TypedData implementations. User-defined |
| 60 /// TypedDatas will be PlainInstance. | 80 /// TypedDatas will be PlainInstance. |
| 61 float32List, | 81 float32List, |
| 82 |
| 62 /// An instance of the built-in VM TypedData implementations. User-defined | 83 /// An instance of the built-in VM TypedData implementations. User-defined |
| 63 /// TypedDatas will be PlainInstance. | 84 /// TypedDatas will be PlainInstance. |
| 64 float64List, | 85 float64List, |
| 86 |
| 65 /// An instance of the built-in VM TypedData implementations. User-defined | 87 /// An instance of the built-in VM TypedData implementations. User-defined |
| 66 /// TypedDatas will be PlainInstance. | 88 /// TypedDatas will be PlainInstance. |
| 67 int32x4List, | 89 int32x4List, |
| 90 |
| 68 /// An instance of the built-in VM TypedData implementations. User-defined | 91 /// An instance of the built-in VM TypedData implementations. User-defined |
| 69 /// TypedDatas will be PlainInstance. | 92 /// TypedDatas will be PlainInstance. |
| 70 float32x4List, | 93 float32x4List, |
| 94 |
| 71 /// An instance of the built-in VM TypedData implementations. User-defined | 95 /// An instance of the built-in VM TypedData implementations. User-defined |
| 72 /// TypedDatas will be PlainInstance. | 96 /// TypedDatas will be PlainInstance. |
| 73 float64x2List, | 97 float64x2List, |
| 98 |
| 74 /// An instance of the Dart class StackTrace. | 99 /// An instance of the Dart class StackTrace. |
| 75 stackTrace, | 100 stackTrace, |
| 101 |
| 76 /// An instance of the built-in VM Closure implementation. User-defined | 102 /// An instance of the built-in VM Closure implementation. User-defined |
| 77 /// Closures will be PlainInstance. | 103 /// Closures will be PlainInstance. |
| 78 closure, | 104 closure, |
| 105 |
| 79 /// An instance of the Dart class MirrorReference. | 106 /// An instance of the Dart class MirrorReference. |
| 80 mirrorReference, | 107 mirrorReference, |
| 108 |
| 81 /// An instance of the Dart class RegExp. | 109 /// An instance of the Dart class RegExp. |
| 82 regExp, | 110 regExp, |
| 111 |
| 83 /// An instance of the Dart class WeakProperty. | 112 /// An instance of the Dart class WeakProperty. |
| 84 weakProperty, | 113 weakProperty, |
| 114 |
| 85 /// An instance of the Dart class Type. | 115 /// An instance of the Dart class Type. |
| 86 type, | 116 type, |
| 117 |
| 87 /// An instance of the Dart class TypeParameter. | 118 /// An instance of the Dart class TypeParameter. |
| 88 typeParameter, | 119 typeParameter, |
| 120 |
| 89 /// An instance of the Dart class TypeRef. | 121 /// An instance of the Dart class TypeRef. |
| 90 typeRef, | 122 typeRef, |
| 123 |
| 91 /// An instance of the Dart class BoundedType. | 124 /// An instance of the Dart class BoundedType. |
| 92 boundedType, | 125 boundedType, |
| 93 } | 126 } |
| 94 | 127 |
| 95 bool isTypedData(InstanceKind kind) { | 128 bool isTypedData(InstanceKind kind) { |
| 96 switch (kind) { | 129 switch (kind) { |
| 97 case InstanceKind.uint8ClampedList: | 130 case InstanceKind.uint8ClampedList: |
| 98 case InstanceKind.uint8List: | 131 case InstanceKind.uint8List: |
| 99 case InstanceKind.uint16List: | 132 case InstanceKind.uint16List: |
| 100 case InstanceKind.uint32List: | 133 case InstanceKind.uint32List: |
| 101 case InstanceKind.uint64List: | 134 case InstanceKind.uint64List: |
| 102 case InstanceKind.int8List: | 135 case InstanceKind.int8List: |
| 103 case InstanceKind.int16List: | 136 case InstanceKind.int16List: |
| 104 case InstanceKind.int32List: | 137 case InstanceKind.int32List: |
| 105 case InstanceKind.int64List: | 138 case InstanceKind.int64List: |
| 106 case InstanceKind.float32List: | 139 case InstanceKind.float32List: |
| 107 case InstanceKind.float64List: | 140 case InstanceKind.float64List: |
| 108 case InstanceKind.int32x4List: | 141 case InstanceKind.int32x4List: |
| 109 case InstanceKind.float32x4List: | 142 case InstanceKind.float32x4List: |
| 110 case InstanceKind.float64x2List: | 143 case InstanceKind.float64x2List: |
| 111 return true; | 144 return true; |
| 112 default: | 145 default: |
| 113 return false; | 146 return false; |
| 114 } | 147 } |
| 115 } | 148 } |
| 116 | 149 |
| 117 bool isSimdValue(InstanceKind kind) { | 150 bool isSimdValue(InstanceKind kind) { |
| 118 switch (kind) { | 151 switch (kind) { |
| 119 case InstanceKind.float32x4: | 152 case InstanceKind.float32x4: |
| 120 case InstanceKind.float64x2: | 153 case InstanceKind.float64x2: |
| 121 case InstanceKind.int32x4: | 154 case InstanceKind.int32x4: |
| 122 return true; | 155 return true; |
| 123 default: | 156 default: |
| 124 return false; | 157 return false; |
| 125 } | 158 } |
| 126 } | 159 } |
| 127 | 160 |
| 128 bool isAbstractType(InstanceKind kind) { | 161 bool isAbstractType(InstanceKind kind) { |
| 129 switch (kind) { | 162 switch (kind) { |
| 130 case InstanceKind.type: | 163 case InstanceKind.type: |
| 131 case InstanceKind.typeRef: | 164 case InstanceKind.typeRef: |
| 132 case InstanceKind.typeParameter: | 165 case InstanceKind.typeParameter: |
| 133 case InstanceKind.boundedType: | 166 case InstanceKind.boundedType: |
| 134 return true; | 167 return true; |
| 135 default: | 168 default: |
| 136 return false; | 169 return false; |
| 137 } | 170 } |
| 138 } | 171 } |
| 139 | 172 |
| 140 abstract class InstanceRef extends ObjectRef { | 173 abstract class InstanceRef extends ObjectRef { |
| 141 /// What kind of instance is this? | 174 /// What kind of instance is this? |
| 142 InstanceKind get kind; | 175 InstanceKind get kind; |
| 143 | 176 |
| 144 /// Instance references always include their class. | 177 /// Instance references always include their class. |
| 145 ClassRef get clazz; | 178 ClassRef get clazz; |
| 146 | 179 |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 } | 454 } |
| 422 | 455 |
| 423 abstract class BoundField { | 456 abstract class BoundField { |
| 424 FieldRef get decl; | 457 FieldRef get decl; |
| 425 Guarded<InstanceRef> get value; | 458 Guarded<InstanceRef> get value; |
| 426 } | 459 } |
| 427 | 460 |
| 428 abstract class NativeField { | 461 abstract class NativeField { |
| 429 int get value; | 462 int get value; |
| 430 } | 463 } |
| OLD | NEW |