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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
285 // However, the 'more specific than' relation is transitive and is used | 285 // However, the 'more specific than' relation is transitive and is used |
286 // here. In other words, if the compile type of the value is more specific | 286 // here. In other words, if the compile type of the value is more specific |
287 // than the destination type, the run time type of the value, which is | 287 // than the destination type, the run time type of the value, which is |
288 // guaranteed to be a subtype of the compile type, is also guaranteed to be | 288 // guaranteed to be a subtype of the compile type, is also guaranteed to be |
289 // a subtype of the destination type and the type check can therefore be | 289 // a subtype of the destination type and the type check can therefore be |
290 // eliminated. | 290 // eliminated. |
291 return compile_type.IsMoreSpecificThan(dst_type, NULL); | 291 return compile_type.IsMoreSpecificThan(dst_type, NULL); |
292 } | 292 } |
293 | 293 |
294 | 294 |
295 bool Value::NeedsStoreBuffer() const { | |
296 const intptr_t cid = ResultCid(); | |
297 if ((cid == kSmiCid) || (cid == kBoolCid) || (cid == kNullCid)) { | |
298 return false; | |
299 } | |
300 if (BindsToConstant()) return false; | |
Ivan Posva
2012/08/25 00:20:51
return !BindsToConstant();
srdjan
2012/08/25 00:25:52
Done.
| |
301 return true; | |
302 } | |
303 | |
304 | |
Ivan Posva
2012/08/25 00:20:51
Extra line.
srdjan
2012/08/25 00:25:52
Done.
| |
305 | |
295 RawAbstractType* PhiInstr::CompileType() const { | 306 RawAbstractType* PhiInstr::CompileType() const { |
296 ASSERT(!HasPropagatedType()); | 307 ASSERT(!HasPropagatedType()); |
297 // Since type propagation has not yet occured, we are reaching this phi via a | 308 // Since type propagation has not yet occured, we are reaching this phi via a |
298 // back edge phi input. Return null as compile type so that this input is | 309 // back edge phi input. Return null as compile type so that this input is |
299 // ignored in the first iteration of type propagation. | 310 // ignored in the first iteration of type propagation. |
300 return AbstractType::null(); | 311 return AbstractType::null(); |
301 } | 312 } |
302 | 313 |
303 | 314 |
304 RawAbstractType* PhiInstr::LeastSpecificInputType() const { | 315 RawAbstractType* PhiInstr::LeastSpecificInputType() const { |
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1525 ? UseDefinition(values()[i]->AsUse()->definition()) | 1536 ? UseDefinition(values()[i]->AsUse()->definition()) |
1526 : val); | 1537 : val); |
1527 } | 1538 } |
1528 return copy; | 1539 return copy; |
1529 } | 1540 } |
1530 | 1541 |
1531 | 1542 |
1532 #undef __ | 1543 #undef __ |
1533 | 1544 |
1534 } // namespace dart | 1545 } // namespace dart |
OLD | NEW |