OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compiler/effect-control-linearizer.h" | 5 #include "src/compiler/effect-control-linearizer.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 .current_effect != effect) { | 371 .current_effect != effect) { |
372 effect = nullptr; | 372 effect = nullptr; |
373 break; | 373 break; |
374 } | 374 } |
375 } | 375 } |
376 if (effect == nullptr) { | 376 if (effect == nullptr) { |
377 DCHECK_NE(IrOpcode::kIfException, control->opcode()); | 377 DCHECK_NE(IrOpcode::kIfException, control->opcode()); |
378 // The input blocks do not have the same effect. We have | 378 // The input blocks do not have the same effect. We have |
379 // to create an effect phi node. | 379 // to create an effect phi node. |
380 inputs_buffer.clear(); | 380 inputs_buffer.clear(); |
381 inputs_buffer.resize(block->PredecessorCount(), graph()->start()); | 381 inputs_buffer.resize(block->PredecessorCount(), jsgraph()->Dead()); |
Benedikt Meurer
2016/07/16 12:35:29
Nice!
| |
382 inputs_buffer.push_back(control); | 382 inputs_buffer.push_back(control); |
383 effect = graph()->NewNode( | 383 effect = graph()->NewNode( |
384 common()->EffectPhi(static_cast<int>(block->PredecessorCount())), | 384 common()->EffectPhi(static_cast<int>(block->PredecessorCount())), |
385 static_cast<int>(inputs_buffer.size()), &(inputs_buffer.front())); | 385 static_cast<int>(inputs_buffer.size()), &(inputs_buffer.front())); |
386 // Let us update the effect phi node later. | 386 // For loops, we update the effect phi node later to break cycles. |
387 pending_effect_phis.push_back(PendingEffectPhi(effect, block)); | 387 if (control->opcode() == IrOpcode::kLoop) { |
388 pending_effect_phis.push_back(PendingEffectPhi(effect, block)); | |
389 } else { | |
390 UpdateEffectPhi(effect, block, &block_effects); | |
391 } | |
388 } else if (control->opcode() == IrOpcode::kIfException) { | 392 } else if (control->opcode() == IrOpcode::kIfException) { |
389 // The IfException is connected into the effect chain, so we need | 393 // The IfException is connected into the effect chain, so we need |
390 // to update the effect here. | 394 // to update the effect here. |
391 NodeProperties::ReplaceEffectInput(control, effect); | 395 NodeProperties::ReplaceEffectInput(control, effect); |
392 effect = control; | 396 effect = control; |
393 } | 397 } |
394 } | 398 } |
395 } | 399 } |
396 | 400 |
397 // Fixup the Terminate node. | 401 // Fixup the Terminate node. |
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2104 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 2108 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
2105 Operator::kNoThrow); | 2109 Operator::kNoThrow); |
2106 to_number_operator_.set(common()->Call(desc)); | 2110 to_number_operator_.set(common()->Call(desc)); |
2107 } | 2111 } |
2108 return to_number_operator_.get(); | 2112 return to_number_operator_.get(); |
2109 } | 2113 } |
2110 | 2114 |
2111 } // namespace compiler | 2115 } // namespace compiler |
2112 } // namespace internal | 2116 } // namespace internal |
2113 } // namespace v8 | 2117 } // namespace v8 |
OLD | NEW |