| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/flow_graph_allocator.h" | 9 #include "vm/flow_graph_allocator.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| 11 #include "vm/flow_graph_compiler.h" | 11 #include "vm/flow_graph_compiler.h" |
| 12 #include "vm/flow_graph_optimizer.h" | 12 #include "vm/flow_graph_optimizer.h" |
| 13 #include "vm/locations.h" | 13 #include "vm/locations.h" |
| 14 #include "vm/object.h" | 14 #include "vm/object.h" |
| 15 #include "vm/object_store.h" | 15 #include "vm/object_store.h" |
| 16 #include "vm/os.h" | 16 #include "vm/os.h" |
| 17 #include "vm/scopes.h" | 17 #include "vm/scopes.h" |
| 18 #include "vm/stub_code.h" | 18 #include "vm/stub_code.h" |
| 19 #include "vm/symbols.h" | 19 #include "vm/symbols.h" |
| 20 | 20 |
| 21 namespace dart { | 21 namespace dart { |
| 22 | 22 |
| 23 DECLARE_FLAG(bool, enable_type_checks); | 23 DECLARE_FLAG(bool, enable_type_checks); |
| 24 | 24 DECLARE_FLAG(int, max_polymorphic_checks); |
| 25 | 25 |
| 26 Definition::Definition() | 26 Definition::Definition() |
| 27 : range_(NULL), | 27 : range_(NULL), |
| 28 temp_index_(-1), | 28 temp_index_(-1), |
| 29 ssa_temp_index_(-1), | 29 ssa_temp_index_(-1), |
| 30 propagated_type_(AbstractType::Handle()), | 30 propagated_type_(AbstractType::Handle()), |
| 31 propagated_cid_(kIllegalCid), | 31 propagated_cid_(kIllegalCid), |
| 32 input_use_list_(NULL), | 32 input_use_list_(NULL), |
| 33 env_use_list_(NULL), | 33 env_use_list_(NULL), |
| 34 use_kind_(kValue), // Phis and parameters rely on this default. | 34 use_kind_(kValue), // Phis and parameters rely on this default. |
| (...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 if ((receiver_class_id() == kSmiCid) || | 1067 if ((receiver_class_id() == kSmiCid) || |
| 1068 (receiver_class_id() == kDoubleCid) || | 1068 (receiver_class_id() == kDoubleCid) || |
| 1069 (receiver_class_id() == kNumberCid)) { | 1069 (receiver_class_id() == kNumberCid)) { |
| 1070 // Known/library equalities that are guaranteed to return Boolean. | 1070 // Known/library equalities that are guaranteed to return Boolean. |
| 1071 return kBoolCid; | 1071 return kBoolCid; |
| 1072 } | 1072 } |
| 1073 return kDynamicCid; | 1073 return kDynamicCid; |
| 1074 } | 1074 } |
| 1075 | 1075 |
| 1076 | 1076 |
| 1077 bool EqualityCompareInstr::IsPolymorphic() const { |
| 1078 return HasICData() && |
| 1079 (ic_data()->NumberOfChecks() > 0) && |
| 1080 (ic_data()->NumberOfChecks() <= FLAG_max_polymorphic_checks); |
| 1081 } |
| 1082 |
| 1083 |
| 1077 RawAbstractType* RelationalOpInstr::CompileType() const { | 1084 RawAbstractType* RelationalOpInstr::CompileType() const { |
| 1078 if ((operands_class_id() == kSmiCid) || | 1085 if ((operands_class_id() == kSmiCid) || |
| 1079 (operands_class_id() == kDoubleCid) || | 1086 (operands_class_id() == kDoubleCid) || |
| 1080 (operands_class_id() == kNumberCid)) { | 1087 (operands_class_id() == kNumberCid)) { |
| 1081 // Known/library relational ops that are guaranteed to return Boolean. | 1088 // Known/library relational ops that are guaranteed to return Boolean. |
| 1082 return Type::BoolType(); | 1089 return Type::BoolType(); |
| 1083 } | 1090 } |
| 1084 return Type::DynamicType(); | 1091 return Type::DynamicType(); |
| 1085 } | 1092 } |
| 1086 | 1093 |
| (...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2563 } while (CanonicalizeMaxBoundary(&max) || CanonicalizeMinBoundary(&length)); | 2570 } while (CanonicalizeMaxBoundary(&max) || CanonicalizeMinBoundary(&length)); |
| 2564 | 2571 |
| 2565 // Failed to prove that maximum is bounded with array length. | 2572 // Failed to prove that maximum is bounded with array length. |
| 2566 return false; | 2573 return false; |
| 2567 } | 2574 } |
| 2568 | 2575 |
| 2569 | 2576 |
| 2570 #undef __ | 2577 #undef __ |
| 2571 | 2578 |
| 2572 } // namespace dart | 2579 } // namespace dart |
| OLD | NEW |