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" |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 } | 805 } |
806 | 806 |
807 | 807 |
808 // Only known == targets return a Boolean. | 808 // Only known == targets return a Boolean. |
809 RawAbstractType* EqualityCompareComp::CompileType() const { | 809 RawAbstractType* EqualityCompareComp::CompileType() const { |
810 if ((receiver_class_id() == kSmiCid) || | 810 if ((receiver_class_id() == kSmiCid) || |
811 (receiver_class_id() == kDoubleCid) || | 811 (receiver_class_id() == kDoubleCid) || |
812 (receiver_class_id() == kNumberCid)) { | 812 (receiver_class_id() == kNumberCid)) { |
813 return Type::BoolInterface(); | 813 return Type::BoolInterface(); |
814 } | 814 } |
815 const intptr_t dart_object_cid = | 815 if (HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid)) { |
816 Class::Handle(Isolate::Current()->object_store()->object_class()).id(); | |
817 if (HasICData() && ic_data()->AllTargetsHaveSameOwner(dart_object_cid)) { | |
818 return Type::BoolInterface(); | 816 return Type::BoolInterface(); |
819 } | 817 } |
820 return Type::DynamicType(); | 818 return Type::DynamicType(); |
821 } | 819 } |
822 | 820 |
823 | 821 |
824 intptr_t EqualityCompareComp::ResultCid() const { | 822 intptr_t EqualityCompareComp::ResultCid() const { |
825 if ((receiver_class_id() == kSmiCid) || | 823 if ((receiver_class_id() == kSmiCid) || |
826 (receiver_class_id() == kDoubleCid) || | 824 (receiver_class_id() == kDoubleCid) || |
827 (receiver_class_id() == kNumberCid)) { | 825 (receiver_class_id() == kNumberCid)) { |
828 // Known/library equalities that are guaranteed to return Boolean. | 826 // Known/library equalities that are guaranteed to return Boolean. |
829 return kBoolCid; | 827 return kBoolCid; |
830 } | 828 } |
831 const intptr_t dart_object_cid = | 829 if (HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid)) { |
832 Class::Handle(Isolate::Current()->object_store()->object_class()).id(); | |
833 if (HasICData() && ic_data()->AllTargetsHaveSameOwner(dart_object_cid)) { | |
834 return kBoolCid; | 830 return kBoolCid; |
835 } | 831 } |
836 return kDynamicCid; | 832 return kDynamicCid; |
837 } | 833 } |
838 | 834 |
839 | 835 |
840 RawAbstractType* RelationalOpComp::CompileType() const { | 836 RawAbstractType* RelationalOpComp::CompileType() const { |
841 if ((operands_class_id() == kSmiCid) || | 837 if ((operands_class_id() == kSmiCid) || |
842 (operands_class_id() == kDoubleCid) || | 838 (operands_class_id() == kDoubleCid) || |
843 (operands_class_id() == kNumberCid)) { | 839 (operands_class_id() == kNumberCid)) { |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 fixed_parameter_count_(fixed_parameter_count) { | 1520 fixed_parameter_count_(fixed_parameter_count) { |
1525 for (intptr_t i = 0; i < definitions.length(); ++i) { | 1521 for (intptr_t i = 0; i < definitions.length(); ++i) { |
1526 values_.Add(UseDefinition(definitions[i])); | 1522 values_.Add(UseDefinition(definitions[i])); |
1527 } | 1523 } |
1528 } | 1524 } |
1529 | 1525 |
1530 | 1526 |
1531 #undef __ | 1527 #undef __ |
1532 | 1528 |
1533 } // namespace dart | 1529 } // namespace dart |
OLD | NEW |