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 Output(BytecodeForWideOperands(bytecode), object.ToOperand(), | 437 Output(BytecodeForWideOperands(bytecode), object.ToOperand(), |
438 key.ToOperand(), static_cast<uint16_t>(feedback_slot)); | 438 key.ToOperand(), static_cast<uint16_t>(feedback_slot)); |
439 } else { | 439 } else { |
440 UNIMPLEMENTED(); | 440 UNIMPLEMENTED(); |
441 } | 441 } |
442 return *this; | 442 return *this; |
443 } | 443 } |
444 | 444 |
445 | 445 |
446 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure( | 446 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure( |
447 Handle<SharedFunctionInfo> shared_info, PretenureFlag tenured) { | 447 PretenureFlag tenured) { |
448 size_t entry = GetConstantPoolEntry(shared_info); | |
449 DCHECK(FitsInImm8Operand(tenured)); | 448 DCHECK(FitsInImm8Operand(tenured)); |
450 if (FitsInIdx8Operand(entry)) { | 449 Output(Bytecode::kCreateClosure, static_cast<uint8_t>(tenured)); |
451 Output(Bytecode::kCreateClosure, static_cast<uint8_t>(entry), | |
452 static_cast<uint8_t>(tenured)); | |
453 } else if (FitsInIdx16Operand(entry)) { | |
454 Output(Bytecode::kCreateClosureWide, static_cast<uint16_t>(entry), | |
455 static_cast<uint8_t>(tenured)); | |
456 } else { | |
457 UNIMPLEMENTED(); | |
458 } | |
459 return *this; | 450 return *this; |
460 } | 451 } |
461 | 452 |
462 | 453 |
463 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArguments( | 454 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArguments( |
464 CreateArgumentsType type) { | 455 CreateArgumentsType type) { |
465 // TODO(rmcilroy): Consider passing the type as a bytecode operand rather | 456 // TODO(rmcilroy): Consider passing the type as a bytecode operand rather |
466 // than having two different bytecodes once we have better support for | 457 // than having two different bytecodes once we have better support for |
467 // branches in the InterpreterAssembler. | 458 // branches in the InterpreterAssembler. |
468 Bytecode bytecode = BytecodeForCreateArguments(type); | 459 Bytecode bytecode = BytecodeForCreateArguments(type); |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1339 DCHECK_GT(next_consecutive_count_, 0); | 1330 DCHECK_GT(next_consecutive_count_, 0); |
1340 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); | 1331 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); |
1341 allocated_.push_back(next_consecutive_register_); | 1332 allocated_.push_back(next_consecutive_register_); |
1342 next_consecutive_count_--; | 1333 next_consecutive_count_--; |
1343 return Register(next_consecutive_register_++); | 1334 return Register(next_consecutive_register_++); |
1344 } | 1335 } |
1345 | 1336 |
1346 } // namespace interpreter | 1337 } // namespace interpreter |
1347 } // namespace internal | 1338 } // namespace internal |
1348 } // namespace v8 | 1339 } // namespace v8 |
OLD | NEW |