Commit f8ed6fb1 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Ensure AstGraphBuilder::CheckOsrEntry hits once.

The predicate in question should only trigger once and hence the stack
height should not be updated incrementally. This puts checks into place
ensuring this holds.

R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2333923008
Cr-Commit-Position: refs/heads/master@{#39472}
parent 7de8639e
......@@ -79,7 +79,7 @@ CompilationInfo::CompilationInfo(ParseInfo* parse_info,
isolate->is_profiling()),
parameter_count_(0),
optimization_id_(-1),
osr_expr_stack_height_(0),
osr_expr_stack_height_(-1),
debug_name_(debug_name) {}
CompilationInfo::~CompilationInfo() {
......
......@@ -3988,8 +3988,8 @@ Node* AstGraphBuilder::TryFastToName(Node* input) {
bool AstGraphBuilder::CheckOsrEntry(IterationStatement* stmt) {
if (info()->osr_ast_id() == stmt->OsrEntryId()) {
info()->set_osr_expr_stack_height(std::max(
environment()->stack_height(), info()->osr_expr_stack_height()));
DCHECK_EQ(-1, info()->osr_expr_stack_height());
info()->set_osr_expr_stack_height(environment()->stack_height());
return true;
}
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment