| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 4511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4522 new(isolate()) Value(instr->ArgumentAt(1)), | 4522 new(isolate()) Value(instr->ArgumentAt(1)), |
| 4523 instr->deopt_id(), | 4523 instr->deopt_id(), |
| 4524 instr->token_pos()), | 4524 instr->token_pos()), |
| 4525 instr->env(), | 4525 instr->env(), |
| 4526 FlowGraph::kEffect); | 4526 FlowGraph::kEffect); |
| 4527 needs_store_barrier = kNoStoreBarrier; | 4527 needs_store_barrier = kNoStoreBarrier; |
| 4528 } | 4528 } |
| 4529 | 4529 |
| 4530 if (field.guarded_cid() != kDynamicCid) { | 4530 if (field.guarded_cid() != kDynamicCid) { |
| 4531 InsertBefore(instr, | 4531 InsertBefore(instr, |
| 4532 new(isolate()) GuardFieldInstr( | 4532 new(isolate()) GuardFieldClassInstr( |
| 4533 new(isolate()) Value(instr->ArgumentAt(1)), | 4533 new(isolate()) Value(instr->ArgumentAt(1)), |
| 4534 field, | 4534 field, |
| 4535 instr->deopt_id()), | 4535 instr->deopt_id()), |
| 4536 instr->env(), |
| 4537 FlowGraph::kEffect); |
| 4538 } |
| 4539 |
| 4540 if (field.needs_length_check()) { |
| 4541 InsertBefore(instr, |
| 4542 new(isolate()) GuardFieldLengthInstr( |
| 4543 new(isolate()) Value(instr->ArgumentAt(1)), |
| 4544 field, |
| 4545 instr->deopt_id()), |
| 4536 instr->env(), | 4546 instr->env(), |
| 4537 FlowGraph::kEffect); | 4547 FlowGraph::kEffect); |
| 4538 } | 4548 } |
| 4539 | 4549 |
| 4540 // Field guard was detached. | 4550 // Field guard was detached. |
| 4541 StoreInstanceFieldInstr* store = new(isolate()) StoreInstanceFieldInstr( | 4551 StoreInstanceFieldInstr* store = new(isolate()) StoreInstanceFieldInstr( |
| 4542 field, | 4552 field, |
| 4543 new(isolate()) Value(instr->ArgumentAt(0)), | 4553 new(isolate()) Value(instr->ArgumentAt(0)), |
| 4544 new(isolate()) Value(instr->ArgumentAt(1)), | 4554 new(isolate()) Value(instr->ArgumentAt(1)), |
| 4545 needs_store_barrier, | 4555 needs_store_barrier, |
| (...skipping 3329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7875 // cannot have constant values. | 7885 // cannot have constant values. |
| 7876 void ConstantPropagator::VisitStoreContext(StoreContextInstr* instr) { } | 7886 void ConstantPropagator::VisitStoreContext(StoreContextInstr* instr) { } |
| 7877 | 7887 |
| 7878 | 7888 |
| 7879 void ConstantPropagator::VisitCheckStackOverflow( | 7889 void ConstantPropagator::VisitCheckStackOverflow( |
| 7880 CheckStackOverflowInstr* instr) { } | 7890 CheckStackOverflowInstr* instr) { } |
| 7881 | 7891 |
| 7882 | 7892 |
| 7883 void ConstantPropagator::VisitCheckClass(CheckClassInstr* instr) { } | 7893 void ConstantPropagator::VisitCheckClass(CheckClassInstr* instr) { } |
| 7884 | 7894 |
| 7885 void ConstantPropagator::VisitGuardField(GuardFieldInstr* instr) { } | 7895 void ConstantPropagator::VisitGuardFieldClass(GuardFieldClassInstr* instr) { } |
| 7896 |
| 7897 void ConstantPropagator::VisitGuardFieldLength(GuardFieldLengthInstr* instr) { } |
| 7886 | 7898 |
| 7887 void ConstantPropagator::VisitCheckSmi(CheckSmiInstr* instr) { } | 7899 void ConstantPropagator::VisitCheckSmi(CheckSmiInstr* instr) { } |
| 7888 | 7900 |
| 7889 | 7901 |
| 7890 void ConstantPropagator::VisitCheckEitherNonSmi( | 7902 void ConstantPropagator::VisitCheckEitherNonSmi( |
| 7891 CheckEitherNonSmiInstr* instr) { } | 7903 CheckEitherNonSmiInstr* instr) { } |
| 7892 | 7904 |
| 7893 | 7905 |
| 7894 void ConstantPropagator::VisitCheckArrayBound(CheckArrayBoundInstr* instr) { } | 7906 void ConstantPropagator::VisitCheckArrayBound(CheckArrayBoundInstr* instr) { } |
| 7895 | 7907 |
| (...skipping 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9845 } | 9857 } |
| 9846 | 9858 |
| 9847 // Insert materializations at environment uses. | 9859 // Insert materializations at environment uses. |
| 9848 for (intptr_t i = 0; i < exits.length(); i++) { | 9860 for (intptr_t i = 0; i < exits.length(); i++) { |
| 9849 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots); | 9861 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots); |
| 9850 } | 9862 } |
| 9851 } | 9863 } |
| 9852 | 9864 |
| 9853 | 9865 |
| 9854 } // namespace dart | 9866 } // namespace dart |
| OLD | NEW |