| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 271 } |
| 272 return resolved_class.raw(); | 272 return resolved_class.raw(); |
| 273 } | 273 } |
| 274 | 274 |
| 275 | 275 |
| 276 | 276 |
| 277 void ClassFinalizer::ResolveRedirectingFactory(const Class& cls, | 277 void ClassFinalizer::ResolveRedirectingFactory(const Class& cls, |
| 278 const Function& factory) { | 278 const Function& factory) { |
| 279 const Function& target = Function::Handle(factory.RedirectionTarget()); | 279 const Function& target = Function::Handle(factory.RedirectionTarget()); |
| 280 if (target.IsNull()) { | 280 if (target.IsNull()) { |
| 281 const Type& type = Type::Handle(factory.RedirectionType()); | 281 Type& type = Type::Handle(factory.RedirectionType()); |
| 282 if (!type.IsMalformed()) { | 282 if (!type.IsMalformed()) { |
| 283 const GrowableObjectArray& visited_factories = | 283 const GrowableObjectArray& visited_factories = |
| 284 GrowableObjectArray::Handle(GrowableObjectArray::New()); | 284 GrowableObjectArray::Handle(GrowableObjectArray::New()); |
| 285 ResolveRedirectingFactoryTarget(cls, factory, visited_factories); | 285 ResolveRedirectingFactoryTarget(cls, factory, visited_factories); |
| 286 } | 286 } |
| 287 if (factory.is_const()) { |
| 288 type = factory.RedirectionType(); |
| 289 if (type.IsMalformed()) { |
| 290 ReportError(Error::Handle(type.malformed_error())); |
| 291 } |
| 292 } |
| 287 } | 293 } |
| 288 } | 294 } |
| 289 | 295 |
| 290 | 296 |
| 291 void ClassFinalizer::ResolveRedirectingFactoryTarget( | 297 void ClassFinalizer::ResolveRedirectingFactoryTarget( |
| 292 const Class& cls, | 298 const Class& cls, |
| 293 const Function& factory, | 299 const Function& factory, |
| 294 const GrowableObjectArray& visited_factories) { | 300 const GrowableObjectArray& visited_factories) { |
| 295 ASSERT(factory.IsRedirectingFactory()); | 301 ASSERT(factory.IsRedirectingFactory()); |
| 296 | 302 |
| (...skipping 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2651 expected_name ^= String::New("_offset"); | 2657 expected_name ^= String::New("_offset"); |
| 2652 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 2658 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
| 2653 field ^= fields_array.At(2); | 2659 field ^= fields_array.At(2); |
| 2654 ASSERT(field.Offset() == TypedDataView::length_offset()); | 2660 ASSERT(field.Offset() == TypedDataView::length_offset()); |
| 2655 name ^= field.name(); | 2661 name ^= field.name(); |
| 2656 ASSERT(name.Equals("length")); | 2662 ASSERT(name.Equals("length")); |
| 2657 #endif | 2663 #endif |
| 2658 } | 2664 } |
| 2659 | 2665 |
| 2660 } // namespace dart | 2666 } // namespace dart |
| OLD | NEW |