Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: runtime/vm/flow_graph.cc

Issue 2357343003: Fix lazy deoptimization in the presence of exceptions (Closed)
Patch Set: Ensure space for patching on ARM/MIPS archs Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_allocator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698