| 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 } |
| 769 instr->SetEnvironment(deopt_env); | 779 instr->SetEnvironment(deopt_env); |
| 770 for (Environment::DeepIterator it(deopt_env); !it.Done(); it.Advance()) { | 780 for (Environment::DeepIterator it(deopt_env); !it.Done(); it.Advance()) { |
| 771 Value* use = it.CurrentValue(); | 781 Value* use = it.CurrentValue(); |
| 772 use->definition()->AddEnvUse(use); | 782 use->definition()->AddEnvUse(use); |
| 773 } | 783 } |
| 774 if (instr->CanDeoptimize()) { | 784 if (instr->CanDeoptimize()) { |
| 775 instr->env()->set_deopt_id(instr->deopt_id()); | 785 instr->env()->set_deopt_id(instr->deopt_id()); |
| 776 } | 786 } |
| 777 } | 787 } |
| 778 | 788 |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1244 } | 1254 } |
| 1245 | 1255 |
| 1246 | 1256 |
| 1247 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, | 1257 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, |
| 1248 BlockEntryInstr* to) const { | 1258 BlockEntryInstr* to) const { |
| 1249 return available_at_[to->postorder_number()]->Contains( | 1259 return available_at_[to->postorder_number()]->Contains( |
| 1250 from->postorder_number()); | 1260 from->postorder_number()); |
| 1251 } | 1261 } |
| 1252 | 1262 |
| 1253 } // namespace dart | 1263 } // namespace dart |
| OLD | NEW |