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

Side by Side Diff: vm/snapshot.cc

Issue 10869035: Add smi_type, mint_type and double_type to the predefined types list for script snapshots. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | vm/snapshot_ids.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 55
56 static RawType* GetType(ObjectStore* object_store, int index) { 56 static RawType* GetType(ObjectStore* object_store, int index) {
57 switch (index) { 57 switch (index) {
58 case kObjectType: return object_store->object_type(); 58 case kObjectType: return object_store->object_type();
59 case kNullType: return object_store->null_type(); 59 case kNullType: return object_store->null_type();
60 case kDynamicType: return object_store->dynamic_type(); 60 case kDynamicType: return object_store->dynamic_type();
61 case kVoidType: return object_store->void_type(); 61 case kVoidType: return object_store->void_type();
62 case kFunctionType: return object_store->function_type(); 62 case kFunctionType: return object_store->function_type();
63 case kNumberType: return object_store->number_type(); 63 case kNumberType: return object_store->number_type();
64 case kSmiType: return object_store->smi_type();
65 case kMintType: return object_store->mint_type();
66 case kDoubleType: return object_store->double_type();
64 case kDoubleInterface: return object_store->double_interface(); 67 case kDoubleInterface: return object_store->double_interface();
65 case kIntInterface: return object_store->int_interface(); 68 case kIntInterface: return object_store->int_interface();
66 case kBoolInterface: return object_store->bool_interface(); 69 case kBoolInterface: return object_store->bool_interface();
67 case kStringInterface: return object_store->string_interface(); 70 case kStringInterface: return object_store->string_interface();
68 case kListInterface: return object_store->list_interface(); 71 case kListInterface: return object_store->list_interface();
69 case kByteArrayInterface: return object_store->byte_array_interface(); 72 case kByteArrayInterface: return object_store->byte_array_interface();
70 default: break; 73 default: break;
71 } 74 }
72 UNREACHABLE(); 75 UNREACHABLE();
73 return Type::null(); 76 return Type::null();
74 } 77 }
75 78
76 79
77 static int GetTypeIndex(ObjectStore* object_store, const RawType* raw_type) { 80 static int GetTypeIndex(ObjectStore* object_store, const RawType* raw_type) {
78 ASSERT(raw_type->IsHeapObject()); 81 ASSERT(raw_type->IsHeapObject());
79 if (raw_type == object_store->object_type()) { 82 if (raw_type == object_store->object_type()) {
80 return kObjectType; 83 return kObjectType;
81 } else if (raw_type == object_store->null_type()) { 84 } else if (raw_type == object_store->null_type()) {
82 return kNullType; 85 return kNullType;
83 } else if (raw_type == object_store->dynamic_type()) { 86 } else if (raw_type == object_store->dynamic_type()) {
84 return kDynamicType; 87 return kDynamicType;
85 } else if (raw_type == object_store->void_type()) { 88 } else if (raw_type == object_store->void_type()) {
86 return kVoidType; 89 return kVoidType;
87 } else if (raw_type == object_store->function_type()) { 90 } else if (raw_type == object_store->function_type()) {
88 return kFunctionType; 91 return kFunctionType;
89 } else if (raw_type == object_store->number_type()) { 92 } else if (raw_type == object_store->number_type()) {
90 return kNumberType; 93 return kNumberType;
94 } else if (raw_type == object_store->smi_type()) {
95 return kSmiType;
96 } else if (raw_type == object_store->mint_type()) {
97 return kMintType;
98 } else if (raw_type == object_store->double_type()) {
99 return kDoubleType;
91 } else if (raw_type == object_store->double_interface()) { 100 } else if (raw_type == object_store->double_interface()) {
92 return kDoubleInterface; 101 return kDoubleInterface;
93 } else if (raw_type == object_store->int_interface()) { 102 } else if (raw_type == object_store->int_interface()) {
94 return kIntInterface; 103 return kIntInterface;
95 } else if (raw_type == object_store->bool_interface()) { 104 } else if (raw_type == object_store->bool_interface()) {
96 return kBoolInterface; 105 return kBoolInterface;
97 } else if (raw_type == object_store->string_interface()) { 106 } else if (raw_type == object_store->string_interface()) {
98 return kStringInterface; 107 return kStringInterface;
99 } else if (raw_type == object_store->list_interface()) { 108 } else if (raw_type == object_store->list_interface()) {
100 return kListInterface; 109 return kListInterface;
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 RawObject* raw_obj = *current; 1140 RawObject* raw_obj = *current;
1132 if (as_references_) { 1141 if (as_references_) {
1133 writer_->WriteObjectRef(raw_obj); 1142 writer_->WriteObjectRef(raw_obj);
1134 } else { 1143 } else {
1135 writer_->WriteObjectImpl(raw_obj); 1144 writer_->WriteObjectImpl(raw_obj);
1136 } 1145 }
1137 } 1146 }
1138 } 1147 }
1139 1148
1140 } // namespace dart 1149 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | vm/snapshot_ids.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698