| 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 flags.ToOperand()); | 437 flags.ToOperand()); |
| 438 } else { | 438 } else { |
| 439 UNIMPLEMENTED(); | 439 UNIMPLEMENTED(); |
| 440 } | 440 } |
| 441 return *this; | 441 return *this; |
| 442 } | 442 } |
| 443 | 443 |
| 444 | 444 |
| 445 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral( | 445 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral( |
| 446 int literal_index, int flags) { | 446 int literal_index, int flags) { |
| 447 DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bytes. | 447 DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bits. |
| 448 if (FitsInIdx8Operand(literal_index)) { | 448 if (FitsInIdx8Operand(literal_index)) { |
| 449 Output(Bytecode::kCreateArrayLiteral, static_cast<uint8_t>(literal_index), | 449 Output(Bytecode::kCreateArrayLiteral, static_cast<uint8_t>(literal_index), |
| 450 static_cast<uint8_t>(flags)); | 450 static_cast<uint8_t>(flags)); |
| 451 } else { | 451 } else { |
| 452 UNIMPLEMENTED(); | 452 UNIMPLEMENTED(); |
| 453 } | 453 } |
| 454 return *this; | 454 return *this; |
| 455 } | 455 } |
| 456 | 456 |
| 457 | 457 |
| 458 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateObjectLiteral( | 458 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateObjectLiteral( |
| 459 int literal_index, int flags) { | 459 int literal_index, int flags) { |
| 460 DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bytes. | 460 DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bits. |
| 461 if (FitsInIdx8Operand(literal_index)) { | 461 if (FitsInIdx8Operand(literal_index)) { |
| 462 Output(Bytecode::kCreateObjectLiteral, static_cast<uint8_t>(literal_index), | 462 Output(Bytecode::kCreateObjectLiteral, static_cast<uint8_t>(literal_index), |
| 463 static_cast<uint8_t>(flags)); | 463 static_cast<uint8_t>(flags)); |
| 464 } else { | 464 } else { |
| 465 UNIMPLEMENTED(); | 465 UNIMPLEMENTED(); |
| 466 } | 466 } |
| 467 return *this; | 467 return *this; |
| 468 } | 468 } |
| 469 | 469 |
| 470 | 470 |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 DCHECK_GT(next_consecutive_count_, 0); | 1239 DCHECK_GT(next_consecutive_count_, 0); |
| 1240 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); | 1240 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); |
| 1241 allocated_.push_back(next_consecutive_register_); | 1241 allocated_.push_back(next_consecutive_register_); |
| 1242 next_consecutive_count_--; | 1242 next_consecutive_count_--; |
| 1243 return Register(next_consecutive_register_++); | 1243 return Register(next_consecutive_register_++); |
| 1244 } | 1244 } |
| 1245 | 1245 |
| 1246 } // namespace interpreter | 1246 } // namespace interpreter |
| 1247 } // namespace internal | 1247 } // namespace internal |
| 1248 } // namespace v8 | 1248 } // namespace v8 |
| OLD | NEW |