| 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 #ifndef DART_PRECOMPILED_RUNTIME | 4 #ifndef DART_PRECOMPILED_RUNTIME |
| 5 #include "vm/jit_optimizer.h" | 5 #include "vm/jit_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/branch_optimizer.h" | 8 #include "vm/branch_optimizer.h" |
| 9 #include "vm/cha.h" | 9 #include "vm/cha.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1608 field.DeoptimizeDependentCode(); | 1608 field.DeoptimizeDependentCode(); |
| 1609 } else { | 1609 } else { |
| 1610 flow_graph()->parsed_function().AddToGuardedFields(&field); | 1610 flow_graph()->parsed_function().AddToGuardedFields(&field); |
| 1611 } | 1611 } |
| 1612 } | 1612 } |
| 1613 } | 1613 } |
| 1614 | 1614 |
| 1615 | 1615 |
| 1616 void JitOptimizer::VisitAllocateContext(AllocateContextInstr* instr) { | 1616 void JitOptimizer::VisitAllocateContext(AllocateContextInstr* instr) { |
| 1617 // Replace generic allocation with a sequence of inlined allocation and | 1617 // Replace generic allocation with a sequence of inlined allocation and |
| 1618 // explicit initalizing stores. | 1618 // explicit initializing stores. |
| 1619 AllocateUninitializedContextInstr* replacement = | 1619 AllocateUninitializedContextInstr* replacement = |
| 1620 new AllocateUninitializedContextInstr(instr->token_pos(), | 1620 new AllocateUninitializedContextInstr(instr->token_pos(), |
| 1621 instr->num_context_variables()); | 1621 instr->num_context_variables()); |
| 1622 instr->ReplaceWith(replacement, current_iterator()); | 1622 instr->ReplaceWith(replacement, current_iterator()); |
| 1623 | 1623 |
| 1624 StoreInstanceFieldInstr* store = new (Z) | 1624 StoreInstanceFieldInstr* store = new (Z) |
| 1625 StoreInstanceFieldInstr(Context::parent_offset(), new Value(replacement), | 1625 StoreInstanceFieldInstr(Context::parent_offset(), new Value(replacement), |
| 1626 new Value(flow_graph_->constant_null()), | 1626 new Value(flow_graph_->constant_null()), |
| 1627 kNoStoreBarrier, instr->token_pos()); | 1627 kNoStoreBarrier, instr->token_pos()); |
| 1628 // Storing into uninitialized memory; remember to prevent dead store | 1628 // Storing into uninitialized memory; remember to prevent dead store |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1718 // Discard the environment from the original instruction because the store | 1718 // Discard the environment from the original instruction because the store |
| 1719 // can't deoptimize. | 1719 // can't deoptimize. |
| 1720 instr->RemoveEnvironment(); | 1720 instr->RemoveEnvironment(); |
| 1721 ReplaceCall(instr, store); | 1721 ReplaceCall(instr, store); |
| 1722 return true; | 1722 return true; |
| 1723 } | 1723 } |
| 1724 | 1724 |
| 1725 | 1725 |
| 1726 } // namespace dart | 1726 } // namespace dart |
| 1727 #endif // DART_PRECOMPILED_RUNTIME | 1727 #endif // DART_PRECOMPILED_RUNTIME |
| OLD | NEW |