| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 // However, the 'more specific than' relation is transitive and is used | 172 // However, the 'more specific than' relation is transitive and is used |
| 173 // here. In other words, if the static type of the value is more specific | 173 // here. In other words, if the static type of the value is more specific |
| 174 // than the destination type, the run time type of the value, which is | 174 // than the destination type, the run time type of the value, which is |
| 175 // guaranteed to be a subtype of the static type, is also guaranteed to be | 175 // guaranteed to be a subtype of the static type, is also guaranteed to be |
| 176 // a subtype of the destination type and the type check can therefore be | 176 // a subtype of the destination type and the type check can therefore be |
| 177 // eliminated. | 177 // eliminated. |
| 178 return static_type.IsMoreSpecificThan(dst_type, NULL); | 178 return static_type.IsMoreSpecificThan(dst_type, NULL); |
| 179 } | 179 } |
| 180 | 180 |
| 181 | 181 |
| 182 intptr_t AllocateObjectComp::InputCount() const { | |
| 183 return arguments().length(); | |
| 184 } | |
| 185 | |
| 186 | |
| 187 intptr_t AllocateObjectWithBoundsCheckComp::InputCount() const { | |
| 188 return arguments().length(); | |
| 189 } | |
| 190 | |
| 191 | |
| 192 RawAbstractType* PhiInstr::StaticType() const { | 182 RawAbstractType* PhiInstr::StaticType() const { |
| 193 // TODO(regis): Return the least upper bound of the input static types. | 183 // TODO(regis): Return the least upper bound of the input static types. |
| 194 // It is much simpler to compute the least specific of the input static types, | 184 // It is much simpler to compute the least specific of the input static types, |
| 195 // and it may be good enough in practice. | 185 // and it may be good enough in practice. |
| 196 // Even better: we could keep the set of the input static types intact. | 186 // Even better: we could keep the set of the input static types intact. |
| 197 AbstractType& least_specific_type = | 187 AbstractType& least_specific_type = |
| 198 AbstractType::Handle(InputAt(0)->StaticType()); | 188 AbstractType::Handle(InputAt(0)->StaticType()); |
| 199 AbstractType& input_type = AbstractType::Handle(); | 189 AbstractType& input_type = AbstractType::Handle(); |
| 200 for (intptr_t i = 1; i < InputCount(); i++) { | 190 for (intptr_t i = 1; i < InputCount(); i++) { |
| 201 input_type = InputAt(i)->StaticType(); | 191 input_type = InputAt(i)->StaticType(); |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 | 1122 |
| 1133 | 1123 |
| 1134 void AllocateObjectComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 1124 void AllocateObjectComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1135 const Class& cls = Class::ZoneHandle(constructor().owner()); | 1125 const Class& cls = Class::ZoneHandle(constructor().owner()); |
| 1136 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls)); | 1126 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls)); |
| 1137 const ExternalLabel label(cls.ToCString(), stub.EntryPoint()); | 1127 const ExternalLabel label(cls.ToCString(), stub.EntryPoint()); |
| 1138 compiler->GenerateCall(token_pos(), | 1128 compiler->GenerateCall(token_pos(), |
| 1139 try_index(), | 1129 try_index(), |
| 1140 &label, | 1130 &label, |
| 1141 PcDescriptors::kOther); | 1131 PcDescriptors::kOther); |
| 1142 __ Drop(arguments().length()); // Discard arguments. | 1132 __ Drop(ArgumentCount()); // Discard arguments. |
| 1143 } | 1133 } |
| 1144 | 1134 |
| 1145 | 1135 |
| 1146 LocationSummary* CreateClosureComp::MakeLocationSummary() const { | 1136 LocationSummary* CreateClosureComp::MakeLocationSummary() const { |
| 1147 return MakeCallSummary(); | 1137 return MakeCallSummary(); |
| 1148 } | 1138 } |
| 1149 | 1139 |
| 1150 | 1140 |
| 1151 void CreateClosureComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 1141 void CreateClosureComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1152 const Function& closure_function = function(); | 1142 const Function& closure_function = function(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 locations_[i] = Location::NoLocation(); | 1201 locations_[i] = Location::NoLocation(); |
| 1212 } | 1202 } |
| 1213 } | 1203 } |
| 1214 } | 1204 } |
| 1215 } | 1205 } |
| 1216 | 1206 |
| 1217 | 1207 |
| 1218 #undef __ | 1208 #undef __ |
| 1219 | 1209 |
| 1220 } // namespace dart | 1210 } // namespace dart |
| OLD | NEW |