Commit 5d898441 authored by jarin's avatar jarin Committed by Commit bot

[crankshaft] FIx for in deopt at the end of the loop.

We really should deopt before the for-in index increment.

BUG=chromium:662904

Review-Url: https://codereview.chromium.org/2476423003
Cr-Commit-Position: refs/heads/master@{#40828}
parent a168eb15
......@@ -756,7 +756,6 @@ class ForInStatement final : public ForEachStatement {
BailoutId FilterId() const { return BailoutId(local_id(4)); }
BailoutId AssignmentId() const { return BailoutId(local_id(5)); }
BailoutId IncrementId() const { return BailoutId(local_id(6)); }
BailoutId ContinueId() const { return EntryId(); }
BailoutId StackCheckId() const { return BodyId(); }
private:
......
......@@ -5045,7 +5045,7 @@ void HOptimizedGraphBuilder::BuildForInBody(ForInStatement* stmt,
}
HBasicBlock* body_exit = JoinContinue(
stmt, stmt->ContinueId(), current_block(), break_info.continue_block());
stmt, stmt->IncrementId(), current_block(), break_info.continue_block());
if (body_exit != NULL) {
set_current_block(body_exit);
......
// 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
function foo(a) {
var sum = 0;
var a = [0, "a"];
for (var i in a) {
sum += a[i];
}
return sum;
}
assertEquals("0a", foo());
assertEquals("0a", foo());
%OptimizeFunctionOnNextCall(foo);
assertEquals("0a", foo());
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