Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: src/compiler/code-assembler.cc

Issue 2247353005: [builtins] support exception handling in TFJ builtins (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/code-assembler.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-assembler.cc
diff --git a/src/compiler/code-assembler.cc b/src/compiler/code-assembler.cc
index 6fd143b4dd9dd494e7e0485d9472896535c05e93..4dd7e790facfa61b10a187f9add2ec68b8c3c31c 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();
+ Node* exception_value = raw_assembler_->AddNode(op, node, node);
+ if (exception_var != nullptr) {
+ exception_var->Bind(exception_value);
+ }
+ Goto(if_exception);
+
+ Bind(&success);
+}
+
Node* CodeAssembler::CallN(CallDescriptor* descriptor, Node* code_target,
Node** args) {
CallPrologue();
« no previous file with comments | « src/compiler/code-assembler.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698