Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index 69f39f6ad5e5a98fc708d77d4372333d45827aab..a05e29110c9572e1befb2f7430395be41318afee 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -1666,7 +1666,8 @@ void BytecodeGraphBuilder::EnterAndExitExceptionHandlers(int current_offset) { |
if (current_offset < next_start) break; // Not yet covered by range. |
int next_end = table->GetRangeEnd(current_exception_handler_); |
int next_handler = table->GetRangeHandler(current_exception_handler_); |
- exception_handlers_.push({next_start, next_end, next_handler}); |
+ int next_depth = table->GetRangeDepth(current_exception_handler_); |
Michael Starzinger
2016/02/03 14:34:01
disclosure: I understand that the naming of the Ha
|
+ exception_handlers_.push({next_start, next_end, next_handler, next_depth}); |
current_exception_handler_++; |
} |
} |
@@ -1733,15 +1734,19 @@ Node* BytecodeGraphBuilder::MakeNode(const Operator* op, int value_input_count, |
// Add implicit exception continuation for throwing nodes. |
if (!result->op()->HasProperty(Operator::kNoThrow) && inside_handler) { |
int handler_offset = exception_handlers_.top().handler_offset_; |
+ int context_index = exception_handlers_.top().context_register_; |
+ interpreter::Register context_register(context_index); |
// TODO(mstarzinger): Thread through correct prediction! |
IfExceptionHint hint = IfExceptionHint::kLocallyCaught; |
Environment* success_env = environment()->CopyForConditional(); |
const Operator* op = common()->IfException(hint); |
Node* effect = environment()->GetEffectDependency(); |
Node* on_exception = graph()->NewNode(op, effect, result); |
+ Node* context = environment()->LookupRegister(context_register); |
environment()->UpdateControlDependency(on_exception); |
environment()->UpdateEffectDependency(on_exception); |
environment()->BindAccumulator(on_exception); |
+ environment()->SetContext(context); |
MergeIntoSuccessorEnvironment(handler_offset); |
set_environment(success_env); |
} |