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

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: Address final review comments 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
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/globals.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) 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 cls = object_store->mint_class(); 209 cls = object_store->mint_class();
210 ASSERT(Mint::InstanceSize() == cls.instance_size()); 210 ASSERT(Mint::InstanceSize() == cls.instance_size());
211 cls = object_store->bigint_class(); 211 cls = object_store->bigint_class();
212 ASSERT(Bigint::InstanceSize() == cls.instance_size()); 212 ASSERT(Bigint::InstanceSize() == cls.instance_size());
213 cls = object_store->bool_class(); 213 cls = object_store->bool_class();
214 ASSERT(Bool::InstanceSize() == cls.instance_size()); 214 ASSERT(Bool::InstanceSize() == cls.instance_size());
215 cls = object_store->array_class(); 215 cls = object_store->array_class();
216 ASSERT(Array::InstanceSize() == cls.instance_size()); 216 ASSERT(Array::InstanceSize() == cls.instance_size());
217 cls = object_store->immutable_array_class(); 217 cls = object_store->immutable_array_class();
218 ASSERT(Array::InstanceSize() == cls.instance_size()); 218 ASSERT(Array::InstanceSize() == cls.instance_size());
219 cls = object_store->byte_buffer_class();
220 ASSERT(ByteBuffer::InstanceSize() == cls.instance_size());
219 #endif // defined(DEBUG) 221 #endif // defined(DEBUG)
220 222
221 // Remember the currently pending classes. 223 // Remember the currently pending classes.
222 const Array& class_array = Array::Handle(object_store->pending_classes()); 224 const Array& class_array = Array::Handle(object_store->pending_classes());
223 for (intptr_t i = 0; i < class_array.Length(); i++) { 225 for (intptr_t i = 0; i < class_array.Length(); i++) {
224 // TODO(iposva): Add real checks. 226 // TODO(iposva): Add real checks.
225 cls ^= class_array.At(i); 227 cls ^= class_array.At(i);
226 if (cls.is_finalized() || cls.is_prefinalized()) { 228 if (cls.is_finalized() || cls.is_prefinalized()) {
227 // Pre-finalized bootstrap classes must not define any fields. 229 // Pre-finalized bootstrap classes must not define any fields.
228 ASSERT(Array::Handle(cls.fields()).Length() == 0); 230 ASSERT(Array::Handle(cls.fields()).Length() == 0);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 Class::Handle(core_impl_lib.LookupClass(integer_implementation_name)); 321 Class::Handle(core_impl_lib.LookupClass(integer_implementation_name));
320 const String& growable_object_array_name = 322 const String& growable_object_array_name =
321 String::Handle(String::NewSymbol("GrowableObjectArray")); 323 String::Handle(String::NewSymbol("GrowableObjectArray"));
322 const Class& growable_object_array_class = 324 const Class& growable_object_array_class =
323 Class::Handle(core_impl_lib.LookupClass(growable_object_array_name)); 325 Class::Handle(core_impl_lib.LookupClass(growable_object_array_name));
324 if ((super_class.raw() == object_store->bool_class()) || 326 if ((super_class.raw() == object_store->bool_class()) ||
325 (super_class.raw() == object_store->double_class()) || 327 (super_class.raw() == object_store->double_class()) ||
326 (super_class.raw() == object_store->array_class()) || 328 (super_class.raw() == object_store->array_class()) ||
327 (super_class.raw() == object_store->immutable_array_class()) || 329 (super_class.raw() == object_store->immutable_array_class()) ||
328 (super_class.raw() == growable_object_array_class.raw()) || 330 (super_class.raw() == growable_object_array_class.raw()) ||
331 (super_class.raw() == object_store->byte_buffer_class()) ||
329 (super_class.raw() == integer_implementation_class.raw()) || 332 (super_class.raw() == integer_implementation_class.raw()) ||
330 (super_class.raw() == object_store->smi_class()) || 333 (super_class.raw() == object_store->smi_class()) ||
331 (super_class.raw() == object_store->mint_class()) || 334 (super_class.raw() == object_store->mint_class()) ||
332 (super_class.raw() == object_store->bigint_class()) || 335 (super_class.raw() == object_store->bigint_class()) ||
333 (super_class.raw() == object_store->one_byte_string_class()) || 336 (super_class.raw() == object_store->one_byte_string_class()) ||
334 (super_class.raw() == object_store->two_byte_string_class()) || 337 (super_class.raw() == object_store->two_byte_string_class()) ||
335 (super_class.raw() == object_store->four_byte_string_class())) { 338 (super_class.raw() == object_store->four_byte_string_class())) {
336 ReportError("'%s' is not allowed to extend '%s'\n", 339 ReportError("'%s' is not allowed to extend '%s'\n",
337 String::Handle(cls.Name()).ToCString(), 340 String::Handle(cls.Name()).ToCString(),
338 String::Handle(super_class.Name()).ToCString()); 341 String::Handle(super_class.Name()).ToCString());
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 ASSERT(msg_buffer != NULL); 1157 ASSERT(msg_buffer != NULL);
1155 va_list args; 1158 va_list args;
1156 va_start(args, format); 1159 va_start(args, format);
1157 OS::VSNPrint(msg_buffer, kBufferLength, format, args); 1160 OS::VSNPrint(msg_buffer, kBufferLength, format, args);
1158 va_end(args); 1161 va_end(args);
1159 isolate->long_jump_base()->Jump(1, msg_buffer); 1162 isolate->long_jump_base()->Jump(1, msg_buffer);
1160 UNREACHABLE(); 1163 UNREACHABLE();
1161 } 1164 }
1162 1165
1163 } // namespace dart 1166 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698