| 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 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 | 1422 |
| 1423 ConstantInstr* constant_type_args = | 1423 ConstantInstr* constant_type_args = |
| 1424 instantiator_type_arguments()->definition()->AsConstant(); | 1424 instantiator_type_arguments()->definition()->AsConstant(); |
| 1425 if (constant_type_args != NULL && | 1425 if (constant_type_args != NULL && |
| 1426 !constant_type_args->value().IsNull() && | 1426 !constant_type_args->value().IsNull() && |
| 1427 constant_type_args->value().IsTypeArguments()) { | 1427 constant_type_args->value().IsTypeArguments()) { |
| 1428 const TypeArguments& instantiator_type_args = | 1428 const TypeArguments& instantiator_type_args = |
| 1429 TypeArguments::Cast(constant_type_args->value()); | 1429 TypeArguments::Cast(constant_type_args->value()); |
| 1430 const AbstractType& new_dst_type = AbstractType::Handle( | 1430 const AbstractType& new_dst_type = AbstractType::Handle( |
| 1431 dst_type().InstantiateFrom(instantiator_type_args, NULL)); | 1431 dst_type().InstantiateFrom(instantiator_type_args, NULL)); |
| 1432 // If dst_type is instantiated to dynamic or Object, skip the test. |
| 1433 if (!new_dst_type.IsMalformed() && !new_dst_type.IsMalbounded() && |
| 1434 (new_dst_type.IsDynamicType() || new_dst_type.IsObjectType())) { |
| 1435 return value()->definition(); |
| 1436 } |
| 1432 set_dst_type(AbstractType::ZoneHandle(new_dst_type.Canonicalize())); | 1437 set_dst_type(AbstractType::ZoneHandle(new_dst_type.Canonicalize())); |
| 1438 if (FLAG_eliminate_type_checks && |
| 1439 value()->Type()->IsAssignableTo(dst_type())) { |
| 1440 return value()->definition(); |
| 1441 } |
| 1433 ConstantInstr* null_constant = flow_graph->constant_null(); | 1442 ConstantInstr* null_constant = flow_graph->constant_null(); |
| 1434 instantiator_type_arguments()->BindTo(null_constant); | 1443 instantiator_type_arguments()->BindTo(null_constant); |
| 1435 } | 1444 } |
| 1436 return this; | 1445 return this; |
| 1437 } | 1446 } |
| 1438 | 1447 |
| 1439 | 1448 |
| 1440 Definition* BoxDoubleInstr::Canonicalize(FlowGraph* flow_graph) { | 1449 Definition* BoxDoubleInstr::Canonicalize(FlowGraph* flow_graph) { |
| 1441 if (input_use_list() == NULL) { | 1450 if (input_use_list() == NULL) { |
| 1442 // Environments can accomodate any representation. No need to box. | 1451 // Environments can accomodate any representation. No need to box. |
| (...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2693 return kCosRuntimeEntry; | 2702 return kCosRuntimeEntry; |
| 2694 default: | 2703 default: |
| 2695 UNREACHABLE(); | 2704 UNREACHABLE(); |
| 2696 } | 2705 } |
| 2697 return kSinRuntimeEntry; | 2706 return kSinRuntimeEntry; |
| 2698 } | 2707 } |
| 2699 | 2708 |
| 2700 #undef __ | 2709 #undef __ |
| 2701 | 2710 |
| 2702 } // namespace dart | 2711 } // namespace dart |
| OLD | NEW |