Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: runtime/vm/intermediate_language.cc

Issue 10874071: Eliminate interface bool (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 AbstractType::Handle(value()->CompileType()); 738 AbstractType::Handle(value()->CompileType());
739 if (!value_compile_type.IsNull() && 739 if (!value_compile_type.IsNull() &&
740 value_compile_type.IsMoreSpecificThan(dst_type(), NULL)) { 740 value_compile_type.IsMoreSpecificThan(dst_type(), NULL)) {
741 return value_compile_type.raw(); 741 return value_compile_type.raw();
742 } 742 }
743 return dst_type().raw(); 743 return dst_type().raw();
744 } 744 }
745 745
746 746
747 RawAbstractType* AssertBooleanComp::CompileType() const { 747 RawAbstractType* AssertBooleanComp::CompileType() const {
748 return Type::BoolInterface(); 748 return Type::BoolType();
749 } 749 }
750 750
751 751
752 RawAbstractType* CurrentContextComp::CompileType() const { 752 RawAbstractType* CurrentContextComp::CompileType() const {
753 return AbstractType::null(); 753 return AbstractType::null();
754 } 754 }
755 755
756 756
757 RawAbstractType* StoreContextComp::CompileType() const { 757 RawAbstractType* StoreContextComp::CompileType() const {
758 return AbstractType::null(); 758 return AbstractType::null();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 return Type::DynamicType(); 795 return Type::DynamicType();
796 } 796 }
797 797
798 798
799 RawAbstractType* StoreLocalComp::CompileType() const { 799 RawAbstractType* StoreLocalComp::CompileType() const {
800 return value()->CompileType(); 800 return value()->CompileType();
801 } 801 }
802 802
803 803
804 RawAbstractType* StrictCompareComp::CompileType() const { 804 RawAbstractType* StrictCompareComp::CompileType() const {
805 return Type::BoolInterface(); 805 return Type::BoolType();
806 } 806 }
807 807
808 808
809 // Only known == targets return a Boolean. 809 // Only known == targets return a Boolean.
810 RawAbstractType* EqualityCompareComp::CompileType() const { 810 RawAbstractType* EqualityCompareComp::CompileType() const {
811 if ((receiver_class_id() == kSmiCid) || 811 if ((receiver_class_id() == kSmiCid) ||
812 (receiver_class_id() == kDoubleCid) || 812 (receiver_class_id() == kDoubleCid) ||
813 (receiver_class_id() == kNumberCid)) { 813 (receiver_class_id() == kNumberCid)) {
814 return Type::BoolInterface(); 814 return Type::BoolType();
815 } 815 }
816 if (HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid)) { 816 if (HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid)) {
817 return Type::BoolInterface(); 817 return Type::BoolType();
818 } 818 }
819 return Type::DynamicType(); 819 return Type::DynamicType();
820 } 820 }
821 821
822 822
823 intptr_t EqualityCompareComp::ResultCid() const { 823 intptr_t EqualityCompareComp::ResultCid() const {
824 if ((receiver_class_id() == kSmiCid) || 824 if ((receiver_class_id() == kSmiCid) ||
825 (receiver_class_id() == kDoubleCid) || 825 (receiver_class_id() == kDoubleCid) ||
826 (receiver_class_id() == kNumberCid)) { 826 (receiver_class_id() == kNumberCid)) {
827 // Known/library equalities that are guaranteed to return Boolean. 827 // Known/library equalities that are guaranteed to return Boolean.
828 return kBoolCid; 828 return kBoolCid;
829 } 829 }
830 if (HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid)) { 830 if (HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid)) {
831 return kBoolCid; 831 return kBoolCid;
832 } 832 }
833 return kDynamicCid; 833 return kDynamicCid;
834 } 834 }
835 835
836 836
837 RawAbstractType* RelationalOpComp::CompileType() const { 837 RawAbstractType* RelationalOpComp::CompileType() const {
838 if ((operands_class_id() == kSmiCid) || 838 if ((operands_class_id() == kSmiCid) ||
839 (operands_class_id() == kDoubleCid) || 839 (operands_class_id() == kDoubleCid) ||
840 (operands_class_id() == kNumberCid)) { 840 (operands_class_id() == kNumberCid)) {
841 // Known/library relational ops that are guaranteed to return Boolean. 841 // Known/library relational ops that are guaranteed to return Boolean.
842 return Type::BoolInterface(); 842 return Type::BoolType();
843 } 843 }
844 return Type::DynamicType(); 844 return Type::DynamicType();
845 } 845 }
846 846
847 847
848 intptr_t RelationalOpComp::ResultCid() const { 848 intptr_t RelationalOpComp::ResultCid() const {
849 if ((operands_class_id() == kSmiCid) || 849 if ((operands_class_id() == kSmiCid) ||
850 (operands_class_id() == kDoubleCid) || 850 (operands_class_id() == kDoubleCid) ||
851 (operands_class_id() == kNumberCid)) { 851 (operands_class_id() == kNumberCid)) {
852 // Known/library relational ops that are guaranteed to return Boolean. 852 // Known/library relational ops that are guaranteed to return Boolean.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 return Type::DynamicType(); 894 return Type::DynamicType();
895 } 895 }
896 896
897 897
898 RawAbstractType* StoreStaticFieldComp::CompileType() const { 898 RawAbstractType* StoreStaticFieldComp::CompileType() const {
899 return value()->CompileType(); 899 return value()->CompileType();
900 } 900 }
901 901
902 902
903 RawAbstractType* BooleanNegateComp::CompileType() const { 903 RawAbstractType* BooleanNegateComp::CompileType() const {
904 return Type::BoolInterface(); 904 return Type::BoolType();
905 } 905 }
906 906
907 907
908 RawAbstractType* InstanceOfComp::CompileType() const { 908 RawAbstractType* InstanceOfComp::CompileType() const {
909 return Type::BoolInterface(); 909 return Type::BoolType();
910 } 910 }
911 911
912 912
913 RawAbstractType* CreateArrayComp::CompileType() const { 913 RawAbstractType* CreateArrayComp::CompileType() const {
914 return type().raw(); 914 return type().raw();
915 } 915 }
916 916
917 917
918 RawAbstractType* CreateClosureComp::CompileType() const { 918 RawAbstractType* CreateClosureComp::CompileType() const {
919 const Function& fun = function(); 919 const Function& fun = function();
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 ? UseDefinition(values()[i]->AsUse()->definition()) 1525 ? UseDefinition(values()[i]->AsUse()->definition())
1526 : val); 1526 : val);
1527 } 1527 }
1528 return copy; 1528 return copy;
1529 } 1529 }
1530 1530
1531 1531
1532 #undef __ 1532 #undef __
1533 1533
1534 } // namespace dart 1534 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/object.h » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698