OLD | NEW |
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // store to R occurs. | 194 // store to R occurs. |
195 last->source_info().Update(current->source_info()); | 195 last->source_info().Update(current->source_info()); |
196 current->source_info().set_invalid(); | 196 current->source_info().set_invalid(); |
197 } | 197 } |
198 | 198 |
199 } // namespace | 199 } // namespace |
200 | 200 |
201 bool BytecodePeepholeOptimizer::ChangeLdaToLdr(BytecodeNode* const current) { | 201 bool BytecodePeepholeOptimizer::ChangeLdaToLdr(BytecodeNode* const current) { |
202 if (current->bytecode() == Bytecode::kStar) { | 202 if (current->bytecode() == Bytecode::kStar) { |
203 switch (last_.bytecode()) { | 203 switch (last_.bytecode()) { |
204 case Bytecode::kLoadIC: | 204 case Bytecode::kLdaNamedProperty: |
205 TransformLdaStarToLdrLdar(Bytecode::kLdrNamedProperty, &last_, current); | 205 TransformLdaStarToLdrLdar(Bytecode::kLdrNamedProperty, &last_, current); |
206 return true; | 206 return true; |
207 case Bytecode::kKeyedLoadIC: | 207 case Bytecode::kLdaKeyedProperty: |
208 TransformLdaStarToLdrLdar(Bytecode::kLdrKeyedProperty, &last_, current); | 208 TransformLdaStarToLdrLdar(Bytecode::kLdrKeyedProperty, &last_, current); |
209 return true; | 209 return true; |
210 case Bytecode::kLdaGlobal: | 210 case Bytecode::kLdaGlobal: |
211 TransformLdaStarToLdrLdar(Bytecode::kLdrGlobal, &last_, current); | 211 TransformLdaStarToLdrLdar(Bytecode::kLdrGlobal, &last_, current); |
212 return true; | 212 return true; |
213 case Bytecode::kLdaContextSlot: | 213 case Bytecode::kLdaContextSlot: |
214 TransformLdaStarToLdrLdar(Bytecode::kLdrContextSlot, &last_, current); | 214 TransformLdaStarToLdrLdar(Bytecode::kLdrContextSlot, &last_, current); |
215 return true; | 215 return true; |
216 case Bytecode::kLdaUndefined: | 216 case Bytecode::kLdaUndefined: |
217 TransformLdaStarToLdrLdar(Bytecode::kLdrUndefined, &last_, current); | 217 TransformLdaStarToLdrLdar(Bytecode::kLdrUndefined, &last_, current); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 InvalidateLast(); | 307 InvalidateLast(); |
308 return current; | 308 return current; |
309 } | 309 } |
310 | 310 |
311 return current; | 311 return current; |
312 } | 312 } |
313 | 313 |
314 } // namespace interpreter | 314 } // namespace interpreter |
315 } // namespace internal | 315 } // namespace internal |
316 } // namespace v8 | 316 } // namespace v8 |
OLD | NEW |