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 #include "vm/snapshot.h" | 5 #include "vm/snapshot.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
9 #include "vm/bootstrap.h" | 9 #include "vm/bootstrap.h" |
10 #include "vm/exceptions.h" | 10 #include "vm/exceptions.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 case kNullType: return object_store->null_type(); | 60 case kNullType: return object_store->null_type(); |
61 case kDynamicType: return object_store->dynamic_type(); | 61 case kDynamicType: return object_store->dynamic_type(); |
62 case kVoidType: return object_store->void_type(); | 62 case kVoidType: return object_store->void_type(); |
63 case kFunctionType: return object_store->function_type(); | 63 case kFunctionType: return object_store->function_type(); |
64 case kNumberType: return object_store->number_type(); | 64 case kNumberType: return object_store->number_type(); |
65 case kSmiType: return object_store->smi_type(); | 65 case kSmiType: return object_store->smi_type(); |
66 case kMintType: return object_store->mint_type(); | 66 case kMintType: return object_store->mint_type(); |
67 case kDoubleType: return object_store->double_type(); | 67 case kDoubleType: return object_store->double_type(); |
68 case kIntType: return object_store->int_type(); | 68 case kIntType: return object_store->int_type(); |
69 case kBoolType: return object_store->bool_type(); | 69 case kBoolType: return object_store->bool_type(); |
70 case kStringInterface: return object_store->string_interface(); | 70 case kStringType: return object_store->string_type(); |
71 case kListInterface: return object_store->list_interface(); | 71 case kListInterface: return object_store->list_interface(); |
72 default: break; | 72 default: break; |
73 } | 73 } |
74 UNREACHABLE(); | 74 UNREACHABLE(); |
75 return Type::null(); | 75 return Type::null(); |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 static int GetTypeIndex(ObjectStore* object_store, const RawType* raw_type) { | 79 static int GetTypeIndex(ObjectStore* object_store, const RawType* raw_type) { |
80 ASSERT(raw_type->IsHeapObject()); | 80 ASSERT(raw_type->IsHeapObject()); |
(...skipping 12 matching lines...) Expand all Loading... |
93 } else if (raw_type == object_store->smi_type()) { | 93 } else if (raw_type == object_store->smi_type()) { |
94 return kSmiType; | 94 return kSmiType; |
95 } else if (raw_type == object_store->mint_type()) { | 95 } else if (raw_type == object_store->mint_type()) { |
96 return kMintType; | 96 return kMintType; |
97 } else if (raw_type == object_store->double_type()) { | 97 } else if (raw_type == object_store->double_type()) { |
98 return kDoubleType; | 98 return kDoubleType; |
99 } else if (raw_type == object_store->int_type()) { | 99 } else if (raw_type == object_store->int_type()) { |
100 return kIntType; | 100 return kIntType; |
101 } else if (raw_type == object_store->bool_type()) { | 101 } else if (raw_type == object_store->bool_type()) { |
102 return kBoolType; | 102 return kBoolType; |
103 } else if (raw_type == object_store->string_interface()) { | 103 } else if (raw_type == object_store->string_type()) { |
104 return kStringInterface; | 104 return kStringType; |
105 } else if (raw_type == object_store->list_interface()) { | 105 } else if (raw_type == object_store->list_interface()) { |
106 return kListInterface; | 106 return kListInterface; |
107 } | 107 } |
108 return kInvalidIndex; | 108 return kInvalidIndex; |
109 } | 109 } |
110 | 110 |
111 | 111 |
112 // TODO(5411462): Temporary setup of snapshot for testing purposes, | 112 // TODO(5411462): Temporary setup of snapshot for testing purposes, |
113 // the actual creation of a snapshot maybe done differently. | 113 // the actual creation of a snapshot maybe done differently. |
114 const Snapshot* Snapshot::SetupFromBuffer(const void* raw_memory) { | 114 const Snapshot* Snapshot::SetupFromBuffer(const void* raw_memory) { |
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 | 1172 |
1173 | 1173 |
1174 void MessageWriter::WriteMessage(const Object& obj) { | 1174 void MessageWriter::WriteMessage(const Object& obj) { |
1175 ASSERT(kind() == Snapshot::kMessage); | 1175 ASSERT(kind() == Snapshot::kMessage); |
1176 WriteObject(obj.raw()); | 1176 WriteObject(obj.raw()); |
1177 UnmarkAll(); | 1177 UnmarkAll(); |
1178 } | 1178 } |
1179 | 1179 |
1180 | 1180 |
1181 } // namespace dart | 1181 } // namespace dart |
OLD | NEW |