[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:
parent
fc66694de8
commit
02b0985335
@ -329,12 +329,11 @@ void BytecodePeepholeOptimizer::ElideLastBeforeJumpAction(
|
|||||||
BytecodeNode* const node, const PeepholeActionAndData* action_data) {
|
BytecodeNode* const node, const PeepholeActionAndData* action_data) {
|
||||||
DCHECK(LastIsValid());
|
DCHECK(LastIsValid());
|
||||||
DCHECK(Bytecodes::IsJump(node->bytecode()));
|
DCHECK(Bytecodes::IsJump(node->bytecode()));
|
||||||
DCHECK(CanElideLastBasedOnSourcePosition(node));
|
|
||||||
|
|
||||||
if (!node->source_info().is_valid()) {
|
if (!CanElideLastBasedOnSourcePosition(node)) {
|
||||||
node->source_info().Clone(last()->source_info());
|
|
||||||
} else {
|
|
||||||
next_stage()->Write(last());
|
next_stage()->Write(last());
|
||||||
|
} else if (!node->source_info().is_valid()) {
|
||||||
|
node->source_info().Clone(last()->source_info());
|
||||||
}
|
}
|
||||||
InvalidateLast();
|
InvalidateLast();
|
||||||
}
|
}
|
||||||
|
@ -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();
|
Loading…
Reference in New Issue
Block a user