| OLD | NEW |
| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 ASSERT(Double::InstanceSize() == cls.instance_size()); | 217 ASSERT(Double::InstanceSize() == cls.instance_size()); |
| 218 cls = object_store->mint_class(); | 218 cls = object_store->mint_class(); |
| 219 ASSERT(Mint::InstanceSize() == cls.instance_size()); | 219 ASSERT(Mint::InstanceSize() == cls.instance_size()); |
| 220 cls = object_store->bigint_class(); | 220 cls = object_store->bigint_class(); |
| 221 ASSERT(Bigint::InstanceSize() == cls.instance_size()); | 221 ASSERT(Bigint::InstanceSize() == cls.instance_size()); |
| 222 cls = object_store->bool_class(); | 222 cls = object_store->bool_class(); |
| 223 ASSERT(Bool::InstanceSize() == cls.instance_size()); | 223 ASSERT(Bool::InstanceSize() == cls.instance_size()); |
| 224 cls = object_store->array_class(); | 224 cls = object_store->array_class(); |
| 225 ASSERT(Array::InstanceSize() == cls.instance_size()); | 225 ASSERT(Array::InstanceSize() == cls.instance_size()); |
| 226 cls = object_store->immutable_array_class(); | 226 cls = object_store->immutable_array_class(); |
| 227 ASSERT(Array::InstanceSize() == cls.instance_size()); | 227 ASSERT(ImmutableArray::InstanceSize() == cls.instance_size()); |
| 228 cls = object_store->byte_buffer_class(); | 228 cls = object_store->internal_byte_array_class(); |
| 229 ASSERT(ByteBuffer::InstanceSize() == cls.instance_size()); | 229 ASSERT(InternalByteArray::InstanceSize() == cls.instance_size()); |
| 230 cls = object_store->external_byte_array_class(); |
| 231 ASSERT(ExternalByteArray::InstanceSize() == cls.instance_size()); |
| 230 #endif // defined(DEBUG) | 232 #endif // defined(DEBUG) |
| 231 | 233 |
| 232 // Remember the currently pending classes. | 234 // Remember the currently pending classes. |
| 233 const Array& class_array = Array::Handle(object_store->pending_classes()); | 235 const Array& class_array = Array::Handle(object_store->pending_classes()); |
| 234 for (intptr_t i = 0; i < class_array.Length(); i++) { | 236 for (intptr_t i = 0; i < class_array.Length(); i++) { |
| 235 // TODO(iposva): Add real checks. | 237 // TODO(iposva): Add real checks. |
| 236 cls ^= class_array.At(i); | 238 cls ^= class_array.At(i); |
| 237 if (cls.is_finalized() || cls.is_prefinalized()) { | 239 if (cls.is_finalized() || cls.is_prefinalized()) { |
| 238 // Pre-finalized bootstrap classes must not define any fields. | 240 // Pre-finalized bootstrap classes must not define any fields. |
| 239 ASSERT(Array::Handle(cls.fields()).Length() == 0); | 241 ASSERT(Array::Handle(cls.fields()).Length() == 0); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 Class::Handle(core_impl_lib.LookupClass(integer_implementation_name)); | 327 Class::Handle(core_impl_lib.LookupClass(integer_implementation_name)); |
| 326 const String& growable_object_array_name = | 328 const String& growable_object_array_name = |
| 327 String::Handle(String::NewSymbol("GrowableObjectArray")); | 329 String::Handle(String::NewSymbol("GrowableObjectArray")); |
| 328 const Class& growable_object_array_class = | 330 const Class& growable_object_array_class = |
| 329 Class::Handle(core_impl_lib.LookupClass(growable_object_array_name)); | 331 Class::Handle(core_impl_lib.LookupClass(growable_object_array_name)); |
| 330 if ((super_class.raw() == object_store->bool_class()) || | 332 if ((super_class.raw() == object_store->bool_class()) || |
| 331 (super_class.raw() == object_store->double_class()) || | 333 (super_class.raw() == object_store->double_class()) || |
| 332 (super_class.raw() == object_store->array_class()) || | 334 (super_class.raw() == object_store->array_class()) || |
| 333 (super_class.raw() == object_store->immutable_array_class()) || | 335 (super_class.raw() == object_store->immutable_array_class()) || |
| 334 (super_class.raw() == growable_object_array_class.raw()) || | 336 (super_class.raw() == growable_object_array_class.raw()) || |
| 335 (super_class.raw() == object_store->byte_buffer_class()) || | 337 (super_class.raw() == object_store->internal_byte_array_class()) || |
| 338 (super_class.raw() == object_store->external_byte_array_class()) || |
| 336 (super_class.raw() == integer_implementation_class.raw()) || | 339 (super_class.raw() == integer_implementation_class.raw()) || |
| 337 (super_class.raw() == object_store->smi_class()) || | 340 (super_class.raw() == object_store->smi_class()) || |
| 338 (super_class.raw() == object_store->mint_class()) || | 341 (super_class.raw() == object_store->mint_class()) || |
| 339 (super_class.raw() == object_store->bigint_class()) || | 342 (super_class.raw() == object_store->bigint_class()) || |
| 340 (super_class.raw() == object_store->one_byte_string_class()) || | 343 (super_class.raw() == object_store->one_byte_string_class()) || |
| 341 (super_class.raw() == object_store->two_byte_string_class()) || | 344 (super_class.raw() == object_store->two_byte_string_class()) || |
| 342 (super_class.raw() == object_store->four_byte_string_class())) { | 345 (super_class.raw() == object_store->four_byte_string_class())) { |
| 343 const Script& script = Script::Handle(cls.script()); | 346 const Script& script = Script::Handle(cls.script()); |
| 344 ReportError(script, -1, | 347 ReportError(script, -1, |
| 345 "'%s' is not allowed to extend '%s'\n", | 348 "'%s' is not allowed to extend '%s'\n", |
| (...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1295 va_end(args); | 1298 va_end(args); |
| 1296 if (FLAG_warning_as_error) { | 1299 if (FLAG_warning_as_error) { |
| 1297 Isolate::Current()->long_jump_base()->Jump(1, error); | 1300 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 1298 UNREACHABLE(); | 1301 UNREACHABLE(); |
| 1299 } else { | 1302 } else { |
| 1300 OS::Print("%s", error.ToErrorCString()); | 1303 OS::Print("%s", error.ToErrorCString()); |
| 1301 } | 1304 } |
| 1302 } | 1305 } |
| 1303 | 1306 |
| 1304 } // namespace dart | 1307 } // namespace dart |
| OLD | NEW |