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/flow_graph_builder.h" | 8 #include "vm/flow_graph_builder.h" |
9 #include "vm/flow_graph_compiler.h" | 9 #include "vm/flow_graph_compiler.h" |
10 #include "vm/locations.h" | 10 #include "vm/locations.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 intptr_t AllocateObjectWithBoundsCheckComp::InputCount() const { | 124 intptr_t AllocateObjectWithBoundsCheckComp::InputCount() const { |
125 return arguments().length(); | 125 return arguments().length(); |
126 } | 126 } |
127 | 127 |
128 | 128 |
129 intptr_t CreateArrayComp::InputCount() const { | 129 intptr_t CreateArrayComp::InputCount() const { |
130 return ElementCount() + 1; | 130 return ElementCount() + 1; |
131 } | 131 } |
132 | 132 |
133 | 133 |
| 134 Value* CreateArrayComp::InputAt(intptr_t i) const { |
| 135 if (i == 0) { |
| 136 return element_type(); |
| 137 } else { |
| 138 return ElementAt(i - 1); |
| 139 } |
| 140 } |
| 141 |
| 142 |
134 intptr_t BranchInstr::InputCount() const { | 143 intptr_t BranchInstr::InputCount() const { |
135 return 1; | 144 return 1; |
136 } | 145 } |
137 | 146 |
138 | 147 |
139 Value* BranchInstr::InputAt(intptr_t i) const { | 148 Value* BranchInstr::InputAt(intptr_t i) const { |
140 if (i == 0) return value(); | 149 if (i == 0) return value(); |
141 UNREACHABLE(); | 150 UNREACHABLE(); |
142 return NULL; | 151 return NULL; |
143 } | 152 } |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 compiler->EmitClassChecksNoSmi(*class_ids(), instance, temp, deopt); | 842 compiler->EmitClassChecksNoSmi(*class_ids(), instance, temp, deopt); |
834 } | 843 } |
835 __ StoreIntoObject(instance, FieldAddress(instance, field().Offset()), | 844 __ StoreIntoObject(instance, FieldAddress(instance, field().Offset()), |
836 value); | 845 value); |
837 } | 846 } |
838 | 847 |
839 | 848 |
840 LocationSummary* ThrowInstr::MakeLocationSummary() const { | 849 LocationSummary* ThrowInstr::MakeLocationSummary() const { |
841 const int kNumInputs = 0; | 850 const int kNumInputs = 0; |
842 const int kNumTemps = 0; | 851 const int kNumTemps = 0; |
843 return new LocationSummary(kNumInputs, kNumTemps); | 852 return new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
844 } | 853 } |
845 | 854 |
846 | 855 |
847 | 856 |
848 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 857 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
849 ASSERT(exception()->IsUse()); | 858 ASSERT(exception()->IsUse()); |
850 compiler->GenerateCallRuntime(cid(), | 859 compiler->GenerateCallRuntime(cid(), |
851 token_index(), | 860 token_index(), |
852 try_index(), | 861 try_index(), |
853 kThrowRuntimeEntry); | 862 kThrowRuntimeEntry); |
854 __ int3(); | 863 __ int3(); |
855 } | 864 } |
856 | 865 |
857 | 866 |
858 LocationSummary* ReThrowInstr::MakeLocationSummary() const { | 867 LocationSummary* ReThrowInstr::MakeLocationSummary() const { |
859 const int kNumInputs = 0; | 868 const int kNumInputs = 0; |
860 const int kNumTemps = 0; | 869 const int kNumTemps = 0; |
861 return new LocationSummary(kNumInputs, kNumTemps); | 870 return new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
862 } | 871 } |
863 | 872 |
864 | 873 |
865 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 874 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
866 ASSERT(exception()->IsUse()); | 875 ASSERT(exception()->IsUse()); |
867 ASSERT(stack_trace()->IsUse()); | 876 ASSERT(stack_trace()->IsUse()); |
868 compiler->GenerateCallRuntime(cid(), | 877 compiler->GenerateCallRuntime(cid(), |
869 token_index(), | 878 token_index(), |
870 try_index(), | 879 try_index(), |
871 kReThrowRuntimeEntry); | 880 kReThrowRuntimeEntry); |
872 __ int3(); | 881 __ int3(); |
873 } | 882 } |
874 | 883 |
875 | 884 |
876 LocationSummary* BranchInstr::MakeLocationSummary() const { | 885 LocationSummary* BranchInstr::MakeLocationSummary() const { |
877 if (is_fused_with_comparison()) { | 886 if (is_fused_with_comparison()) { |
878 return LocationSummary::Make(0, Location::NoLocation()); | 887 return LocationSummary::Make(0, |
| 888 Location::NoLocation(), |
| 889 LocationSummary::kNoCall, |
| 890 LocationSummary::kBranch); |
879 } else { | 891 } else { |
880 const int kNumInputs = 1; | 892 const int kNumInputs = 1; |
881 const int kNumTemps = 0; | 893 const int kNumTemps = 0; |
882 LocationSummary* locs = new LocationSummary(kNumInputs, kNumTemps); | 894 LocationSummary* locs = new LocationSummary(kNumInputs, |
| 895 kNumTemps, |
| 896 LocationSummary::kNoCall, |
| 897 LocationSummary::kBranch); |
883 locs->set_in(0, Location::RequiresRegister()); | 898 locs->set_in(0, Location::RequiresRegister()); |
884 return locs; | 899 return locs; |
885 } | 900 } |
886 } | 901 } |
887 | 902 |
888 | 903 |
889 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 904 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
890 // If branch was fused with a comparision then no code needs to be emitted. | 905 // If branch was fused with a comparision then no code needs to be emitted. |
891 if (!is_fused_with_comparison()) { | 906 if (!is_fused_with_comparison()) { |
892 Register value = locs()->in(0).reg(); | 907 Register value = locs()->in(0).reg(); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 compiler->GenerateAssertAssignable(cid(), | 1085 compiler->GenerateAssertAssignable(cid(), |
1071 token_index(), | 1086 token_index(), |
1072 try_index(), | 1087 try_index(), |
1073 dst_type(), | 1088 dst_type(), |
1074 dst_name()); | 1089 dst_name()); |
1075 ASSERT(locs()->in(0).reg() == locs()->out().reg()); | 1090 ASSERT(locs()->in(0).reg() == locs()->out().reg()); |
1076 } | 1091 } |
1077 | 1092 |
1078 | 1093 |
1079 LocationSummary* AssertBooleanComp::MakeLocationSummary() const { | 1094 LocationSummary* AssertBooleanComp::MakeLocationSummary() const { |
1080 return LocationSummary::Make(1, Location::SameAsFirstInput()); | 1095 return LocationSummary::Make(1, |
| 1096 Location::SameAsFirstInput(), |
| 1097 LocationSummary::kCall); |
1081 } | 1098 } |
1082 | 1099 |
1083 | 1100 |
1084 LocationSummary* StoreStaticFieldComp::MakeLocationSummary() const { | 1101 LocationSummary* StoreStaticFieldComp::MakeLocationSummary() const { |
1085 LocationSummary* locs = new LocationSummary(1, 1); | 1102 LocationSummary* locs = new LocationSummary(1, 1); |
1086 locs->set_in(0, Location::RequiresRegister()); | 1103 locs->set_in(0, Location::RequiresRegister()); |
1087 locs->set_temp(0, Location::RequiresRegister()); | 1104 locs->set_temp(0, Location::RequiresRegister()); |
1088 locs->set_out(Location::SameAsFirstInput()); | 1105 locs->set_out(Location::SameAsFirstInput()); |
1089 return locs; | 1106 return locs; |
1090 } | 1107 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); | 1196 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); |
1180 compiler->GenerateCall(token_index(), try_index(), &label, | 1197 compiler->GenerateCall(token_index(), try_index(), &label, |
1181 PcDescriptors::kOther); | 1198 PcDescriptors::kOther); |
1182 __ Drop(2); // Discard type arguments and receiver. | 1199 __ Drop(2); // Discard type arguments and receiver. |
1183 } | 1200 } |
1184 | 1201 |
1185 | 1202 |
1186 #undef __ | 1203 #undef __ |
1187 | 1204 |
1188 } // namespace dart | 1205 } // namespace dart |
OLD | NEW |