#include <Operators.h>
Definition at line 613 of file Operators.h.
◆ OperatorDecoderStream()
IR::OperatorDecoderStream::OperatorDecoderStream |
( |
const std::vector< U8 > & | codeBytes | ) |
|
|
inline |
Definition at line 615 of file Operators.h.
616 : nextByte(codeBytes.data()), end(codeBytes.data()+codeBytes.size()) {}
◆ decodeOp()
template<typename Visitor >
Visitor::Result IR::OperatorDecoderStream::decodeOp |
( |
Visitor & | visitor | ) |
|
|
inline |
Definition at line 621 of file Operators.h.
622 {
625 switch(opcode)
626 {
627 #define VISIT_OPCODE(opcode,name,nameString,Imm,...) \
628 case Opcode::name: \
629 { \
630 WAVM_ASSERT_THROW(nextByte + sizeof(OpcodeAndImm<Imm>) <= end); \
631 OpcodeAndImm<Imm>* encodedOperator = (OpcodeAndImm<Imm>*)nextByte; \
632 nextByte += sizeof(OpcodeAndImm<Imm>); \
633 return visitor.name(encodedOperator->imm); \
634 }
636 #undef VISIT_OPCODE
637 default:
638 nextByte +=
sizeof(
Opcode);
639 return visitor.unknown(opcode);
640 }
641 }
#define WAVM_ASSERT_THROW(cond)
#define ENUM_OPERATORS(visitOp)
VISIT_OPCODE(opcode, name,...)
◆ decodeOpWithoutConsume()
template<typename Visitor >
Visitor::Result IR::OperatorDecoderStream::decodeOpWithoutConsume |
( |
Visitor & | visitor | ) |
|
|
inline |
Definition at line 644 of file Operators.h.
645 {
646 const U8* savedNextByte = nextByte;
647 typename Visitor::Result result =
decodeOp(visitor);
648 nextByte = savedNextByte;
649 return result;
650 }
Visitor::Result decodeOp(Visitor &visitor)
◆ operator bool()
IR::OperatorDecoderStream::operator bool |
( |
| ) |
const |
|
inline |
Definition at line 618 of file Operators.h.
618{ return nextByte < end; }
The documentation for this struct was generated from the following file: