Index: src/interpreter/bytecode-peephole-optimizer.cc |
diff --git a/src/interpreter/bytecode-peephole-optimizer.cc b/src/interpreter/bytecode-peephole-optimizer.cc |
index 803fc23089927faf47fe893deb178dd479265d6f..f5abe935896a50a7b911f2cd231f6f4948a841ef 100644 |
--- a/src/interpreter/bytecode-peephole-optimizer.cc |
+++ b/src/interpreter/bytecode-peephole-optimizer.cc |
@@ -166,7 +166,16 @@ BytecodeNode* BytecodePeepholeOptimizer::Optimize(BytecodeNode* current) { |
} |
} else if (CanElideLast(current)) { |
if (last_.source_info().is_valid()) { |
- current->source_info().Update(last_.source_info()); |
+ if (current->source_info().is_valid() && |
+ current->source_info() != last_.source_info()) { |
rmcilroy
2016/05/20 11:08:03
I think this would be clearer as:
// The last byt
oth
2016/05/20 14:56:43
Revised with a simpler path that produces the same
|
+ // The last bytecode can't be elided without dropping a source |
+ // position. |
+ return current; |
+ } else { |
+ // Transfer source position from bytecode that's being dropped |
+ // to it's successor. |
+ current->source_info().Update(last_.source_info()); |
+ } |
} |
InvalidateLast(); |
} |