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-array-builder.h" | 5 #include "src/interpreter/bytecode-array-builder.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace interpreter { | 9 namespace interpreter { |
10 | 10 |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 // TODO(rmcilroy): Consider passing the type as a bytecode operand rather | 456 // TODO(rmcilroy): Consider passing the type as a bytecode operand rather |
457 // than having two different bytecodes once we have better support for | 457 // than having two different bytecodes once we have better support for |
458 // branches in the InterpreterAssembler. | 458 // branches in the InterpreterAssembler. |
459 Bytecode bytecode = BytecodeForCreateArguments(type); | 459 Bytecode bytecode = BytecodeForCreateArguments(type); |
460 Output(bytecode); | 460 Output(bytecode); |
461 return *this; | 461 return *this; |
462 } | 462 } |
463 | 463 |
464 | 464 |
465 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRegExpLiteral( | 465 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRegExpLiteral( |
466 int literal_index, Register flags) { | 466 int literal_index, int flags) { |
| 467 DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bits. |
467 if (FitsInIdx8Operand(literal_index)) { | 468 if (FitsInIdx8Operand(literal_index)) { |
468 Output(Bytecode::kCreateRegExpLiteral, static_cast<uint8_t>(literal_index), | 469 Output(Bytecode::kCreateRegExpLiteral, static_cast<uint8_t>(literal_index), |
469 flags.ToOperand()); | 470 static_cast<uint8_t>(flags)); |
470 } else { | 471 } else { |
471 UNIMPLEMENTED(); | 472 UNIMPLEMENTED(); |
472 } | 473 } |
473 return *this; | 474 return *this; |
474 } | 475 } |
475 | 476 |
476 | 477 |
477 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral( | 478 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral( |
478 int literal_index, int flags) { | 479 int literal_index, int flags) { |
479 DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bits. | 480 DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bits. |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 DCHECK_GT(next_consecutive_count_, 0); | 1331 DCHECK_GT(next_consecutive_count_, 0); |
1331 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); | 1332 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); |
1332 allocated_.push_back(next_consecutive_register_); | 1333 allocated_.push_back(next_consecutive_register_); |
1333 next_consecutive_count_--; | 1334 next_consecutive_count_--; |
1334 return Register(next_consecutive_register_++); | 1335 return Register(next_consecutive_register_++); |
1335 } | 1336 } |
1336 | 1337 |
1337 } // namespace interpreter | 1338 } // namespace interpreter |
1338 } // namespace internal | 1339 } // namespace internal |
1339 } // namespace v8 | 1340 } // namespace v8 |
OLD | NEW |