| 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/code_generator.h" | 7 #include "vm/code_generator.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 ASSERT((cls_type_params.IsNull() && (num_type_params == 0)) || | 631 ASSERT((cls_type_params.IsNull() && (num_type_params == 0)) || |
| 632 (cls_type_params.Length() == num_type_params)); | 632 (cls_type_params.Length() == num_type_params)); |
| 633 // In case of overlapping type argument vectors, the same type argument may | 633 // In case of overlapping type argument vectors, the same type argument may |
| 634 // get checked against different bounds. | 634 // get checked against different bounds. |
| 635 for (intptr_t i = 0; i < num_type_params; i++) { | 635 for (intptr_t i = 0; i < num_type_params; i++) { |
| 636 type_arg = arguments.TypeAt(offset + i); | 636 type_arg = arguments.TypeAt(offset + i); |
| 637 if (type_arg.IsDynamicType()) { | 637 if (type_arg.IsDynamicType()) { |
| 638 continue; | 638 continue; |
| 639 } | 639 } |
| 640 ASSERT(type_arg.IsFinalized()); | 640 ASSERT(type_arg.IsFinalized()); |
| 641 if (type_arg.IsMalbounded()) { |
| 642 // The type argument itself is already malbounded, independently of the |
| 643 // declared bound, which may be Object. |
| 644 // Propagate the bound error from the type argument to the type. |
| 645 if (bound_error->IsNull()) { |
| 646 *bound_error = type_arg.error(); |
| 647 ASSERT(!bound_error->IsNull()); |
| 648 } |
| 649 } |
| 641 cls_type_param = cls_type_params.TypeAt(i); | 650 cls_type_param = cls_type_params.TypeAt(i); |
| 642 const TypeParameter& type_param = TypeParameter::Cast(cls_type_param); | 651 const TypeParameter& type_param = TypeParameter::Cast(cls_type_param); |
| 643 ASSERT(type_param.IsFinalized()); | 652 ASSERT(type_param.IsFinalized()); |
| 644 declared_bound = type_param.bound(); | 653 declared_bound = type_param.bound(); |
| 645 if (!declared_bound.IsObjectType() && !declared_bound.IsDynamicType()) { | 654 if (!declared_bound.IsObjectType() && !declared_bound.IsDynamicType()) { |
| 646 if (!declared_bound.IsFinalized() && !declared_bound.IsBeingFinalized()) { | 655 if (!declared_bound.IsFinalized() && !declared_bound.IsBeingFinalized()) { |
| 647 declared_bound = FinalizeType(cls, declared_bound, kCanonicalize); | 656 declared_bound = FinalizeType(cls, declared_bound, kCanonicalize); |
| 648 type_param.set_bound(declared_bound); | 657 type_param.set_bound(declared_bound); |
| 649 } | 658 } |
| 650 ASSERT(declared_bound.IsFinalized() || declared_bound.IsBeingFinalized()); | 659 ASSERT(declared_bound.IsFinalized() || declared_bound.IsBeingFinalized()); |
| (...skipping 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2846 expected_name ^= String::New("_offset"); | 2855 expected_name ^= String::New("_offset"); |
| 2847 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 2856 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
| 2848 field ^= fields_array.At(2); | 2857 field ^= fields_array.At(2); |
| 2849 ASSERT(field.Offset() == TypedDataView::length_offset()); | 2858 ASSERT(field.Offset() == TypedDataView::length_offset()); |
| 2850 name ^= field.name(); | 2859 name ^= field.name(); |
| 2851 ASSERT(name.Equals("length")); | 2860 ASSERT(name.Equals("length")); |
| 2852 #endif | 2861 #endif |
| 2853 } | 2862 } |
| 2854 | 2863 |
| 2855 } // namespace dart | 2864 } // namespace dart |
| OLD | NEW |