| 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 | 
| 3 | // BSD-style license that can be found in the LICENSE file. | 
| 4 |  | 
| 5 | #ifndef RUNTIME_VM_SNAPSHOT_IDS_H_ | 
| 6 | #define RUNTIME_VM_SNAPSHOT_IDS_H_ | 
| 7 |  | 
| 8 | #include "vm/dart_entry.h" | 
| 9 | #include "vm/raw_object.h" | 
| 10 |  | 
| 11 | namespace dart { | 
| 12 |  | 
| 13 | // Index for predefined singleton objects used in a snapshot. | 
| 14 | enum { | 
| 15 |   kNullObject = 0, | 
| 16 |   kSentinelObject, | 
| 17 |   kTransitionSentinelObject, | 
| 18 |   kEmptyArrayObject, | 
| 19 |   kZeroArrayObject, | 
| 20 |   kTrueValue, | 
| 21 |   kFalseValue, | 
| 22 |   // Marker for special encoding of double objects in message snapshots. | 
| 23 |   kDoubleObject, | 
| 24 |   // Object id has been optimized away; reader should use next available id. | 
| 25 |   kOmittedObjectId, | 
| 26 |  | 
| 27 |   kClassIdsOffset = kOmittedObjectId, | 
| 28 |  | 
| 29 |   // The class ids of predefined classes are included in this list | 
| 30 |   // at an offset of kClassIdsOffset. | 
| 31 |  | 
| 32 |   kFirstTypeSnapshotId = (kNumPredefinedCids + kClassIdsOffset), | 
| 33 |   kLegacyObjectType = kFirstTypeSnapshotId, | 
| 34 |   kNullableObjectType, | 
| 35 |   kNullType, | 
| 36 |   kDynamicType, | 
| 37 |   kVoidType, | 
| 38 |   kNeverType, | 
| 39 |   kLegacyFunctionType, | 
| 40 |   kLegacyNumberType, | 
| 41 |   kLegacySmiType, | 
| 42 |   kLegacyMintType, | 
| 43 |   kLegacyDoubleType, | 
| 44 |   kLegacyIntType, | 
| 45 |   kLegacyBoolType, | 
| 46 |   kLegacyStringType, | 
| 47 |   kLegacyArrayType, | 
| 48 |   kNonNullableObjectType, | 
| 49 |   kNonNullableFunctionType, | 
| 50 |   kNonNullableNumberType, | 
| 51 |   kNonNullableSmiType, | 
| 52 |   kNonNullableMintType, | 
| 53 |   kNonNullableDoubleType, | 
| 54 |   kNonNullableIntType, | 
| 55 |   kNonNullableBoolType, | 
| 56 |   kNonNullableStringType, | 
| 57 |   kNonNullableArrayType, | 
| 58 |   kLastTypeSnapshotId = kNonNullableArrayType, | 
| 59 |  | 
| 60 |   kFirstTypeArgumentsSnapshotId = kLastTypeSnapshotId + 1, | 
| 61 |   kLegacyIntTypeArguments = kFirstTypeArgumentsSnapshotId, | 
| 62 |   kLegacyDoubleTypeArguments, | 
| 63 |   kLegacyStringTypeArguments, | 
| 64 |   kLegacyStringDynamicTypeArguments, | 
| 65 |   kLegacyStringLegacyStringTypeArguments, | 
| 66 |   kNonNullableIntTypeArguments, | 
| 67 |   kNonNullableDoubleTypeArguments, | 
| 68 |   kNonNullableStringTypeArguments, | 
| 69 |   kNonNullableStringDynamicTypeArguments, | 
| 70 |   kNonNullableStringNonNullableStringTypeArguments, | 
| 71 |   kEmptyTypeArguments, | 
| 72 |   kLastTypeArgumentsSnapshotId = kEmptyTypeArguments, | 
| 73 |  | 
| 74 |   , | 
| 75 |   , | 
| 76 |   kEmptyContextScopeObject, | 
| 77 |   kImplicitClosureScopeObject, | 
| 78 |   kEmptyObjectPool, | 
| 79 |   kEmptyDescriptors, | 
| 80 |   kEmptyVarDescriptors, | 
| 81 |   kEmptyExceptionHandlers, | 
| 82 |   kCachedArgumentsDescriptor0, | 
| 83 |   kCachedArgumentsDescriptorN = | 
| 84 |       (kCachedArgumentsDescriptor0 + | 
| 85 |        ArgumentsDescriptor::kCachedDescriptorCount - 1), | 
| 86 |   kCachedICDataArray0, | 
| 87 |   kCachedICDataArrayN = | 
| 88 |       (kCachedICDataArray0 + ICData::kCachedICDataArrayCount - 1), | 
| 89 |  | 
| 90 |   kInstanceObjectId, | 
| 91 |   kStaticImplicitClosureObjectId, | 
| 92 |   kMaxPredefinedObjectIds, | 
| 93 |   kInvalidIndex = -1, | 
| 94 | }; | 
| 95 |  | 
| 96 | }  // namespace dart | 
| 97 |  | 
| 98 | #endif  // RUNTIME_VM_SNAPSHOT_IDS_H_ | 
| 99 |  |