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 #ifndef VM_RAW_OBJECT_H_ | 5 #ifndef VM_RAW_OBJECT_H_ |
6 #define VM_RAW_OBJECT_H_ | 6 #define VM_RAW_OBJECT_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 #include "vm/token.h" | 10 #include "vm/token.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 V(SubtypeTestCache) \ | 44 V(SubtypeTestCache) \ |
45 V(Error) \ | 45 V(Error) \ |
46 V(ApiError) \ | 46 V(ApiError) \ |
47 V(LanguageError) \ | 47 V(LanguageError) \ |
48 V(UnhandledException) \ | 48 V(UnhandledException) \ |
49 V(UnwindError) \ | 49 V(UnwindError) \ |
50 V(Instance) \ | 50 V(Instance) \ |
51 V(AbstractType) \ | 51 V(AbstractType) \ |
52 V(Type) \ | 52 V(Type) \ |
53 V(TypeParameter) \ | 53 V(TypeParameter) \ |
| 54 V(BoundedType) \ |
54 V(Number) \ | 55 V(Number) \ |
55 V(Integer) \ | 56 V(Integer) \ |
56 V(Smi) \ | 57 V(Smi) \ |
57 V(Mint) \ | 58 V(Mint) \ |
58 V(Bigint) \ | 59 V(Bigint) \ |
59 V(Double) \ | 60 V(Double) \ |
60 V(Bool) \ | 61 V(Bool) \ |
61 V(Array) \ | 62 V(Array) \ |
62 V(ImmutableArray) \ | 63 V(ImmutableArray) \ |
63 V(GrowableObjectArray) \ | 64 V(GrowableObjectArray) \ |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 431 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
431 RawString* name_; | 432 RawString* name_; |
432 RawArray* functions_; | 433 RawArray* functions_; |
433 RawArray* fields_; | 434 RawArray* fields_; |
434 RawGrowableObjectArray* closure_functions_; // Local functions and literals. | 435 RawGrowableObjectArray* closure_functions_; // Local functions and literals. |
435 RawArray* interfaces_; // Array of AbstractType. | 436 RawArray* interfaces_; // Array of AbstractType. |
436 RawGrowableObjectArray* direct_subclasses_; // Array of Class. | 437 RawGrowableObjectArray* direct_subclasses_; // Array of Class. |
437 RawScript* script_; | 438 RawScript* script_; |
438 RawLibrary* library_; | 439 RawLibrary* library_; |
439 RawTypeArguments* type_parameters_; // Array of TypeParameter. | 440 RawTypeArguments* type_parameters_; // Array of TypeParameter. |
440 RawType* super_type_; | 441 RawAbstractType* super_type_; |
441 RawType* mixin_; | 442 RawType* mixin_; |
442 RawFunction* signature_function_; // Associated function for signature class. | 443 RawFunction* signature_function_; // Associated function for signature class. |
443 RawArray* constants_; // Canonicalized values of this class. | 444 RawArray* constants_; // Canonicalized values of this class. |
444 RawArray* canonical_types_; // Canonicalized types of this class. | 445 RawArray* canonical_types_; // Canonicalized types of this class. |
445 RawCode* allocation_stub_; // Stub code for allocation of instances. | 446 RawCode* allocation_stub_; // Stub code for allocation of instances. |
446 RawObject** to() { | 447 RawObject** to() { |
447 return reinterpret_cast<RawObject**>(&ptr()->allocation_stub_); | 448 return reinterpret_cast<RawObject**>(&ptr()->allocation_stub_); |
448 } | 449 } |
449 | 450 |
450 cpp_vtable handle_vtable_; | 451 cpp_vtable handle_vtable_; |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 RawClass* parameterized_class_; | 1113 RawClass* parameterized_class_; |
1113 RawString* name_; | 1114 RawString* name_; |
1114 RawAbstractType* bound_; // ObjectType if no explicit bound specified. | 1115 RawAbstractType* bound_; // ObjectType if no explicit bound specified. |
1115 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->bound_); } | 1116 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->bound_); } |
1116 intptr_t index_; | 1117 intptr_t index_; |
1117 intptr_t token_pos_; | 1118 intptr_t token_pos_; |
1118 int8_t type_state_; | 1119 int8_t type_state_; |
1119 }; | 1120 }; |
1120 | 1121 |
1121 | 1122 |
| 1123 class RawBoundedType : public RawAbstractType { |
| 1124 private: |
| 1125 RAW_HEAP_OBJECT_IMPLEMENTATION(BoundedType); |
| 1126 |
| 1127 RawObject** from() { |
| 1128 return reinterpret_cast<RawObject**>(&ptr()->type_); |
| 1129 } |
| 1130 RawAbstractType* type_; |
| 1131 RawAbstractType* bound_; |
| 1132 RawTypeParameter* type_parameter_; // For more detailed error reporting. |
| 1133 RawObject** to() { |
| 1134 return reinterpret_cast<RawObject**>(&ptr()->type_parameter_); |
| 1135 } |
| 1136 bool is_being_checked_; |
| 1137 }; |
| 1138 |
| 1139 |
1122 class RawNumber : public RawInstance { | 1140 class RawNumber : public RawInstance { |
1123 RAW_OBJECT_IMPLEMENTATION(Number); | 1141 RAW_OBJECT_IMPLEMENTATION(Number); |
1124 }; | 1142 }; |
1125 | 1143 |
1126 | 1144 |
1127 class RawInteger : public RawNumber { | 1145 class RawInteger : public RawNumber { |
1128 RAW_OBJECT_IMPLEMENTATION(Integer); | 1146 RAW_OBJECT_IMPLEMENTATION(Integer); |
1129 }; | 1147 }; |
1130 | 1148 |
1131 | 1149 |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1743 kExternalFloat32x4ArrayCid == kExternalInt8ArrayCid + 9 && | 1761 kExternalFloat32x4ArrayCid == kExternalInt8ArrayCid + 9 && |
1744 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 10 && | 1762 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 10 && |
1745 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 11 && | 1763 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 11 && |
1746 kStacktraceCid == kExternalInt8ArrayCid + 12); | 1764 kStacktraceCid == kExternalInt8ArrayCid + 12); |
1747 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); | 1765 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); |
1748 } | 1766 } |
1749 | 1767 |
1750 } // namespace dart | 1768 } // namespace dart |
1751 | 1769 |
1752 #endif // VM_RAW_OBJECT_H_ | 1770 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |