[interpreter] Fix peephole rule on eliding last before jump.

BUG=chromium:629792
LOG=N

Review-Url: https://codereview.chromium.org/2185123003
Cr-Commit-Position: refs/heads/master@{#38140}
This commit is contained in:
oth 2016-07-28 07:41:15 -07:00 committed by Commit bot
parent fc66694de8
commit 02b0985335
2 changed files with 17 additions and 4 deletions

View File

@ -329,12 +329,11 @@ void BytecodePeepholeOptimizer::ElideLastBeforeJumpAction(
BytecodeNode* const node, const PeepholeActionAndData* action_data) {
DCHECK(LastIsValid());
DCHECK(Bytecodes::IsJump(node->bytecode()));
DCHECK(CanElideLastBasedOnSourcePosition(node));
if (!node->source_info().is_valid()) {
node->source_info().Clone(last()->source_info());
} else {
if (!CanElideLastBasedOnSourcePosition(node)) {
next_stage()->Write(last());
} else if (!node->source_info().is_valid()) {
node->source_info().Clone(last()->source_info());
}
InvalidateLast();
}

View File

@ -0,0 +1,14 @@
// 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.
function f(t) {
var f = t || this;
for (var i in t) {
for (var j in t) {
(j);
continue;
}
}
}
f();