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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 // TODO(regis): Can type feedback provide information about the static type | 218 // TODO(regis): Can type feedback provide information about the static type |
219 // of a passed-in parameter? | 219 // of a passed-in parameter? |
220 // Note that in checked mode, we could return the static type of the formal | 220 // Note that in checked mode, we could return the static type of the formal |
221 // parameter. However, this would be wrong if ParameterInstr is used to type | 221 // parameter. However, this would be wrong if ParameterInstr is used to type |
222 // check the passed-in parameter, since the type check would then always be | 222 // check the passed-in parameter, since the type check would then always be |
223 // wrongly eliminated. | 223 // wrongly eliminated. |
224 return Type::DynamicType(); | 224 return Type::DynamicType(); |
225 } | 225 } |
226 | 226 |
227 | 227 |
| 228 RawAbstractType* PushArgumentInstr::StaticType() const { |
| 229 return AbstractType::null(); |
| 230 } |
| 231 |
| 232 |
228 intptr_t JoinEntryInstr::IndexOfPredecessor(BlockEntryInstr* pred) const { | 233 intptr_t JoinEntryInstr::IndexOfPredecessor(BlockEntryInstr* pred) const { |
229 for (intptr_t i = 0; i < predecessors_.length(); ++i) { | 234 for (intptr_t i = 0; i < predecessors_.length(); ++i) { |
230 if (predecessors_[i] == pred) return i; | 235 if (predecessors_[i] == pred) return i; |
231 } | 236 } |
232 return -1; | 237 return -1; |
233 } | 238 } |
234 | 239 |
235 | 240 |
236 // ==== Recording assigned variables. | 241 // ==== Recording assigned variables. |
237 void Computation::RecordAssignedVars(BitVector* assigned_vars, | 242 void Computation::RecordAssignedVars(BitVector* assigned_vars, |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 // Instead of popping the value it is left alone on the simulated frame | 1181 // Instead of popping the value it is left alone on the simulated frame |
1177 // and materialized on the physical stack before the call. | 1182 // and materialized on the physical stack before the call. |
1178 // TODO(fschneider): Avoid special-casing for SSA mode here. | 1183 // TODO(fschneider): Avoid special-casing for SSA mode here. |
1179 if (compiler->is_ssa()) { | 1184 if (compiler->is_ssa()) { |
1180 ASSERT(locs()->in(0).IsRegister()); | 1185 ASSERT(locs()->in(0).IsRegister()); |
1181 __ PushRegister(locs()->in(0).reg()); | 1186 __ PushRegister(locs()->in(0).reg()); |
1182 } | 1187 } |
1183 } | 1188 } |
1184 | 1189 |
1185 | 1190 |
1186 void Environment::InitializeLocations(FlowGraphAllocator* allocator, | |
1187 intptr_t block_start_pos, | |
1188 intptr_t environment_pos) { | |
1189 // Any value mentioned in the deoptimization environment should survive | |
1190 // until the end of instruction but it does not need to be in the register. | |
1191 // Expected shape of live range: | |
1192 // | |
1193 // i i' | |
1194 // value -----* | |
1195 // | |
1196 ASSERT(locations_ == NULL); | |
1197 location_count_ = values_.length(); | |
1198 if (location_count_ > 0) { | |
1199 locations_ = | |
1200 Isolate::Current()->current_zone()->Alloc<Location>(location_count_); | |
1201 for (intptr_t i = 0; i < location_count_; ++i) { | |
1202 Value* value = values_[i]; | |
1203 if (value->IsUse()) { | |
1204 locations_[i] = Location::Any(); | |
1205 const intptr_t vreg = value->AsUse()->definition()->ssa_temp_index(); | |
1206 LiveRange* range = allocator->GetLiveRange(vreg); | |
1207 range->AddUseInterval(block_start_pos, environment_pos); | |
1208 range->AddUse(environment_pos, &locations_[i]); | |
1209 } else { | |
1210 ASSERT(value->IsConstant()); | |
1211 locations_[i] = Location::NoLocation(); | |
1212 } | |
1213 } | |
1214 } | |
1215 } | |
1216 | |
1217 | |
1218 #undef __ | 1191 #undef __ |
1219 | 1192 |
1220 } // namespace dart | 1193 } // namespace dart |
OLD | NEW |