| 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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 AbstractType::Handle(value()->CompileType()); | 748 AbstractType::Handle(value()->CompileType()); |
| 749 if (!value_compile_type.IsNull() && | 749 if (!value_compile_type.IsNull() && |
| 750 value_compile_type.IsMoreSpecificThan(dst_type(), NULL)) { | 750 value_compile_type.IsMoreSpecificThan(dst_type(), NULL)) { |
| 751 return value_compile_type.raw(); | 751 return value_compile_type.raw(); |
| 752 } | 752 } |
| 753 return dst_type().raw(); | 753 return dst_type().raw(); |
| 754 } | 754 } |
| 755 | 755 |
| 756 | 756 |
| 757 RawAbstractType* AssertBooleanComp::CompileType() const { | 757 RawAbstractType* AssertBooleanComp::CompileType() const { |
| 758 return Type::BoolInterface(); | 758 return Type::BoolType(); |
| 759 } | 759 } |
| 760 | 760 |
| 761 | 761 |
| 762 RawAbstractType* CurrentContextComp::CompileType() const { | 762 RawAbstractType* CurrentContextComp::CompileType() const { |
| 763 return AbstractType::null(); | 763 return AbstractType::null(); |
| 764 } | 764 } |
| 765 | 765 |
| 766 | 766 |
| 767 RawAbstractType* StoreContextComp::CompileType() const { | 767 RawAbstractType* StoreContextComp::CompileType() const { |
| 768 return AbstractType::null(); | 768 return AbstractType::null(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 return Type::DynamicType(); | 805 return Type::DynamicType(); |
| 806 } | 806 } |
| 807 | 807 |
| 808 | 808 |
| 809 RawAbstractType* StoreLocalComp::CompileType() const { | 809 RawAbstractType* StoreLocalComp::CompileType() const { |
| 810 return value()->CompileType(); | 810 return value()->CompileType(); |
| 811 } | 811 } |
| 812 | 812 |
| 813 | 813 |
| 814 RawAbstractType* StrictCompareComp::CompileType() const { | 814 RawAbstractType* StrictCompareComp::CompileType() const { |
| 815 return Type::BoolInterface(); | 815 return Type::BoolType(); |
| 816 } | 816 } |
| 817 | 817 |
| 818 | 818 |
| 819 // Only known == targets return a Boolean. | 819 // Only known == targets return a Boolean. |
| 820 RawAbstractType* EqualityCompareComp::CompileType() const { | 820 RawAbstractType* EqualityCompareComp::CompileType() const { |
| 821 if ((receiver_class_id() == kSmiCid) || | 821 if ((receiver_class_id() == kSmiCid) || |
| 822 (receiver_class_id() == kDoubleCid) || | 822 (receiver_class_id() == kDoubleCid) || |
| 823 (receiver_class_id() == kNumberCid)) { | 823 (receiver_class_id() == kNumberCid)) { |
| 824 return Type::BoolInterface(); | 824 return Type::BoolType(); |
| 825 } | 825 } |
| 826 if (HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid)) { | 826 if (HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid)) { |
| 827 return Type::BoolInterface(); | 827 return Type::BoolType(); |
| 828 } | 828 } |
| 829 return Type::DynamicType(); | 829 return Type::DynamicType(); |
| 830 } | 830 } |
| 831 | 831 |
| 832 | 832 |
| 833 intptr_t EqualityCompareComp::ResultCid() const { | 833 intptr_t EqualityCompareComp::ResultCid() const { |
| 834 if ((receiver_class_id() == kSmiCid) || | 834 if ((receiver_class_id() == kSmiCid) || |
| 835 (receiver_class_id() == kDoubleCid) || | 835 (receiver_class_id() == kDoubleCid) || |
| 836 (receiver_class_id() == kNumberCid)) { | 836 (receiver_class_id() == kNumberCid)) { |
| 837 // Known/library equalities that are guaranteed to return Boolean. | 837 // Known/library equalities that are guaranteed to return Boolean. |
| 838 return kBoolCid; | 838 return kBoolCid; |
| 839 } | 839 } |
| 840 if (HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid)) { | 840 if (HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid)) { |
| 841 return kBoolCid; | 841 return kBoolCid; |
| 842 } | 842 } |
| 843 return kDynamicCid; | 843 return kDynamicCid; |
| 844 } | 844 } |
| 845 | 845 |
| 846 | 846 |
| 847 RawAbstractType* RelationalOpComp::CompileType() const { | 847 RawAbstractType* RelationalOpComp::CompileType() const { |
| 848 if ((operands_class_id() == kSmiCid) || | 848 if ((operands_class_id() == kSmiCid) || |
| 849 (operands_class_id() == kDoubleCid) || | 849 (operands_class_id() == kDoubleCid) || |
| 850 (operands_class_id() == kNumberCid)) { | 850 (operands_class_id() == kNumberCid)) { |
| 851 // Known/library relational ops that are guaranteed to return Boolean. | 851 // Known/library relational ops that are guaranteed to return Boolean. |
| 852 return Type::BoolInterface(); | 852 return Type::BoolType(); |
| 853 } | 853 } |
| 854 return Type::DynamicType(); | 854 return Type::DynamicType(); |
| 855 } | 855 } |
| 856 | 856 |
| 857 | 857 |
| 858 intptr_t RelationalOpComp::ResultCid() const { | 858 intptr_t RelationalOpComp::ResultCid() const { |
| 859 if ((operands_class_id() == kSmiCid) || | 859 if ((operands_class_id() == kSmiCid) || |
| 860 (operands_class_id() == kDoubleCid) || | 860 (operands_class_id() == kDoubleCid) || |
| 861 (operands_class_id() == kNumberCid)) { | 861 (operands_class_id() == kNumberCid)) { |
| 862 // Known/library relational ops that are guaranteed to return Boolean. | 862 // Known/library relational ops that are guaranteed to return Boolean. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 return Type::DynamicType(); | 904 return Type::DynamicType(); |
| 905 } | 905 } |
| 906 | 906 |
| 907 | 907 |
| 908 RawAbstractType* StoreStaticFieldComp::CompileType() const { | 908 RawAbstractType* StoreStaticFieldComp::CompileType() const { |
| 909 return value()->CompileType(); | 909 return value()->CompileType(); |
| 910 } | 910 } |
| 911 | 911 |
| 912 | 912 |
| 913 RawAbstractType* BooleanNegateComp::CompileType() const { | 913 RawAbstractType* BooleanNegateComp::CompileType() const { |
| 914 return Type::BoolInterface(); | 914 return Type::BoolType(); |
| 915 } | 915 } |
| 916 | 916 |
| 917 | 917 |
| 918 RawAbstractType* InstanceOfComp::CompileType() const { | 918 RawAbstractType* InstanceOfComp::CompileType() const { |
| 919 return Type::BoolInterface(); | 919 return Type::BoolType(); |
| 920 } | 920 } |
| 921 | 921 |
| 922 | 922 |
| 923 RawAbstractType* CreateArrayComp::CompileType() const { | 923 RawAbstractType* CreateArrayComp::CompileType() const { |
| 924 return type().raw(); | 924 return type().raw(); |
| 925 } | 925 } |
| 926 | 926 |
| 927 | 927 |
| 928 RawAbstractType* CreateClosureComp::CompileType() const { | 928 RawAbstractType* CreateClosureComp::CompileType() const { |
| 929 const Function& fun = function(); | 929 const Function& fun = function(); |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1557 use->AddToEnvUseList(); | 1557 use->AddToEnvUseList(); |
| 1558 } | 1558 } |
| 1559 } | 1559 } |
| 1560 instr->set_env(copy); | 1560 instr->set_env(copy); |
| 1561 } | 1561 } |
| 1562 | 1562 |
| 1563 | 1563 |
| 1564 #undef __ | 1564 #undef __ |
| 1565 | 1565 |
| 1566 } // namespace dart | 1566 } // namespace dart |
| OLD | NEW |