| 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-iterator.h" | 5 #include "src/interpreter/bytecode-array-iterator.h" |
| 6 | 6 |
| 7 #include "src/objects-inl.h" | 7 #include "src/objects-inl.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 int8_t BytecodeArrayIterator::GetSmi8Operand(int operand_index) const { | 56 int8_t BytecodeArrayIterator::GetSmi8Operand(int operand_index) const { |
| 57 uint32_t operand = GetRawOperand(operand_index, OperandType::kImm8); | 57 uint32_t operand = GetRawOperand(operand_index, OperandType::kImm8); |
| 58 return static_cast<int8_t>(operand); | 58 return static_cast<int8_t>(operand); |
| 59 } | 59 } |
| 60 | 60 |
| 61 | 61 |
| 62 int BytecodeArrayIterator::GetCountOperand(int operand_index) const { |
| 63 uint32_t operand = GetRawOperand(operand_index, OperandType::kCount); |
| 64 return static_cast<int>(operand); |
| 65 } |
| 66 |
| 67 |
| 62 int BytecodeArrayIterator::GetIndexOperand(int operand_index) const { | 68 int BytecodeArrayIterator::GetIndexOperand(int operand_index) const { |
| 63 uint32_t operand = GetRawOperand(operand_index, OperandType::kIdx); | 69 uint32_t operand = GetRawOperand(operand_index, OperandType::kIdx); |
| 64 return static_cast<int>(operand); | 70 return static_cast<int>(operand); |
| 65 } | 71 } |
| 66 | 72 |
| 67 | 73 |
| 68 int BytecodeArrayIterator::GetWideIndexOperand(int operand_index) const { | 74 int BytecodeArrayIterator::GetWideIndexOperand(int operand_index) const { |
| 69 uint32_t operand = GetRawOperand(operand_index, OperandType::kWideIdx); | 75 uint32_t operand = GetRawOperand(operand_index, OperandType::kWideIdx); |
| 70 return static_cast<int>(operand); | 76 return static_cast<int>(operand); |
| 71 } | 77 } |
| 72 | 78 |
| 73 | 79 |
| 74 Register BytecodeArrayIterator::GetRegisterOperand(int operand_index) const { | 80 Register BytecodeArrayIterator::GetRegisterOperand(int operand_index) const { |
| 75 uint32_t operand = GetRawOperand(operand_index, OperandType::kReg); | 81 uint32_t operand = GetRawOperand(operand_index, OperandType::kReg); |
| 76 return Register::FromOperand(operand); | 82 return Register::FromOperand(operand); |
| 77 } | 83 } |
| 78 | 84 |
| 79 | 85 |
| 80 Handle<Object> BytecodeArrayIterator::GetConstantForIndexOperand( | 86 Handle<Object> BytecodeArrayIterator::GetConstantForIndexOperand( |
| 81 int operand_index) const { | 87 int operand_index) const { |
| 82 Handle<FixedArray> constants = handle(bytecode_array()->constant_pool()); | 88 Handle<FixedArray> constants = handle(bytecode_array()->constant_pool()); |
| 83 return FixedArray::get(constants, GetIndexOperand(operand_index)); | 89 return FixedArray::get(constants, GetIndexOperand(operand_index)); |
| 84 } | 90 } |
| 85 | 91 |
| 86 } // namespace interpreter | 92 } // namespace interpreter |
| 87 } // namespace internal | 93 } // namespace internal |
| 88 } // namespace v8 | 94 } // namespace v8 |
| OLD | NEW |