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

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

Issue 2042633002: [interpreter] Ensure optimizations preserve source positions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | src/interpreter/bytecodes.cc » ('j') | src/interpreter/bytecodes.cc » ('J')
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 790b270abddf3cccb90ba3a6b834c1a87795891f..4e0b58c9b09315f6a87f201550cbaba0e48c8d47 100644
--- a/src/interpreter/bytecode-peephole-optimizer.cc
+++ b/src/interpreter/bytecode-peephole-optimizer.cc
@@ -173,6 +173,12 @@ namespace {
void TransformLdaStarToLdrLdar(Bytecode new_bytecode, BytecodeNode* const last,
BytecodeNode* const current) {
DCHECK_EQ(current->bytecode(), Bytecode::kStar);
+ if (current->source_info().is_statement() &&
+ last->source_info().is_statement()) {
rmcilroy 2016/06/07 09:46:10 As discussed offline, I think we need to not do th
oth 2016/06/07 13:46:17 Yes, thanks for examining this. I agree.
+ // The transform won't maintain causal ordering for the debugger.
+ return;
rmcilroy 2016/06/07 09:46:11 This returns here without doing anything, but then
oth 2016/06/07 13:46:17 Done.
+ }
+
//
// An example transformation here would be:
//
@@ -188,12 +194,11 @@ void TransformLdaStarToLdrLdar(Bytecode new_bytecode, BytecodeNode* const last,
current->operand_scale());
// If there was a source position on |current| transfer it to the
- // updated |last| to maintain the debugger's causal view. ie. if an
- // expression position LdrGlobal is the bytecode that could throw
- // and if a statement position it needs to be placed before the
- // store to R occurs.
- last->source_info().Update(current->source_info());
- current->source_info().set_invalid();
+ // updated |last| to maintain the debugger's causal view.
+ if (last->source_info().is_statement()) {
+ last->source_info().Update(current->source_info());
+ current->source_info().set_invalid();
+ }
rmcilroy 2016/06/07 09:46:11 As discussed offline - I don't think this block do
oth 2016/06/07 13:46:17 Done.
}
} // namespace
« no previous file with comments | « no previous file | src/interpreter/bytecodes.cc » ('j') | src/interpreter/bytecodes.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698