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; |
} |