Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Unified Diff: src/interpreter/bytecode-peephole-optimizer.cc

Issue 1998203002: [Interpreter] Preserve source positions in peephole optimizer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/interpreter/bytecode_expectations/AssignmentsInBinaryExpression.golden » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « no previous file | test/cctest/interpreter/bytecode_expectations/AssignmentsInBinaryExpression.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698