| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 | 345 |
| 346 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure( | 346 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure( |
| 347 PretenureFlag tenured) { | 347 PretenureFlag tenured) { |
| 348 DCHECK(FitsInImm8Operand(tenured)); | 348 DCHECK(FitsInImm8Operand(tenured)); |
| 349 Output(Bytecode::kCreateClosure, static_cast<uint8_t>(tenured)); | 349 Output(Bytecode::kCreateClosure, static_cast<uint8_t>(tenured)); |
| 350 return *this; | 350 return *this; |
| 351 } | 351 } |
| 352 | 352 |
| 353 | 353 |
| 354 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRegExpLiteral( |
| 355 int literal_index, Register flags) { |
| 356 if (FitsInIdx8Operand(literal_index)) { |
| 357 Output(Bytecode::kCreateRegExpLiteral, static_cast<uint8_t>(literal_index), |
| 358 flags.ToOperand()); |
| 359 } else { |
| 360 UNIMPLEMENTED(); |
| 361 } |
| 362 return *this; |
| 363 } |
| 364 |
| 365 |
| 354 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral( | 366 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral( |
| 355 int literal_index, int flags) { | 367 int literal_index, int flags) { |
| 356 DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bytes. | 368 DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bytes. |
| 357 if (FitsInIdx8Operand(literal_index)) { | 369 if (FitsInIdx8Operand(literal_index)) { |
| 358 Output(Bytecode::kCreateArrayLiteral, static_cast<uint8_t>(literal_index), | 370 Output(Bytecode::kCreateArrayLiteral, static_cast<uint8_t>(literal_index), |
| 359 static_cast<uint8_t>(flags)); | 371 static_cast<uint8_t>(flags)); |
| 360 } else { | 372 } else { |
| 361 UNIMPLEMENTED(); | 373 UNIMPLEMENTED(); |
| 362 } | 374 } |
| 363 return *this; | 375 return *this; |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 | 857 |
| 846 Register TemporaryRegisterScope::NewRegister() { | 858 Register TemporaryRegisterScope::NewRegister() { |
| 847 count_++; | 859 count_++; |
| 848 last_register_index_ = builder_->BorrowTemporaryRegister(); | 860 last_register_index_ = builder_->BorrowTemporaryRegister(); |
| 849 return Register(last_register_index_); | 861 return Register(last_register_index_); |
| 850 } | 862 } |
| 851 | 863 |
| 852 } // namespace interpreter | 864 } // namespace interpreter |
| 853 } // namespace internal | 865 } // namespace internal |
| 854 } // namespace v8 | 866 } // namespace v8 |
| OLD | NEW |