Index: src/compiler/ast-graph-builder.cc |
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc |
index 6ce9269927c645fd16b8f6b431606bcd8101f570..5b07447b62018499ebc898beeae46d152cc6cc4f 100644 |
--- a/src/compiler/ast-graph-builder.cc |
+++ b/src/compiler/ast-graph-builder.cc |
@@ -1410,10 +1410,13 @@ void AstGraphBuilder::VisitTryCatchStatement(TryCatchStatement* stmt) { |
} |
try_control.EndTry(); |
- // TODO(mstarzinger): We are only using a runtime call to get a lazy bailout |
- // point, there is no need to really emit an actual call. Optimize this! |
- Node* guard = NewNode(javascript()->CallRuntime(Runtime::kMaxSmi, 0)); |
- PrepareFrameState(guard, stmt->HandlerId()); |
+ // Insert lazy bailout point. |
+ // TODO(mstarzinger): We are only using a 'call' to get a lazy bailout |
+ // point. Ideally, we whould not re-enter optimized code when deoptimized |
+ // lazily. Tracked by issue v8:4195. |
+ NewNode(common()->LazyBailout(), |
+ jsgraph()->ZeroConstant(), // dummy target. |
+ environment()->Checkpoint(stmt->HandlerId())); // frame state. |
// Clear message object as we enter the catch block. |
Node* the_hole = jsgraph()->TheHoleConstant(); |
@@ -1461,10 +1464,13 @@ void AstGraphBuilder::VisitTryFinallyStatement(TryFinallyStatement* stmt) { |
} |
try_control.EndTry(commands->GetFallThroughToken(), fallthrough_result); |
- // TODO(mstarzinger): We are only using a runtime call to get a lazy bailout |
- // point, there is no need to really emit an actual call. Optimize this! |
- Node* guard = NewNode(javascript()->CallRuntime(Runtime::kMaxSmi, 0)); |
- PrepareFrameState(guard, stmt->HandlerId()); |
+ // Insert lazy bailout point. |
+ // TODO(mstarzinger): We are only using a 'call' to get a lazy bailout |
+ // point. Ideally, we whould not re-enter optimized code when deoptimized |
+ // lazily. Tracked by issue v8:4195. |
+ NewNode(common()->LazyBailout(), |
+ jsgraph()->ZeroConstant(), // dummy target. |
+ environment()->Checkpoint(stmt->HandlerId())); // frame state. |
// The result value semantics depend on how the block was entered: |
// - ReturnStatement: It represents the return value being returned. |