| 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/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 15637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15648 isolate, Array::Grow(canonical_types, new_length, Heap::kOld)); | 15648 isolate, Array::Grow(canonical_types, new_length, Heap::kOld)); |
| 15649 cls.set_canonical_types(new_canonical_types); | 15649 cls.set_canonical_types(new_canonical_types); |
| 15650 new_canonical_types.SetAt(index, *this); | 15650 new_canonical_types.SetAt(index, *this); |
| 15651 } else { | 15651 } else { |
| 15652 canonical_types.SetAt(index, *this); | 15652 canonical_types.SetAt(index, *this); |
| 15653 } | 15653 } |
| 15654 #ifdef DEBUG | 15654 #ifdef DEBUG |
| 15655 if ((index == 0) && cls.IsCanonicalSignatureClass()) { | 15655 if ((index == 0) && cls.IsCanonicalSignatureClass()) { |
| 15656 // Verify that the first canonical type is the signature type by checking | 15656 // Verify that the first canonical type is the signature type by checking |
| 15657 // that the type argument vector of the canonical type ends with the | 15657 // that the type argument vector of the canonical type ends with the |
| 15658 // uninstantiated type parameters of the signature class. | 15658 // uninstantiated type parameters of the signature class. Note that these |
| 15659 // type parameters may be bounded if the super class of the owner class |
| 15660 // declares bounds. |
| 15659 // The signature type is finalized during class finalization, before the | 15661 // The signature type is finalized during class finalization, before the |
| 15660 // optimizer may canonicalize instantiated function types of the same | 15662 // optimizer may canonicalize instantiated function types of the same |
| 15661 // signature class. | 15663 // signature class. |
| 15662 // Although the signature class extends class Instance, the type arguments | 15664 // Although the signature class extends class Instance, the type arguments |
| 15663 // of the super class of the owner class of its signature function will be | 15665 // of the super class of the owner class of its signature function will be |
| 15664 // prepended to the type argument vector during class finalization. | 15666 // prepended to the type argument vector during class finalization. |
| 15665 const TypeArguments& type_params = | 15667 const TypeArguments& type_params = |
| 15666 TypeArguments::Handle(isolate, cls.type_parameters()); | 15668 TypeArguments::Handle(isolate, cls.type_parameters()); |
| 15667 const intptr_t num_type_params = cls.NumTypeParameters(); | 15669 const intptr_t num_type_params = cls.NumTypeParameters(); |
| 15668 const intptr_t num_type_args = cls.NumTypeArguments(); | 15670 const intptr_t num_type_args = cls.NumTypeArguments(); |
| 15669 TypeParameter& type_arg = TypeParameter::Handle(isolate); | 15671 AbstractType& type_arg = AbstractType::Handle(isolate); |
| 15670 TypeParameter& type_param = TypeParameter::Handle(isolate); | 15672 TypeParameter& type_param = TypeParameter::Handle(isolate); |
| 15671 for (intptr_t i = 0; i < num_type_params; i++) { | 15673 for (intptr_t i = 0; i < num_type_params; i++) { |
| 15672 type_arg ^= type_args.TypeAt(num_type_args - num_type_params + i); | 15674 type_arg = type_args.TypeAt(num_type_args - num_type_params + i); |
| 15675 while (type_arg.IsBoundedType()) { |
| 15676 type_arg = BoundedType::Cast(type_arg).type(); |
| 15677 } |
| 15673 type_param ^= type_params.TypeAt(i); | 15678 type_param ^= type_params.TypeAt(i); |
| 15674 ASSERT(type_arg.Equals(type_param)); | 15679 ASSERT(type_arg.Equals(type_param)); |
| 15675 } | 15680 } |
| 15676 } | 15681 } |
| 15677 #endif | 15682 #endif |
| 15678 ASSERT(IsOld()); | 15683 ASSERT(IsOld()); |
| 15679 ASSERT(type_args.IsNull() || type_args.IsOld()); | 15684 ASSERT(type_args.IsNull() || type_args.IsOld()); |
| 15680 SetCanonical(); | 15685 SetCanonical(); |
| 15681 return this->raw(); | 15686 return this->raw(); |
| 15682 } | 15687 } |
| (...skipping 5654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21337 return tag_label.ToCString(); | 21342 return tag_label.ToCString(); |
| 21338 } | 21343 } |
| 21339 | 21344 |
| 21340 | 21345 |
| 21341 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21346 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 21342 Instance::PrintJSONImpl(stream, ref); | 21347 Instance::PrintJSONImpl(stream, ref); |
| 21343 } | 21348 } |
| 21344 | 21349 |
| 21345 | 21350 |
| 21346 } // namespace dart | 21351 } // namespace dart |
| OLD | NEW |