Commit 2da181b0 authored by jarin's avatar jarin Committed by Commit bot

[turbofan] Fix OSR environment in for-in.

BUG=chromium:607493
LOG=n

Review-Url: https://codereview.chromium.org/1949433002
Cr-Commit-Position: refs/heads/master@{#35982}
parent 7c6ff54e
......@@ -1398,10 +1398,10 @@ void AstGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
VisitIterationBody(stmt, &for_loop);
}
test_value.End();
index = environment()->Peek(0);
for_loop.EndBody();
// Increment counter and continue.
index = environment()->Peek(0);
index = NewNode(javascript()->ForInStep(), index);
environment()->Poke(0, index);
}
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
var a = [1];
function g() {
for (var x in a) {
try {
for (var i = 0; i < 10; i++) { %OptimizeOsr(); }
return;
} catch(e) {
continue;
}
}
}
g();
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