diff --git a/src/interpreter/bytecode-peephole-optimizer.cc b/src/interpreter/bytecode-peephole-optimizer.cc index 4e9d27fcbf..24912a5ce8 100644 --- a/src/interpreter/bytecode-peephole-optimizer.cc +++ b/src/interpreter/bytecode-peephole-optimizer.cc @@ -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(); } diff --git a/test/mjsunit/ignition/regress-629792-source-position-on-jump.js b/test/mjsunit/ignition/regress-629792-source-position-on-jump.js new file mode 100644 index 0000000000..f87caf681a --- /dev/null +++ b/test/mjsunit/ignition/regress-629792-source-position-on-jump.js @@ -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();