OLD | NEW |
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/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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 cls = object_store->external_uint32_array_class(); | 256 cls = object_store->external_uint32_array_class(); |
257 ASSERT(ExternalUint32Array::InstanceSize() == cls.instance_size()); | 257 ASSERT(ExternalUint32Array::InstanceSize() == cls.instance_size()); |
258 cls = object_store->external_int64_array_class(); | 258 cls = object_store->external_int64_array_class(); |
259 ASSERT(ExternalInt64Array::InstanceSize() == cls.instance_size()); | 259 ASSERT(ExternalInt64Array::InstanceSize() == cls.instance_size()); |
260 cls = object_store->external_uint64_array_class(); | 260 cls = object_store->external_uint64_array_class(); |
261 ASSERT(ExternalUint64Array::InstanceSize() == cls.instance_size()); | 261 ASSERT(ExternalUint64Array::InstanceSize() == cls.instance_size()); |
262 cls = object_store->external_float32_array_class(); | 262 cls = object_store->external_float32_array_class(); |
263 ASSERT(ExternalFloat32Array::InstanceSize() == cls.instance_size()); | 263 ASSERT(ExternalFloat32Array::InstanceSize() == cls.instance_size()); |
264 cls = object_store->external_float64_array_class(); | 264 cls = object_store->external_float64_array_class(); |
265 ASSERT(ExternalFloat64Array::InstanceSize() == cls.instance_size()); | 265 ASSERT(ExternalFloat64Array::InstanceSize() == cls.instance_size()); |
| 266 cls = object_store->weak_property_class(); |
| 267 ASSERT(WeakProperty::InstanceSize() == cls.instance_size()); |
266 #endif // defined(DEBUG) | 268 #endif // defined(DEBUG) |
267 | 269 |
268 // Remember the currently pending classes. | 270 // Remember the currently pending classes. |
269 const GrowableObjectArray& class_array = | 271 const GrowableObjectArray& class_array = |
270 GrowableObjectArray::Handle(object_store->pending_classes()); | 272 GrowableObjectArray::Handle(object_store->pending_classes()); |
271 for (intptr_t i = 0; i < class_array.Length(); i++) { | 273 for (intptr_t i = 0; i < class_array.Length(); i++) { |
272 // TODO(iposva): Add real checks. | 274 // TODO(iposva): Add real checks. |
273 cls ^= class_array.At(i); | 275 cls ^= class_array.At(i); |
274 if (cls.is_finalized() || cls.is_prefinalized()) { | 276 if (cls.is_finalized() || cls.is_prefinalized()) { |
275 // Pre-finalized bootstrap classes must not define any fields. | 277 // Pre-finalized bootstrap classes must not define any fields. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 case kExternalInt32ArrayCid: | 369 case kExternalInt32ArrayCid: |
368 case kUint32ArrayCid: | 370 case kUint32ArrayCid: |
369 case kExternalUint32ArrayCid: | 371 case kExternalUint32ArrayCid: |
370 case kInt64ArrayCid: | 372 case kInt64ArrayCid: |
371 case kExternalInt64ArrayCid: | 373 case kExternalInt64ArrayCid: |
372 case kUint64ArrayCid: | 374 case kUint64ArrayCid: |
373 case kExternalUint64ArrayCid: | 375 case kExternalUint64ArrayCid: |
374 case kFloat32ArrayCid: | 376 case kFloat32ArrayCid: |
375 case kExternalFloat32ArrayCid: | 377 case kExternalFloat32ArrayCid: |
376 case kFloat64ArrayCid: | 378 case kFloat64ArrayCid: |
377 case kExternalFloat64ArrayCid: { | 379 case kExternalFloat64ArrayCid: |
| 380 case kWeakPropertyCid: { |
378 const Script& script = Script::Handle(cls.script()); | 381 const Script& script = Script::Handle(cls.script()); |
379 ReportError(script, cls.token_pos(), | 382 ReportError(script, cls.token_pos(), |
380 "'%s' is not allowed to extend '%s'", | 383 "'%s' is not allowed to extend '%s'", |
381 String::Handle(cls.Name()).ToCString(), | 384 String::Handle(cls.Name()).ToCString(), |
382 String::Handle(super_class.Name()).ToCString()); | 385 String::Handle(super_class.Name()).ToCString()); |
383 break; | 386 break; |
384 } | 387 } |
385 default: break; | 388 default: break; |
386 } | 389 } |
387 } | 390 } |
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 void ClassFinalizer::ReportError(const char* format, ...) { | 1507 void ClassFinalizer::ReportError(const char* format, ...) { |
1505 va_list args; | 1508 va_list args; |
1506 va_start(args, format); | 1509 va_start(args, format); |
1507 const Error& error = Error::Handle( | 1510 const Error& error = Error::Handle( |
1508 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); | 1511 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); |
1509 va_end(args); | 1512 va_end(args); |
1510 ReportError(error); | 1513 ReportError(error); |
1511 } | 1514 } |
1512 | 1515 |
1513 } // namespace dart | 1516 } // namespace dart |
OLD | NEW |