| 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" |
| 11 #include "vm/flow_graph_builder.h" | 11 #include "vm/flow_graph_builder.h" |
| 12 #include "vm/flow_graph_compiler.h" | 12 #include "vm/flow_graph_compiler.h" |
| 13 #include "vm/flow_graph_optimizer.h" | 13 #include "vm/flow_graph_optimizer.h" |
| 14 #include "vm/locations.h" | 14 #include "vm/locations.h" |
| 15 #include "vm/object.h" | 15 #include "vm/object.h" |
| 16 #include "vm/object_store.h" | 16 #include "vm/object_store.h" |
| 17 #include "vm/os.h" | 17 #include "vm/os.h" |
| 18 #include "vm/scopes.h" | 18 #include "vm/scopes.h" |
| 19 #include "vm/stub_code.h" | 19 #include "vm/stub_code.h" |
| 20 #include "vm/symbols.h" | 20 #include "vm/symbols.h" |
| 21 | 21 |
| 22 namespace dart { | 22 namespace dart { |
| 23 | 23 |
| 24 DEFINE_FLAG(int, max_equality_polymorphic_checks, 32, |
| 25 "Maximum number of polymorphic checks in equality operator," |
| 26 " otherwise use megamorphic dispatch."); |
| 24 DEFINE_FLAG(bool, new_identity_spec, true, | 27 DEFINE_FLAG(bool, new_identity_spec, true, |
| 25 "Use new identity check rules for numbers."); | 28 "Use new identity check rules for numbers."); |
| 26 DEFINE_FLAG(bool, propagate_ic_data, true, | 29 DEFINE_FLAG(bool, propagate_ic_data, true, |
| 27 "Propagate IC data from unoptimized to optimized IC calls."); | 30 "Propagate IC data from unoptimized to optimized IC calls."); |
| 28 DECLARE_FLAG(bool, enable_type_checks); | 31 DECLARE_FLAG(bool, enable_type_checks); |
| 29 DECLARE_FLAG(bool, eliminate_type_checks); | 32 DECLARE_FLAG(bool, eliminate_type_checks); |
| 30 DECLARE_FLAG(int, max_polymorphic_checks); | 33 DECLARE_FLAG(int, max_polymorphic_checks); |
| 31 DECLARE_FLAG(bool, trace_optimization); | 34 DECLARE_FLAG(bool, trace_optimization); |
| 32 DECLARE_FLAG(bool, trace_constant_propagation); | 35 DECLARE_FLAG(bool, trace_constant_propagation); |
| 33 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); | 36 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 } | 1030 } |
| 1028 | 1031 |
| 1029 | 1032 |
| 1030 bool EqualityCompareInstr::IsPolymorphic() const { | 1033 bool EqualityCompareInstr::IsPolymorphic() const { |
| 1031 return HasICData() && | 1034 return HasICData() && |
| 1032 (ic_data()->NumberOfChecks() > 0) && | 1035 (ic_data()->NumberOfChecks() > 0) && |
| 1033 (ic_data()->NumberOfChecks() <= FLAG_max_polymorphic_checks); | 1036 (ic_data()->NumberOfChecks() <= FLAG_max_polymorphic_checks); |
| 1034 } | 1037 } |
| 1035 | 1038 |
| 1036 | 1039 |
| 1040 bool EqualityCompareInstr::IsCheckedStrictEqual() const { |
| 1041 if (!HasICData()) return false; |
| 1042 return ic_data()->AllTargetsHaveSameOwner(kInstanceCid) && |
| 1043 (unary_ic_data_->NumberOfChecks() <= |
| 1044 FLAG_max_equality_polymorphic_checks); |
| 1045 } |
| 1046 |
| 1047 |
| 1037 bool BinarySmiOpInstr::CanDeoptimize() const { | 1048 bool BinarySmiOpInstr::CanDeoptimize() const { |
| 1038 if (FLAG_throw_on_javascript_int_overflow) return true; | 1049 if (FLAG_throw_on_javascript_int_overflow) return true; |
| 1039 switch (op_kind()) { | 1050 switch (op_kind()) { |
| 1040 case Token::kBIT_AND: | 1051 case Token::kBIT_AND: |
| 1041 case Token::kBIT_OR: | 1052 case Token::kBIT_OR: |
| 1042 case Token::kBIT_XOR: | 1053 case Token::kBIT_XOR: |
| 1043 return false; | 1054 return false; |
| 1044 case Token::kSHR: { | 1055 case Token::kSHR: { |
| 1045 // Can't deopt if shift-count is known positive. | 1056 // Can't deopt if shift-count is known positive. |
| 1046 Range* right_range = this->right()->definition()->range(); | 1057 Range* right_range = this->right()->definition()->range(); |
| (...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2563 default: | 2574 default: |
| 2564 UNREACHABLE(); | 2575 UNREACHABLE(); |
| 2565 } | 2576 } |
| 2566 return kPowRuntimeEntry; | 2577 return kPowRuntimeEntry; |
| 2567 } | 2578 } |
| 2568 | 2579 |
| 2569 | 2580 |
| 2570 #undef __ | 2581 #undef __ |
| 2571 | 2582 |
| 2572 } // namespace dart | 2583 } // namespace dart |
| OLD | NEW |