Chromium Code Reviews| Index: src/compiler/code-assembler.cc |
| diff --git a/src/compiler/code-assembler.cc b/src/compiler/code-assembler.cc |
| index 6fd143b4dd9dd494e7e0485d9472896535c05e93..3dfdb1982f20eafb4e0c402799a891962b6f642b 100644 |
| --- a/src/compiler/code-assembler.cc |
| +++ b/src/compiler/code-assembler.cc |
| @@ -312,6 +312,26 @@ void CodeAssembler::BranchIf(Node* condition, Label* if_true, Label* if_false) { |
| Goto(if_false); |
| } |
| +void CodeAssembler::GotoIfException(Node* node, Label* if_exception, |
| + Variable* exception_var) { |
| + Label success(this), exception(this, Label::kDeferred); |
| + success.MergeVariables(); |
| + exception.MergeVariables(); |
| + DCHECK(!node->op()->HasProperty(Operator::kNoThrow)); |
| + |
| + raw_assembler_->Continuations(node, success.label_, exception.label_); |
| + |
| + Bind(&exception); |
| + const Operator* op = raw_assembler_->common()->IfException(); |
| + raw_assembler_->AddNode(op, node, node); |
| + if (exception_var != nullptr) { |
| + exception_var->Bind(node); |
|
Michael Starzinger
2016/08/19 18:37:43
nit: Technically the exception is the value output
caitp
2016/08/19 20:37:11
passes the tests, so if this is what's expected, s
|
| + } |
| + Goto(if_exception); |
| + |
| + Bind(&success); |
| +} |
| + |
| Node* CodeAssembler::CallN(CallDescriptor* descriptor, Node* code_target, |
| Node** args) { |
| CallPrologue(); |