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

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

Issue 1173253004: [turbofan] Ensure lazy bailout point in exception handler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ensure space for lazy deopt. Created 5 years, 6 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/ast-numbering.cc ('k') | src/compiler/code-generator.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 cf7bbc99a52a8e830c5b3b5d78fd6e8635649402..167d285e66f4990c12d4c3d11f93ed5d2cb3eb1a 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1415,16 +1415,21 @@ 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());
+
+ // Clear message object as we enter the catch block.
+ Node* the_hole = jsgraph()->TheHoleConstant();
+ BuildStoreExternal(message_object, kMachAnyTagged, the_hole);
+
// Create a catch scope that binds the exception.
Node* exception = try_control.GetExceptionNode();
Unique<String> name = MakeUnique(stmt->variable()->name());
const Operator* op = javascript()->CreateCatchContext(name);
Node* context = NewNode(op, exception, GetFunctionClosureForContext());
- // Clear message object as we enter the catch block.
- Node* the_hole = jsgraph()->TheHoleConstant();
- BuildStoreExternal(message_object, kMachAnyTagged, the_hole);
-
// Evaluate the catch-block.
VisitInScope(stmt->catch_block(), stmt->scope(), context);
try_control.EndCatch();
@@ -1464,6 +1469,11 @@ 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());
+
// The result value semantics depend on how the block was entered:
// - ReturnStatement: It represents the return value being returned.
// - ThrowStatement: It represents the exception being thrown.
« no previous file with comments | « src/ast-numbering.cc ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698