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/bytecodes.h" | 5 #include "src/interpreter/bytecodes.h" |
6 | 6 |
7 #include "src/frames.h" | 7 #include "src/frames.h" |
8 #include "src/interpreter/bytecode-traits.h" | 8 #include "src/interpreter/bytecode-traits.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
320 #define CASE(Name, _) \ | 320 #define CASE(Name, _) \ |
321 case OperandType::k##Name: \ | 321 case OperandType::k##Name: \ |
322 break; | 322 break; |
323 NON_REGISTER_OPERAND_TYPE_LIST(CASE) | 323 NON_REGISTER_OPERAND_TYPE_LIST(CASE) |
324 REGISTER_INPUT_OPERAND_TYPE_LIST(CASE) | 324 REGISTER_INPUT_OPERAND_TYPE_LIST(CASE) |
325 #undef CASE | 325 #undef CASE |
326 } | 326 } |
327 return false; | 327 return false; |
328 } | 328 } |
329 | 329 |
330 // static | |
331 bool Bytecodes::IsImmediateOperandType(OperandType operand_type) { | |
332 return operand_type == OperandType::kImm8; | |
333 } | |
334 | |
335 // static | |
336 bool Bytecodes::IsIndexOperandType(OperandType operand_type) { | |
337 return operand_type == OperandType::kIdx8 || | |
338 operand_type == OperandType::kIdx16; | |
339 } | |
rmcilroy
2016/02/10 15:26:12
nit - move above IsMaybeRegisterOperandType (and m
Stefano Sanfilippo
2016/02/10 15:52:00
Done.
| |
340 | |
330 namespace { | 341 namespace { |
331 static Register DecodeRegister(const uint8_t* operand_start, | 342 static Register DecodeRegister(const uint8_t* operand_start, |
332 OperandType operand_type) { | 343 OperandType operand_type) { |
333 switch (Bytecodes::SizeOfOperand(operand_type)) { | 344 switch (Bytecodes::SizeOfOperand(operand_type)) { |
334 case OperandSize::kByte: | 345 case OperandSize::kByte: |
335 return Register::FromOperand(*operand_start); | 346 return Register::FromOperand(*operand_start); |
336 case OperandSize::kShort: | 347 case OperandSize::kShort: |
337 return Register::FromWideOperand(ReadUnalignedUInt16(operand_start)); | 348 return Register::FromWideOperand(ReadUnalignedUInt16(operand_start)); |
338 case OperandSize::kNone: { | 349 case OperandSize::kNone: { |
339 UNREACHABLE(); | 350 UNREACHABLE(); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
579 } else { | 590 } else { |
580 std::ostringstream s; | 591 std::ostringstream s; |
581 s << "r" << index(); | 592 s << "r" << index(); |
582 return s.str(); | 593 return s.str(); |
583 } | 594 } |
584 } | 595 } |
585 | 596 |
586 } // namespace interpreter | 597 } // namespace interpreter |
587 } // namespace internal | 598 } // namespace internal |
588 } // namespace v8 | 599 } // namespace v8 |
OLD | NEW |