| 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 return *this; | 424 return *this; |
| 425 } | 425 } |
| 426 | 426 |
| 427 | 427 |
| 428 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadContextSlot(Register context, | 428 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadContextSlot(Register context, |
| 429 int slot_index) { | 429 int slot_index) { |
| 430 DCHECK(slot_index >= 0); | 430 DCHECK(slot_index >= 0); |
| 431 if (FitsInIdx8Operand(slot_index)) { | 431 if (FitsInIdx8Operand(slot_index)) { |
| 432 Output(Bytecode::kLdaContextSlot, context.ToOperand(), | 432 Output(Bytecode::kLdaContextSlot, context.ToOperand(), |
| 433 static_cast<uint8_t>(slot_index)); | 433 static_cast<uint8_t>(slot_index)); |
| 434 } else if (FitsInIdx16Operand(slot_index)) { |
| 435 Output(Bytecode::kLdaContextSlotWide, context.ToOperand(), |
| 436 static_cast<uint16_t>(slot_index)); |
| 434 } else { | 437 } else { |
| 435 UNIMPLEMENTED(); | 438 UNIMPLEMENTED(); |
| 436 } | 439 } |
| 437 return *this; | 440 return *this; |
| 438 } | 441 } |
| 439 | 442 |
| 440 | 443 |
| 441 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreContextSlot(Register context, | 444 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreContextSlot(Register context, |
| 442 int slot_index) { | 445 int slot_index) { |
| 443 DCHECK(slot_index >= 0); | 446 DCHECK(slot_index >= 0); |
| 444 if (FitsInIdx8Operand(slot_index)) { | 447 if (FitsInIdx8Operand(slot_index)) { |
| 445 Output(Bytecode::kStaContextSlot, context.ToOperand(), | 448 Output(Bytecode::kStaContextSlot, context.ToOperand(), |
| 446 static_cast<uint8_t>(slot_index)); | 449 static_cast<uint8_t>(slot_index)); |
| 450 } else if (FitsInIdx16Operand(slot_index)) { |
| 451 Output(Bytecode::kStaContextSlotWide, context.ToOperand(), |
| 452 static_cast<uint16_t>(slot_index)); |
| 447 } else { | 453 } else { |
| 448 UNIMPLEMENTED(); | 454 UNIMPLEMENTED(); |
| 449 } | 455 } |
| 450 return *this; | 456 return *this; |
| 451 } | 457 } |
| 452 | 458 |
| 453 | 459 |
| 454 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupSlot( | 460 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupSlot( |
| 455 const Handle<String> name, TypeofMode typeof_mode) { | 461 const Handle<String> name, TypeofMode typeof_mode) { |
| 456 Bytecode bytecode = (typeof_mode == INSIDE_TYPEOF) | 462 Bytecode bytecode = (typeof_mode == INSIDE_TYPEOF) |
| (...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1663 DCHECK_GT(next_consecutive_count_, 0); | 1669 DCHECK_GT(next_consecutive_count_, 0); |
| 1664 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); | 1670 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); |
| 1665 allocated_.push_back(next_consecutive_register_); | 1671 allocated_.push_back(next_consecutive_register_); |
| 1666 next_consecutive_count_--; | 1672 next_consecutive_count_--; |
| 1667 return Register(next_consecutive_register_++); | 1673 return Register(next_consecutive_register_++); |
| 1668 } | 1674 } |
| 1669 | 1675 |
| 1670 } // namespace interpreter | 1676 } // namespace interpreter |
| 1671 } // namespace internal | 1677 } // namespace internal |
| 1672 } // namespace v8 | 1678 } // namespace v8 |
| OLD | NEW |