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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 896783002: Turn throws into basic block terminators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_trycatch-1
Patch Set: Created 5 years, 11 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 | « no previous file | src/compiler/instruction-selector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 98d80e8a9d2ce17dc065a0574c4f8c9de629fde9..3a9fcd9d83447d60e13359652f62fdbf40228f4c 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -551,8 +551,7 @@ void AstGraphBuilder::ControlScope::PerformCommand(Command command,
environment()->Drop(current->stack_delta());
current = current->next_;
}
- // TODO(mstarzinger): Unconditionally kill environment once throw is control.
- if (command != CMD_THROW) builder()->set_environment(env);
+ builder()->set_environment(env);
DCHECK(current != NULL); // Always handled (unless stack is malformed).
}
@@ -2678,11 +2677,9 @@ Node* AstGraphBuilder::BuildReturn(Node* return_value) {
Node* AstGraphBuilder::BuildThrow(Node* exception_value) {
- const Operator* op = javascript()->CallRuntime(Runtime::kThrow, 1);
- Node* control = NewNode(op, exception_value);
- // TODO(mstarzinger): Thread through the correct bailout id to this point.
- // PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine());
- PrepareFrameState(control, BailoutId::None());
+ NewNode(javascript()->CallRuntime(Runtime::kReThrow, 1), exception_value);
+ Node* control = NewNode(common()->Throw(), exception_value);
+ UpdateControlDependencyToLeaveFunction(control);
return control;
}
« no previous file with comments | « no previous file | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698