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

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

Issue 1690973002: [interpreter] Correctly thread through catch prediction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/bytecode-graph-builder.h ('k') | src/interpreter/bytecode-generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index c31043c5bb44f10ab25b05361ce349f94a6fae9f..ac883a69ba2869508429c2d8d8d79552aa2b1eff 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1637,8 +1637,10 @@ void BytecodeGraphBuilder::EnterAndExitExceptionHandlers(int current_offset) {
int next_end = table->GetRangeEnd(current_exception_handler_);
int next_handler = table->GetRangeHandler(current_exception_handler_);
int context_register = table->GetRangeData(current_exception_handler_);
+ CatchPrediction pred =
+ table->GetRangePrediction(current_exception_handler_);
exception_handlers_.push(
- {next_start, next_end, next_handler, context_register});
+ {next_start, next_end, next_handler, context_register, pred});
current_exception_handler_++;
}
}
@@ -1696,9 +1698,11 @@ Node* BytecodeGraphBuilder::MakeNode(const Operator* op, int value_input_count,
if (!result->op()->HasProperty(Operator::kNoThrow) && inside_handler) {
int handler_offset = exception_handlers_.top().handler_offset_;
int context_index = exception_handlers_.top().context_register_;
+ CatchPrediction prediction = exception_handlers_.top().pred_;
interpreter::Register context_register(context_index);
- // TODO(mstarzinger): Thread through correct prediction!
- IfExceptionHint hint = IfExceptionHint::kLocallyCaught;
+ IfExceptionHint hint = prediction == CatchPrediction::CAUGHT
+ ? IfExceptionHint::kLocallyCaught
+ : IfExceptionHint::kLocallyUncaught;
Environment* success_env = environment()->CopyForConditional();
const Operator* op = common()->IfException(hint);
Node* effect = environment()->GetEffectDependency();
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/interpreter/bytecode-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698