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

Side by Side Diff: runtime/vm/class_finalizer.cc

Issue 8429027: Add an external array type to support typed arrays. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make loads and stores byte relative Created 9 years, 1 month 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/class_finalizer.h" 5 #include "vm/class_finalizer.h"
6 6
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/heap.h" 8 #include "vm/heap.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 cls = object_store->mint_class(); 208 cls = object_store->mint_class();
209 ASSERT(Mint::InstanceSize() == cls.instance_size()); 209 ASSERT(Mint::InstanceSize() == cls.instance_size());
210 cls = object_store->bigint_class(); 210 cls = object_store->bigint_class();
211 ASSERT(Bigint::InstanceSize() == cls.instance_size()); 211 ASSERT(Bigint::InstanceSize() == cls.instance_size());
212 cls = object_store->bool_class(); 212 cls = object_store->bool_class();
213 ASSERT(Bool::InstanceSize() == cls.instance_size()); 213 ASSERT(Bool::InstanceSize() == cls.instance_size());
214 cls = object_store->array_class(); 214 cls = object_store->array_class();
215 ASSERT(Array::InstanceSize() == cls.instance_size()); 215 ASSERT(Array::InstanceSize() == cls.instance_size());
216 cls = object_store->immutable_array_class(); 216 cls = object_store->immutable_array_class();
217 ASSERT(Array::InstanceSize() == cls.instance_size()); 217 ASSERT(Array::InstanceSize() == cls.instance_size());
218 cls = object_store->byte_buffer_class();
219 ASSERT(ByteBuffer::InstanceSize() == cls.instance_size());
218 #endif // defined(DEBUG) 220 #endif // defined(DEBUG)
219 221
220 // Remember the currently pending classes. 222 // Remember the currently pending classes.
221 const Array& class_array = Array::Handle(object_store->pending_classes()); 223 const Array& class_array = Array::Handle(object_store->pending_classes());
222 for (intptr_t i = 0; i < class_array.Length(); i++) { 224 for (intptr_t i = 0; i < class_array.Length(); i++) {
223 // TODO(iposva): Add real checks. 225 // TODO(iposva): Add real checks.
224 cls ^= class_array.At(i); 226 cls ^= class_array.At(i);
225 if (cls.is_finalized() || cls.is_prefinalized()) { 227 if (cls.is_finalized() || cls.is_prefinalized()) {
226 // Pre-finalized bootstrap classes must not define any fields. 228 // Pre-finalized bootstrap classes must not define any fields.
227 ASSERT(Array::Handle(cls.fields()).Length() == 0); 229 ASSERT(Array::Handle(cls.fields()).Length() == 0);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 Class::Handle(core_impl_lib.LookupClass(integer_implementation_name)); 280 Class::Handle(core_impl_lib.LookupClass(integer_implementation_name));
279 const String& growable_object_array_name = 281 const String& growable_object_array_name =
280 String::Handle(String::NewSymbol("GrowableObjectArray")); 282 String::Handle(String::NewSymbol("GrowableObjectArray"));
281 const Class& growable_object_array_class = 283 const Class& growable_object_array_class =
282 Class::Handle(core_impl_lib.LookupClass(growable_object_array_name)); 284 Class::Handle(core_impl_lib.LookupClass(growable_object_array_name));
283 if ((super_class.raw() == object_store->bool_class()) || 285 if ((super_class.raw() == object_store->bool_class()) ||
284 (super_class.raw() == object_store->double_class()) || 286 (super_class.raw() == object_store->double_class()) ||
285 (super_class.raw() == object_store->array_class()) || 287 (super_class.raw() == object_store->array_class()) ||
286 (super_class.raw() == object_store->immutable_array_class()) || 288 (super_class.raw() == object_store->immutable_array_class()) ||
287 (super_class.raw() == growable_object_array_class.raw()) || 289 (super_class.raw() == growable_object_array_class.raw()) ||
290 (super_class.raw() == object_store->byte_buffer_class()) ||
288 (super_class.raw() == integer_implementation_class.raw()) || 291 (super_class.raw() == integer_implementation_class.raw()) ||
289 (super_class.raw() == object_store->smi_class()) || 292 (super_class.raw() == object_store->smi_class()) ||
290 (super_class.raw() == object_store->mint_class()) || 293 (super_class.raw() == object_store->mint_class()) ||
291 (super_class.raw() == object_store->bigint_class()) || 294 (super_class.raw() == object_store->bigint_class()) ||
292 (super_class.raw() == object_store->one_byte_string_class()) || 295 (super_class.raw() == object_store->one_byte_string_class()) ||
293 (super_class.raw() == object_store->two_byte_string_class()) || 296 (super_class.raw() == object_store->two_byte_string_class()) ||
294 (super_class.raw() == object_store->four_byte_string_class())) { 297 (super_class.raw() == object_store->four_byte_string_class())) {
295 ReportError("'%s' is not allowed to extend '%s'\n", 298 ReportError("'%s' is not allowed to extend '%s'\n",
296 String::Handle(cls.Name()).ToCString(), 299 String::Handle(cls.Name()).ToCString(),
297 String::Handle(super_class.Name()).ToCString()); 300 String::Handle(super_class.Name()).ToCString());
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 ASSERT(msg_buffer != NULL); 1087 ASSERT(msg_buffer != NULL);
1085 va_list args; 1088 va_list args;
1086 va_start(args, format); 1089 va_start(args, format);
1087 OS::VSNPrint(msg_buffer, kBufferLength, format, args); 1090 OS::VSNPrint(msg_buffer, kBufferLength, format, args);
1088 va_end(args); 1091 va_end(args);
1089 isolate->long_jump_base()->Jump(1, msg_buffer); 1092 isolate->long_jump_base()->Jump(1, msg_buffer);
1090 UNREACHABLE(); 1093 UNREACHABLE();
1091 } 1094 }
1092 1095
1093 } // namespace dart 1096 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698