| 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/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1552 // Return a TypeParameter if the type_name is a type parameter of this class. | 1552 // Return a TypeParameter if the type_name is a type parameter of this class. |
| 1553 // Return null otherwise. | 1553 // Return null otherwise. |
| 1554 RawTypeParameter* Class::LookupTypeParameter(const String& type_name, | 1554 RawTypeParameter* Class::LookupTypeParameter(const String& type_name, |
| 1555 intptr_t token_pos) const { | 1555 intptr_t token_pos) const { |
| 1556 ASSERT(!type_name.IsNull()); | 1556 ASSERT(!type_name.IsNull()); |
| 1557 const TypeArguments& type_params = TypeArguments::Handle(type_parameters()); | 1557 const TypeArguments& type_params = TypeArguments::Handle(type_parameters()); |
| 1558 if (!type_params.IsNull()) { | 1558 if (!type_params.IsNull()) { |
| 1559 intptr_t num_type_params = type_params.Length(); | 1559 intptr_t num_type_params = type_params.Length(); |
| 1560 TypeParameter& type_param = TypeParameter::Handle(); | 1560 TypeParameter& type_param = TypeParameter::Handle(); |
| 1561 String& type_param_name = String::Handle(); | 1561 String& type_param_name = String::Handle(); |
| 1562 AbstractType& bound = AbstractType::Handle(); | 1562 // TODO(regis): We do not copy the bound (= type_param.bound()), since |
| 1563 // we are not able to finalize the bounds of type parameter references |
| 1564 // without getting into cycles. Revisit. |
| 1565 const AbstractType& bound = AbstractType::Handle( |
| 1566 Isolate::Current()->object_store()->object_type()); |
| 1563 for (intptr_t i = 0; i < num_type_params; i++) { | 1567 for (intptr_t i = 0; i < num_type_params; i++) { |
| 1564 type_param ^= type_params.TypeAt(i); | 1568 type_param ^= type_params.TypeAt(i); |
| 1565 type_param_name = type_param.name(); | 1569 type_param_name = type_param.name(); |
| 1566 if (type_param_name.Equals(type_name)) { | 1570 if (type_param_name.Equals(type_name)) { |
| 1567 intptr_t index = type_param.index(); | 1571 intptr_t index = type_param.index(); |
| 1568 bound = type_param.bound(); | |
| 1569 // Create a non-finalized new TypeParameter with the given token_pos. | 1572 // Create a non-finalized new TypeParameter with the given token_pos. |
| 1570 if (type_param.IsFinalized()) { | 1573 if (type_param.IsFinalized()) { |
| 1571 // The index was adjusted during finalization. Revert. | 1574 // The index was adjusted during finalization. Revert. |
| 1572 index -= NumTypeArguments() - num_type_params; | 1575 index -= NumTypeArguments() - num_type_params; |
| 1573 } else { | 1576 } else { |
| 1574 ASSERT(type_param.index() == i); | 1577 ASSERT(type_param.index() == i); |
| 1575 } | 1578 } |
| 1576 return TypeParameter::New(*this, index, type_name, bound, token_pos); | 1579 return TypeParameter::New(*this, index, type_name, bound, token_pos); |
| 1577 } | 1580 } |
| 1578 } | 1581 } |
| (...skipping 10314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11893 } | 11896 } |
| 11894 return result.raw(); | 11897 return result.raw(); |
| 11895 } | 11898 } |
| 11896 | 11899 |
| 11897 | 11900 |
| 11898 const char* WeakProperty::ToCString() const { | 11901 const char* WeakProperty::ToCString() const { |
| 11899 return "_WeakProperty"; | 11902 return "_WeakProperty"; |
| 11900 } | 11903 } |
| 11901 | 11904 |
| 11902 } // namespace dart | 11905 } // namespace dart |
| OLD | NEW |