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

Side by Side Diff: vm/object_store.cc

Issue 9594028: Add a first class GrowableObjectArray type in the VM and use it internally in the VM at all spots w… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 9 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/object_store.h" 5 #include "vm/object_store.h"
6 6
7 #include "vm/exceptions.h" 7 #include "vm/exceptions.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/raw_object.h" 10 #include "vm/raw_object.h"
(...skipping 16 matching lines...) Expand all
27 two_byte_string_class_(Class::null()), 27 two_byte_string_class_(Class::null()),
28 four_byte_string_class_(Class::null()), 28 four_byte_string_class_(Class::null()),
29 external_one_byte_string_class_(Class::null()), 29 external_one_byte_string_class_(Class::null()),
30 external_two_byte_string_class_(Class::null()), 30 external_two_byte_string_class_(Class::null()),
31 external_four_byte_string_class_(Class::null()), 31 external_four_byte_string_class_(Class::null()),
32 bool_interface_(Type::null()), 32 bool_interface_(Type::null()),
33 bool_class_(Class::null()), 33 bool_class_(Class::null()),
34 list_interface_(Type::null()), 34 list_interface_(Type::null()),
35 array_class_(Class::null()), 35 array_class_(Class::null()),
36 immutable_array_class_(Class::null()), 36 immutable_array_class_(Class::null()),
37 growable_object_array_class_(Class::null()),
37 byte_array_interface_(Type::null()), 38 byte_array_interface_(Type::null()),
38 internal_byte_array_class_(Class::null()), 39 internal_byte_array_class_(Class::null()),
39 external_byte_array_class_(Class::null()), 40 external_byte_array_class_(Class::null()),
40 stacktrace_class_(Class::null()), 41 stacktrace_class_(Class::null()),
41 jsregexp_class_(Class::null()), 42 jsregexp_class_(Class::null()),
42 true_value_(Bool::null()), 43 true_value_(Bool::null()),
43 false_value_(Bool::null()), 44 false_value_(Bool::null()),
44 empty_array_(Array::null()), 45 empty_array_(Array::null()),
45 symbol_table_(Array::null()), 46 symbol_table_(Array::null()),
46 canonical_type_arguments_(Array::null()), 47 canonical_type_arguments_(Array::null()),
47 core_library_(Library::null()), 48 core_library_(Library::null()),
48 core_impl_library_(Library::null()), 49 core_impl_library_(Library::null()),
49 native_wrappers_library_(Library::null()), 50 native_wrappers_library_(Library::null()),
50 root_library_(Library::null()), 51 root_library_(Library::null()),
51 registered_libraries_(Library::null()), 52 registered_libraries_(Library::null()),
52 pending_classes_(Array::null()), 53 pending_classes_(GrowableObjectArray::null()),
53 sticky_error_(Error::null()), 54 sticky_error_(Error::null()),
54 empty_context_(Context::null()), 55 empty_context_(Context::null()),
55 stack_overflow_(Instance::null()), 56 stack_overflow_(Instance::null()),
56 out_of_memory_(Instance::null()), 57 out_of_memory_(Instance::null()),
57 keyword_symbols_(Array::null()) { 58 keyword_symbols_(Array::null()) {
58 } 59 }
59 60
60 61
61 ObjectStore::~ObjectStore() { 62 ObjectStore::~ObjectStore() {
62 } 63 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 case kDoubleClass: return double_class_; 125 case kDoubleClass: return double_class_;
125 case kOneByteStringClass: return one_byte_string_class_; 126 case kOneByteStringClass: return one_byte_string_class_;
126 case kTwoByteStringClass: return two_byte_string_class_; 127 case kTwoByteStringClass: return two_byte_string_class_;
127 case kFourByteStringClass: return four_byte_string_class_; 128 case kFourByteStringClass: return four_byte_string_class_;
128 case kExternalOneByteStringClass: return external_one_byte_string_class_; 129 case kExternalOneByteStringClass: return external_one_byte_string_class_;
129 case kExternalTwoByteStringClass: return external_two_byte_string_class_; 130 case kExternalTwoByteStringClass: return external_two_byte_string_class_;
130 case kExternalFourByteStringClass: return external_four_byte_string_class_; 131 case kExternalFourByteStringClass: return external_four_byte_string_class_;
131 case kBoolClass: return bool_class_; 132 case kBoolClass: return bool_class_;
132 case kArrayClass: return array_class_; 133 case kArrayClass: return array_class_;
133 case kImmutableArrayClass: return immutable_array_class_; 134 case kImmutableArrayClass: return immutable_array_class_;
135 case kGrowableObjectArrayClass: return growable_object_array_class_;
134 case kInternalByteArrayClass: return internal_byte_array_class_; 136 case kInternalByteArrayClass: return internal_byte_array_class_;
135 case kExternalByteArrayClass: return external_byte_array_class_; 137 case kExternalByteArrayClass: return external_byte_array_class_;
136 case kStacktraceClass: return stacktrace_class_; 138 case kStacktraceClass: return stacktrace_class_;
137 case kJSRegExpClass: return jsregexp_class_; 139 case kJSRegExpClass: return jsregexp_class_;
138 default: break; 140 default: break;
139 } 141 }
140 UNREACHABLE(); 142 UNREACHABLE();
141 return Class::null(); 143 return Class::null();
142 } 144 }
143 145
(...skipping 21 matching lines...) Expand all
165 } else if (raw_class == external_two_byte_string_class_) { 167 } else if (raw_class == external_two_byte_string_class_) {
166 return kExternalTwoByteStringClass; 168 return kExternalTwoByteStringClass;
167 } else if (raw_class == external_four_byte_string_class_) { 169 } else if (raw_class == external_four_byte_string_class_) {
168 return kExternalFourByteStringClass; 170 return kExternalFourByteStringClass;
169 } else if (raw_class == bool_class_) { 171 } else if (raw_class == bool_class_) {
170 return kBoolClass; 172 return kBoolClass;
171 } else if (raw_class == array_class_) { 173 } else if (raw_class == array_class_) {
172 return kArrayClass; 174 return kArrayClass;
173 } else if (raw_class == immutable_array_class_) { 175 } else if (raw_class == immutable_array_class_) {
174 return kImmutableArrayClass; 176 return kImmutableArrayClass;
177 } else if (raw_class == growable_object_array_class_) {
178 return kGrowableObjectArrayClass;
175 } else if (raw_class == internal_byte_array_class_) { 179 } else if (raw_class == internal_byte_array_class_) {
176 return kInternalByteArrayClass; 180 return kInternalByteArrayClass;
177 } else if (raw_class == external_byte_array_class_) { 181 } else if (raw_class == external_byte_array_class_) {
178 return kExternalByteArrayClass; 182 return kExternalByteArrayClass;
179 } else if (raw_class == stacktrace_class_) { 183 } else if (raw_class == stacktrace_class_) {
180 return kStacktraceClass; 184 return kStacktraceClass;
181 } else if (raw_class == jsregexp_class_) { 185 } else if (raw_class == jsregexp_class_) {
182 return kJSRegExpClass; 186 return kJSRegExpClass;
183 } 187 }
184 return kInvalidIndex; 188 return kInvalidIndex;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 return kStringInterface; 234 return kStringInterface;
231 } else if (raw_type == list_interface()) { 235 } else if (raw_type == list_interface()) {
232 return kListInterface; 236 return kListInterface;
233 } else if (raw_type == byte_array_interface()) { 237 } else if (raw_type == byte_array_interface()) {
234 return kByteArrayInterface; 238 return kByteArrayInterface;
235 } 239 }
236 return kInvalidIndex; 240 return kInvalidIndex;
237 } 241 }
238 242
239 } // namespace dart 243 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698