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/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
6 | 6 |
7 #include "src/compiler/bytecode-branch-analysis.h" | 7 #include "src/compiler/bytecode-branch-analysis.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/operator-properties.h" | 9 #include "src/compiler/operator-properties.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1679 // Update the current effect dependency for effect-producing nodes. | 1679 // Update the current effect dependency for effect-producing nodes. |
1680 if (result->op()->EffectOutputCount() > 0) { | 1680 if (result->op()->EffectOutputCount() > 0) { |
1681 environment()->UpdateEffectDependency(result); | 1681 environment()->UpdateEffectDependency(result); |
1682 } | 1682 } |
1683 // Add implicit exception continuation for throwing nodes. | 1683 // Add implicit exception continuation for throwing nodes. |
1684 if (!result->op()->HasProperty(Operator::kNoThrow) && inside_handler) { | 1684 if (!result->op()->HasProperty(Operator::kNoThrow) && inside_handler) { |
1685 int handler_offset = exception_handlers_.top().handler_offset_; | 1685 int handler_offset = exception_handlers_.top().handler_offset_; |
1686 int context_index = exception_handlers_.top().context_register_; | 1686 int context_index = exception_handlers_.top().context_register_; |
1687 CatchPrediction prediction = exception_handlers_.top().pred_; | 1687 CatchPrediction prediction = exception_handlers_.top().pred_; |
1688 interpreter::Register context_register(context_index); | 1688 interpreter::Register context_register(context_index); |
1689 IfExceptionHint hint = prediction == CatchPrediction::CAUGHT | 1689 IfExceptionHint hint = ExceptionHintFromCatchPrediction(prediction); |
1690 ? IfExceptionHint::kLocallyCaught | |
1691 : IfExceptionHint::kLocallyUncaught; | |
1692 Environment* success_env = environment()->CopyForConditional(); | 1690 Environment* success_env = environment()->CopyForConditional(); |
1693 const Operator* op = common()->IfException(hint); | 1691 const Operator* op = common()->IfException(hint); |
1694 Node* effect = environment()->GetEffectDependency(); | 1692 Node* effect = environment()->GetEffectDependency(); |
1695 Node* on_exception = graph()->NewNode(op, effect, result); | 1693 Node* on_exception = graph()->NewNode(op, effect, result); |
1696 Node* context = environment()->LookupRegister(context_register); | 1694 Node* context = environment()->LookupRegister(context_register); |
1697 environment()->UpdateControlDependency(on_exception); | 1695 environment()->UpdateControlDependency(on_exception); |
1698 environment()->UpdateEffectDependency(on_exception); | 1696 environment()->UpdateEffectDependency(on_exception); |
1699 environment()->BindAccumulator(on_exception); | 1697 environment()->BindAccumulator(on_exception); |
1700 environment()->SetContext(context); | 1698 environment()->SetContext(context); |
1701 MergeIntoSuccessorEnvironment(handler_offset); | 1699 MergeIntoSuccessorEnvironment(handler_offset); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1784 // Phi does not exist yet, introduce one. | 1782 // Phi does not exist yet, introduce one. |
1785 value = NewPhi(inputs, value, control); | 1783 value = NewPhi(inputs, value, control); |
1786 value->ReplaceInput(inputs - 1, other); | 1784 value->ReplaceInput(inputs - 1, other); |
1787 } | 1785 } |
1788 return value; | 1786 return value; |
1789 } | 1787 } |
1790 | 1788 |
1791 } // namespace compiler | 1789 } // namespace compiler |
1792 } // namespace internal | 1790 } // namespace internal |
1793 } // namespace v8 | 1791 } // namespace v8 |
OLD | NEW |