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

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

Issue 1416543006: [turbofan] Unwind and jump to the catch handler in the deoptimizer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase, review comments Created 4 years, 10 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/ast-graph-builder.h ('k') | src/compiler/liveness-analyzer.h » ('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 6cba09db4e1558d3e7bb3e0d3e392ecb99976f60..a3df160e5896b2e6719565e0e738e2e4f97341bf 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -431,10 +431,13 @@ class AstGraphBuilder::FrameStateBeforeAndAfter {
DCHECK_EQ(IrOpcode::kDead,
NodeProperties::GetFrameStateInput(node, 0)->opcode());
+ bool node_has_exception = NodeProperties::IsExceptionalCall(node);
+
Node* frame_state_after =
id_after == BailoutId::None()
? builder_->jsgraph()->EmptyFrameState()
- : builder_->environment()->Checkpoint(id_after, combine);
+ : builder_->environment()->Checkpoint(id_after, combine,
+ node_has_exception);
NodeProperties::ReplaceFrameStateInput(node, 0, frame_state_after);
}
@@ -869,9 +872,9 @@ void AstGraphBuilder::Environment::UpdateStateValuesWithCache(
env_values, static_cast<size_t>(count));
}
-
-Node* AstGraphBuilder::Environment::Checkpoint(
- BailoutId ast_id, OutputFrameStateCombine combine) {
+Node* AstGraphBuilder::Environment::Checkpoint(BailoutId ast_id,
+ OutputFrameStateCombine combine,
+ bool owner_has_exception) {
if (!builder()->info()->is_deoptimization_enabled()) {
return builder()->jsgraph()->EmptyFrameState();
}
@@ -891,7 +894,15 @@ Node* AstGraphBuilder::Environment::Checkpoint(
DCHECK(IsLivenessBlockConsistent());
if (liveness_block() != nullptr) {
- liveness_block()->Checkpoint(result);
+ // If the owning node has an exception, register the checkpoint to the
+ // predecessor so that the checkpoint is used for both the normal and the
+ // exceptional paths. Yes, this is a terrible hack and we might want
+ // to use an explicit frame state for the exceptional path.
+ if (owner_has_exception) {
+ liveness_block()->GetPredecessor()->Checkpoint(result);
+ } else {
+ liveness_block()->Checkpoint(result);
+ }
}
return result;
}
@@ -4042,8 +4053,10 @@ void AstGraphBuilder::PrepareFrameState(Node* node, BailoutId ast_id,
DCHECK_EQ(IrOpcode::kDead,
NodeProperties::GetFrameStateInput(node, 0)->opcode());
+ bool node_has_exception = NodeProperties::IsExceptionalCall(node);
NodeProperties::ReplaceFrameStateInput(
- node, 0, environment()->Checkpoint(ast_id, combine));
+ node, 0,
+ environment()->Checkpoint(ast_id, combine, node_has_exception));
}
}
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/liveness-analyzer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698