OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } else { | 287 } else { |
288 DefaultAction(node); | 288 DefaultAction(node); |
289 } | 289 } |
290 } | 290 } |
291 | 291 |
292 void BytecodePeepholeOptimizer::TransformToStarIfLoadingNameConstantAction( | 292 void BytecodePeepholeOptimizer::TransformToStarIfLoadingNameConstantAction( |
293 BytecodeNode* const node, const PeepholeActionAndData* action_data) { | 293 BytecodeNode* const node, const PeepholeActionAndData* action_data) { |
294 DCHECK_EQ(last()->bytecode(), Bytecode::kLdaConstant); | 294 DCHECK_EQ(last()->bytecode(), Bytecode::kLdaConstant); |
295 DCHECK(!Bytecodes::IsJump(node->bytecode())); | 295 DCHECK(!Bytecodes::IsJump(node->bytecode())); |
296 | 296 |
| 297 // TODO(5203): Remove this temporary exception. |
| 298 AllowHandleDereference allow_deref; |
297 if (GetConstantForIndexOperand(last(), 0)->IsName()) { | 299 if (GetConstantForIndexOperand(last(), 0)->IsName()) { |
298 node->replace_bytecode(Bytecode::kStar); | 300 node->replace_bytecode(Bytecode::kStar); |
299 } | 301 } |
300 DefaultAction(node); | 302 DefaultAction(node); |
301 } | 303 } |
302 | 304 |
303 void BytecodePeepholeOptimizer::DefaultJumpAction( | 305 void BytecodePeepholeOptimizer::DefaultJumpAction( |
304 BytecodeNode* const node, const PeepholeActionAndData* action_data) { | 306 BytecodeNode* const node, const PeepholeActionAndData* action_data) { |
305 DCHECK(LastIsValid()); | 307 DCHECK(LastIsValid()); |
306 DCHECK(Bytecodes::IsJump(node->bytecode())); | 308 DCHECK(Bytecodes::IsJump(node->bytecode())); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 #undef CASE | 357 #undef CASE |
356 default: | 358 default: |
357 UNREACHABLE(); | 359 UNREACHABLE(); |
358 break; | 360 break; |
359 } | 361 } |
360 } | 362 } |
361 | 363 |
362 } // namespace interpreter | 364 } // namespace interpreter |
363 } // namespace internal | 365 } // namespace internal |
364 } // namespace v8 | 366 } // namespace v8 |
OLD | NEW |