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/flow_graph.h" | 5 #include "vm/flow_graph.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/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
(...skipping 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2002 | 2002 |
2003 void FlowGraph::EliminateEnvironments() { | 2003 void FlowGraph::EliminateEnvironments() { |
2004 // After this pass we can no longer perform LICM and hoist instructions | 2004 // After this pass we can no longer perform LICM and hoist instructions |
2005 // that can deoptimize. | 2005 // that can deoptimize. |
2006 | 2006 |
2007 disallow_licm(); | 2007 disallow_licm(); |
2008 for (BlockIterator block_it = reverse_postorder_iterator(); | 2008 for (BlockIterator block_it = reverse_postorder_iterator(); |
2009 !block_it.Done(); | 2009 !block_it.Done(); |
2010 block_it.Advance()) { | 2010 block_it.Advance()) { |
2011 BlockEntryInstr* block = block_it.Current(); | 2011 BlockEntryInstr* block = block_it.Current(); |
2012 block->RemoveEnvironment(); | 2012 if (!block->IsCatchBlockEntry()) { |
| 2013 block->RemoveEnvironment(); |
| 2014 } |
2013 for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) { | 2015 for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) { |
2014 Instruction* current = it.Current(); | 2016 Instruction* current = it.Current(); |
2015 if (!current->CanDeoptimize()) { | 2017 if (!current->CanDeoptimize()) { |
2016 // TODO(srdjan): --source-lines needs deopt environments to get at | 2018 // TODO(srdjan): --source-lines needs deopt environments to get at |
2017 // the code for this instruction, however, leaving the environment | 2019 // the code for this instruction, however, leaving the environment |
2018 // changes code. | 2020 // changes code. |
2019 current->RemoveEnvironment(); | 2021 current->RemoveEnvironment(); |
2020 } | 2022 } |
2021 } | 2023 } |
2022 } | 2024 } |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 ExtractNthOutputInstr* extract = | 2310 ExtractNthOutputInstr* extract = |
2309 new(Z) ExtractNthOutputInstr(new(Z) Value(instr), index, rep, cid); | 2311 new(Z) ExtractNthOutputInstr(new(Z) Value(instr), index, rep, cid); |
2310 instr->ReplaceUsesWith(extract); | 2312 instr->ReplaceUsesWith(extract); |
2311 InsertAfter(instr, extract, NULL, FlowGraph::kValue); | 2313 InsertAfter(instr, extract, NULL, FlowGraph::kValue); |
2312 } | 2314 } |
2313 | 2315 |
2314 | 2316 |
2315 | 2317 |
2316 | 2318 |
2317 } // namespace dart | 2319 } // namespace dart |
OLD | NEW |