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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
6 | 6 |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/flow_graph_allocator.h" | 10 #include "vm/flow_graph_allocator.h" |
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1432 ConstantInstr* constant_type_args = | 1432 ConstantInstr* constant_type_args = |
1433 instantiator_type_arguments()->definition()->AsConstant(); | 1433 instantiator_type_arguments()->definition()->AsConstant(); |
1434 if (constant_type_args != NULL && | 1434 if (constant_type_args != NULL && |
1435 !constant_type_args->value().IsNull() && | 1435 !constant_type_args->value().IsNull() && |
1436 constant_type_args->value().IsTypeArguments()) { | 1436 constant_type_args->value().IsTypeArguments()) { |
1437 const TypeArguments& instantiator_type_args = | 1437 const TypeArguments& instantiator_type_args = |
1438 TypeArguments::Cast(constant_type_args->value()); | 1438 TypeArguments::Cast(constant_type_args->value()); |
1439 const AbstractType& new_dst_type = AbstractType::Handle( | 1439 const AbstractType& new_dst_type = AbstractType::Handle( |
1440 dst_type().InstantiateFrom(instantiator_type_args, NULL)); | 1440 dst_type().InstantiateFrom(instantiator_type_args, NULL)); |
1441 // If dst_type is instantiated to dynamic or Object, skip the test. | 1441 // If dst_type is instantiated to dynamic or Object, skip the test. |
1442 if (!new_dst_type.IsMalformed() && !new_dst_type.IsMalbounded() && | 1442 if (!new_dst_type.IsMalformedOrMalbounded() && |
1443 (new_dst_type.IsDynamicType() || new_dst_type.IsObjectType())) { | 1443 (new_dst_type.IsDynamicType() || new_dst_type.IsObjectType())) { |
1444 return value()->definition(); | 1444 return value()->definition(); |
1445 } | 1445 } |
1446 set_dst_type(AbstractType::ZoneHandle(new_dst_type.Canonicalize())); | 1446 set_dst_type(AbstractType::ZoneHandle(new_dst_type.Canonicalize())); |
1447 if (FLAG_eliminate_type_checks && | 1447 if (FLAG_eliminate_type_checks && |
1448 value()->Type()->IsAssignableTo(dst_type())) { | 1448 value()->Type()->IsAssignableTo(dst_type())) { |
1449 return value()->definition(); | 1449 return value()->definition(); |
1450 } | 1450 } |
1451 ConstantInstr* null_constant = flow_graph->constant_null(); | 1451 ConstantInstr* null_constant = flow_graph->constant_null(); |
1452 instantiator_type_arguments()->BindTo(null_constant); | 1452 instantiator_type_arguments()->BindTo(null_constant); |
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2944 return kCosRuntimeEntry; | 2944 return kCosRuntimeEntry; |
2945 default: | 2945 default: |
2946 UNREACHABLE(); | 2946 UNREACHABLE(); |
2947 } | 2947 } |
2948 return kSinRuntimeEntry; | 2948 return kSinRuntimeEntry; |
2949 } | 2949 } |
2950 | 2950 |
2951 #undef __ | 2951 #undef __ |
2952 | 2952 |
2953 } // namespace dart | 2953 } // namespace dart |
OLD | NEW |