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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 return PropagatedType(); | 266 return PropagatedType(); |
267 } | 267 } |
268 // Note that returning the declared type of the formal parameter would be | 268 // Note that returning the declared type of the formal parameter would be |
269 // incorrect, because ParameterInstr is used as input to the type check | 269 // incorrect, because ParameterInstr is used as input to the type check |
270 // verifying the run time type of the passed-in parameter and this check would | 270 // verifying the run time type of the passed-in parameter and this check would |
271 // always be wrongly eliminated. | 271 // always be wrongly eliminated. |
272 return Type::DynamicType(); | 272 return Type::DynamicType(); |
273 } | 273 } |
274 | 274 |
275 | 275 |
| 276 RawAbstractType* PushArgumentInstr::CompileType() const { |
| 277 return AbstractType::null(); |
| 278 } |
| 279 |
| 280 |
276 intptr_t JoinEntryInstr::IndexOfPredecessor(BlockEntryInstr* pred) const { | 281 intptr_t JoinEntryInstr::IndexOfPredecessor(BlockEntryInstr* pred) const { |
277 for (intptr_t i = 0; i < predecessors_.length(); ++i) { | 282 for (intptr_t i = 0; i < predecessors_.length(); ++i) { |
278 if (predecessors_[i] == pred) return i; | 283 if (predecessors_[i] == pred) return i; |
279 } | 284 } |
280 return -1; | 285 return -1; |
281 } | 286 } |
282 | 287 |
283 | 288 |
284 // ==== Recording assigned variables. | 289 // ==== Recording assigned variables. |
285 void Computation::RecordAssignedVars(BitVector* assigned_vars, | 290 void Computation::RecordAssignedVars(BitVector* assigned_vars, |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 // Instead of popping the value it is left alone on the simulated frame | 1231 // Instead of popping the value it is left alone on the simulated frame |
1227 // and materialized on the physical stack before the call. | 1232 // and materialized on the physical stack before the call. |
1228 // TODO(fschneider): Avoid special-casing for SSA mode here. | 1233 // TODO(fschneider): Avoid special-casing for SSA mode here. |
1229 if (compiler->is_ssa()) { | 1234 if (compiler->is_ssa()) { |
1230 ASSERT(locs()->in(0).IsRegister()); | 1235 ASSERT(locs()->in(0).IsRegister()); |
1231 __ PushRegister(locs()->in(0).reg()); | 1236 __ PushRegister(locs()->in(0).reg()); |
1232 } | 1237 } |
1233 } | 1238 } |
1234 | 1239 |
1235 | 1240 |
1236 void Environment::InitializeLocations(FlowGraphAllocator* allocator, | |
1237 intptr_t block_start_pos, | |
1238 intptr_t environment_pos) { | |
1239 // Any value mentioned in the deoptimization environment should survive | |
1240 // until the end of instruction but it does not need to be in the register. | |
1241 // Expected shape of live range: | |
1242 // | |
1243 // i i' | |
1244 // value -----* | |
1245 // | |
1246 ASSERT(locations_ == NULL); | |
1247 location_count_ = values_.length(); | |
1248 if (location_count_ > 0) { | |
1249 locations_ = | |
1250 Isolate::Current()->current_zone()->Alloc<Location>(location_count_); | |
1251 for (intptr_t i = 0; i < location_count_; ++i) { | |
1252 Value* value = values_[i]; | |
1253 if (value->IsUse()) { | |
1254 locations_[i] = Location::Any(); | |
1255 const intptr_t vreg = value->AsUse()->definition()->ssa_temp_index(); | |
1256 LiveRange* range = allocator->GetLiveRange(vreg); | |
1257 range->AddUseInterval(block_start_pos, environment_pos); | |
1258 range->AddUse(environment_pos, &locations_[i]); | |
1259 } else { | |
1260 ASSERT(value->IsConstant()); | |
1261 locations_[i] = Location::NoLocation(); | |
1262 } | |
1263 } | |
1264 } | |
1265 } | |
1266 | |
1267 | |
1268 #undef __ | 1241 #undef __ |
1269 | 1242 |
1270 } // namespace dart | 1243 } // namespace dart |
OLD | NEW |