Index: src/compiler/code-assembler.cc |
diff --git a/src/compiler/code-assembler.cc b/src/compiler/code-assembler.cc |
index 6fd143b4dd9dd494e7e0485d9472896535c05e93..58a46944ae6eb9989f5775195bb006fd00d45576 100644 |
--- a/src/compiler/code-assembler.cc |
+++ b/src/compiler/code-assembler.cc |
@@ -312,6 +312,32 @@ void CodeAssembler::BranchIf(Node* condition, Label* if_true, Label* if_false) { |
Goto(if_false); |
} |
+void CodeAssembler::BranchIfSuccess(Node* node, Label* if_success, |
+ Label* if_exception, |
+ Variable* exception_var) { |
+ Label exception(this); |
Michael Starzinger
2016/08/19 08:53:56
Let's mark this label as deferred, to move the han
caitp
2016/08/19 15:38:53
Done.
|
+ if_success->MergeVariables(); |
+ exception.MergeVariables(); |
+ DCHECK(!node->op()->HasProperty(Operator::kNoThrow)); |
+ |
+ raw_assembler_->BranchIfSuccess(node, if_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); |
+ } |
+ Goto(if_exception); |
+} |
+ |
+void CodeAssembler::GotoIfException(Node* node, Label* if_exception, |
Michael Starzinger
2016/08/19 08:53:56
It seems that users of the CodeAssembler will be m
caitp
2016/08/19 15:38:53
I've merged them into just GotoIfException --- I j
|
+ Variable* exception_var) { |
+ Label if_success(this); |
+ BranchIfSuccess(node, &if_success, if_exception, exception_var); |
+ Bind(&if_success); |
+} |
+ |
Node* CodeAssembler::CallN(CallDescriptor* descriptor, Node* code_target, |
Node** args) { |
CallPrologue(); |