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