OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/hydrogen-flow-engine.h" | 5 #include "src/hydrogen-flow-engine.h" |
6 #include "src/hydrogen-instructions.h" | 6 #include "src/hydrogen-instructions.h" |
7 #include "src/hydrogen-removable-simulates.h" | 7 #include "src/hydrogen-removable-simulates.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // effects are never added to the merge list. The same reasoning holds for | 46 // effects are never added to the merge list. The same reasoning holds for |
47 // return instructions. | 47 // return instructions. |
48 RemoveSimulates(); | 48 RemoveSimulates(); |
49 return this; | 49 return this; |
50 } | 50 } |
51 if (instr->IsControlInstruction()) { | 51 if (instr->IsControlInstruction()) { |
52 // Merge the accumulated simulates at the end of the block. | 52 // Merge the accumulated simulates at the end of the block. |
53 FlushSimulates(); | 53 FlushSimulates(); |
54 return this; | 54 return this; |
55 } | 55 } |
| 56 if (instr->IsCapturedObject()) { |
| 57 // Do not merge simulates across captured objects - captured objects |
| 58 // change environments during environment replay, and such changes |
| 59 // would not be reflected in the simulate. |
| 60 FlushSimulates(); |
| 61 return this; |
| 62 } |
56 // Skip the non-simulates and the first simulate. | 63 // Skip the non-simulates and the first simulate. |
57 if (!instr->IsSimulate()) return this; | 64 if (!instr->IsSimulate()) return this; |
58 if (first_) { | 65 if (first_) { |
59 first_ = false; | 66 first_ = false; |
60 return this; | 67 return this; |
61 } | 68 } |
62 HSimulate* current_simulate = HSimulate::cast(instr); | 69 HSimulate* current_simulate = HSimulate::cast(instr); |
63 if (!current_simulate->is_candidate_for_removal()) { | 70 if (!current_simulate->is_candidate_for_removal()) { |
64 Remember(current_simulate); | 71 Remember(current_simulate); |
65 FlushSimulates(); | 72 FlushSimulates(); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 }; | 178 }; |
172 | 179 |
173 | 180 |
174 void HMergeRemovableSimulatesPhase::Run() { | 181 void HMergeRemovableSimulatesPhase::Run() { |
175 HFlowEngine<State, Effects> engine(graph(), zone()); | 182 HFlowEngine<State, Effects> engine(graph(), zone()); |
176 State* state = new(zone()) State(zone()); | 183 State* state = new(zone()) State(zone()); |
177 engine.AnalyzeDominatedBlocks(graph()->blocks()->at(0), state); | 184 engine.AnalyzeDominatedBlocks(graph()->blocks()->at(0), state); |
178 } | 185 } |
179 | 186 |
180 } } // namespace v8::internal | 187 } } // namespace v8::internal |
OLD | NEW |