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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/cctest/interpreter/bytecode_expectations/AssignmentsInBinaryExpression.golden » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/interpreter/bytecode-peephole-optimizer.h" 5 #include "src/interpreter/bytecode-peephole-optimizer.h"
6 6
7 #include "src/interpreter/constant-array-builder.h" 7 #include "src/interpreter/constant-array-builder.h"
8 #include "src/objects-inl.h" 8 #include "src/objects-inl.h"
9 #include "src/objects.h" 9 #include "src/objects.h"
10 10
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 UpdateCurrentBytecode(current); 159 UpdateCurrentBytecode(current);
160 160
161 if (CanElideCurrent(current)) { 161 if (CanElideCurrent(current)) {
162 if (current->source_info().is_valid()) { 162 if (current->source_info().is_valid()) {
163 current->set_bytecode(Bytecode::kNop); 163 current->set_bytecode(Bytecode::kNop);
164 } else { 164 } else {
165 current = nullptr; 165 current = nullptr;
166 } 166 }
167 } else if (CanElideLast(current)) { 167 } else if (CanElideLast(current)) {
168 if (last_.source_info().is_valid()) { 168 if (last_.source_info().is_valid()) {
169 current->source_info().Update(last_.source_info()); 169 if (current->source_info().is_valid() &&
170 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
171 // The last bytecode can't be elided without dropping a source
172 // position.
173 return current;
174 } else {
175 // Transfer source position from bytecode that's being dropped
176 // to it's successor.
177 current->source_info().Update(last_.source_info());
178 }
170 } 179 }
171 InvalidateLast(); 180 InvalidateLast();
172 } 181 }
173 return current; 182 return current;
174 } 183 }
175 184
176 } // namespace interpreter 185 } // namespace interpreter
177 } // namespace internal 186 } // namespace internal
178 } // namespace v8 187 } // namespace v8
OLDNEW
« 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