asmjit::InstNode Class Reference
Inheritance diagram for asmjit::InstNode:
asmjit::BaseNode asmjit::InstNodeWithOperands< InstNode::kBaseOpCapacity > asmjit::InstNodeWithOperands< kN > asmjit::FuncRetNode asmjit::InvokeNode asmjit::JumpNode

Instruction node.

Wraps an instruction with its options and operands.

Public Members

- Public Attributes inherited from asmjit::BaseNode

Static Public Attributes


Member Functions

Construction & Destruction
Instruction Object
Instruction Id
Instruction Options
Extra Register
Instruction Operands
- Public Member Functions inherited from asmjit::BaseNode

Constructor & Destructor Documentation

InstNode::InstNode(BaseBuilder* cb, InstId instId, InstOptions options, uint32_t opCount, uint32_t opCapacity = kBaseOpCapacity)noexcept◆ 

Creates a new InstNode instance.

Member Function Documentation

InstId InstNode::id() constnoexcept◆ 

Returns the instruction id, see BaseInst::Id.

InstId InstNode::realId() constnoexcept◆ 

Returns the instruction real id, see BaseInst::Id.

void InstNode::setId(InstId id)noexcept◆ 

Sets the instruction id to id, see BaseInst::Id.

InstOptions InstNode::options() constnoexcept◆ 

Returns instruction options, see InstOptions for more details.

bool InstNode::hasOption(InstOptions option) constnoexcept◆ 

Tests whether instruction has the given \option` set/enabled.

void InstNode::setOptions(InstOptions options)noexcept◆ 

Sets instruction options to the provided value, resetting all others.

void InstNode::addOptions(InstOptions options)noexcept◆ 

Adds instruction options to the instruction.

void InstNode::clearOptions(InstOptions options)noexcept◆ 

Clears instruction options of the instruction (disables the given options).

void InstNode::resetOptions()noexcept◆ 

Resets instruction options to none - disabling all instruction options.

bool InstNode::hasExtraReg() constnoexcept◆ 

Tests whether the node has an extra register operand.

RegOnly& InstNode::extraReg()noexcept[1/2]◆ 

Returns extra register operand.

const RegOnly& InstNode::extraReg() constnoexcept[2/2]◆ 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void InstNode::setExtraReg(const BaseReg& reg)noexcept[1/2]◆ 

Sets extra register operand to reg.

void InstNode::setExtraReg(const RegOnly& reg)noexcept[2/2]◆ 

Sets extra register operand to reg.

void InstNode::resetExtraReg()noexcept◆ 

Resets extra register operand.

uint32_t InstNode::opCount() constnoexcept◆ 

Returns operand count.

uint32_t InstNode::opCapacity() constnoexcept◆ 

Returns operand capacity.

void InstNode::setOpCount(uint32_t opCount)noexcept◆ 

Sets operand count.

Operand* InstNode::operands()noexcept[1/2]◆ 

Returns operands array.

const Operand* InstNode::operands() constnoexcept[2/2]◆ 

Returns operands array (const).

Operand& InstNode::op(uint32_t index)noexcept[1/2]◆ 

Returns operand at the given index.

const Operand& InstNode::op(uint32_t index) constnoexcept[2/2]◆ 

Returns operand at the given index (const).

void InstNode::setOp(uint32_t index, const Operand_& op)noexcept◆ 

Sets operand at the given index to op.

void InstNode::resetOp(uint32_t index)noexcept◆ 

Resets operand at the given index to none.

void InstNode::resetOpRange(uint32_t start, uint32_t end)noexcept◆ 

Resets operands at [start, end) range.

bool InstNode::hasOpType(OperandType opType) constnoexcept◆ 

Tests whether the given operand type opType is used by the instruction.

bool InstNode::hasRegOp() constnoexcept◆ 

Tests whether the instruction uses at least one register operand.

bool InstNode::hasMemOp() constnoexcept◆ 

Tests whether the instruction uses at least one memory operand.

bool InstNode::hasImmOp() constnoexcept◆ 

Tests whether the instruction uses at least one immediate operand.

bool InstNode::hasLabelOp() constnoexcept◆ 

Tests whether the instruction uses at least one label operand.

uint32_t InstNode::indexOfOpType(OperandType opType) constnoexcept◆ 

Returns the index of the given operand type opType.

If the operand type wa found, the value returned represents its index in operands() array, otherwise Globals::kNotFound is returned to signalize that the operand was not found.

uint32_t InstNode::indexOfMemOp() constnoexcept◆ 

A shortcut that calls indexOfOpType(OperandType::kMem).

uint32_t InstNode::indexOfImmOp() constnoexcept◆ 

A shortcut that calls indexOfOpType(OperandType::kImm).

uint32_t InstNode::indexOfLabelOp() constnoexcept◆ 

A shortcut that calls indexOfOpType(OperandType::kLabel).

Member Data Documentation

uint32_t InstNode::kBaseOpCapacity = uint32_t((128 - sizeof(BaseNode) - sizeof(BaseInst)) / sizeof(Operand_))constexprstaticconstexpr◆ 

The number of embedded operands for a default InstNode instance that are always allocated as a part of the instruction itself.

Minimum embedded operands is 4, but in 32-bit more pointers are smaller and we can embed 5. The rest (up to 6 operands) is considered extended.

The number of operands InstNode holds is decided when InstNode is created.

uint32_t InstNode::kFullOpCapacity = Globals::kMaxOpCountconstexprstaticconstexpr◆ 

Count of maximum number of operands InstNode can hold.

BaseInst InstNode::_baseInst◆ 

Base instruction data.