| 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/flow_graph_builder.h" | 8 #include "vm/flow_graph_builder.h" |
| 9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 } | 759 } |
| 760 | 760 |
| 761 | 761 |
| 762 void FlowGraph::AttachEnvironment(Instruction* instr, | 762 void FlowGraph::AttachEnvironment(Instruction* instr, |
| 763 GrowableArray<Definition*>* env) { | 763 GrowableArray<Definition*>* env) { |
| 764 Environment* deopt_env = | 764 Environment* deopt_env = |
| 765 Environment::From(isolate(), | 765 Environment::From(isolate(), |
| 766 *env, | 766 *env, |
| 767 num_non_copied_params_, | 767 num_non_copied_params_, |
| 768 &parsed_function_); | 768 &parsed_function_); |
| 769 // TODO(fschneider): Add predicates CanEagerlyDeoptimize and | |
| 770 // CanLazilyDeoptimize to instructions to generally deal with instructions | |
| 771 // that have pushed arguments and input operands. | |
| 772 // Right now, closure calls are the only instructions that have both. They | |
| 773 // also don't have an eager deoptimziation point, so the environment attached | |
| 774 // here is only used for after the call. | |
| 775 if (instr->IsClosureCall()) { | |
| 776 deopt_env = deopt_env->DeepCopy(isolate(), | |
| 777 deopt_env->Length() - instr->InputCount()); | |
| 778 } | |
| 779 instr->SetEnvironment(deopt_env); | 769 instr->SetEnvironment(deopt_env); |
| 780 for (Environment::DeepIterator it(deopt_env); !it.Done(); it.Advance()) { | 770 for (Environment::DeepIterator it(deopt_env); !it.Done(); it.Advance()) { |
| 781 Value* use = it.CurrentValue(); | 771 Value* use = it.CurrentValue(); |
| 782 use->definition()->AddEnvUse(use); | 772 use->definition()->AddEnvUse(use); |
| 783 } | 773 } |
| 784 if (instr->CanDeoptimize()) { | 774 if (instr->CanDeoptimize()) { |
| 785 instr->env()->set_deopt_id(instr->deopt_id()); | 775 instr->env()->set_deopt_id(instr->deopt_id()); |
| 786 } | 776 } |
| 787 } | 777 } |
| 788 | 778 |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1254 } | 1244 } |
| 1255 | 1245 |
| 1256 | 1246 |
| 1257 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, | 1247 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, |
| 1258 BlockEntryInstr* to) const { | 1248 BlockEntryInstr* to) const { |
| 1259 return available_at_[to->postorder_number()]->Contains( | 1249 return available_at_[to->postorder_number()]->Contains( |
| 1260 from->postorder_number()); | 1250 from->postorder_number()); |
| 1261 } | 1251 } |
| 1262 | 1252 |
| 1263 } // namespace dart | 1253 } // namespace dart |
| OLD | NEW |