Chromium Code Reviews

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

Issue 1665833002: [interpreter] Switch context during stack unwinding. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable tests. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/frames.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 cb3bc2fadaeb9a17a3a36afa9fd1b1358b9553d7..5032cae3c3af15e9fc52fbf1b9bb4a3648cf8d7c 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1672,7 +1672,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_);
rmcilroy 2016/02/04 12:22:49 nit - could we call the local context_register ins
Michael Starzinger 2016/02/04 12:40:32 Done.
+ exception_handlers_.push({next_start, next_end, next_handler, next_depth});
current_exception_handler_++;
}
}
@@ -1739,15 +1740,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);
}
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/frames.h » ('j') | no next file with comments »

Powered by Google App Engine