IndexBuilderasmjit::InstNode

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

Members

Public Attributes inherited from asmjit::BaseNode

Static Public Attributes

Constants

Member Functions

Construction & Destruction

Instruction Object

Instruction Id

Instruction Options

Extra Register

Instruction Operands

Utilities

Public Member Functions inherited from asmjit::BaseNode

InstNode::InstNode(
InstId inst_id,
InstOptions options,
uint32_t op_count,
uint32_t op_capacity = kBaseOpCapacity
)noexcept[¶]

Creates a new InstNode instance.

InstId InstNode::inst_id() constnodiscardnoexcept[¶]

Returns the instruction id, see BaseInst::Id.

InstId InstNode::real_id() constnodiscardnoexcept[¶]

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

void InstNode::set_inst_id()noexcept[¶]

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

InstOptions InstNode::options() constnodiscardnoexcept[¶]

Returns instruction options, see InstOptions for more details.

bool InstNode::has_option() constnodiscardnoexcept[¶]

Tests whether instruction has the given option set/enabled.

void InstNode::set_options()noexcept[¶]

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

void InstNode::add_options()noexcept[¶]

Adds instruction options to the instruction.

void InstNode::clear_options()noexcept[¶]

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

void InstNode::reset_options()noexcept[¶]

Resets instruction options to none - disabling all instruction options.

bool InstNode::has_extra_reg() constnodiscardnoexcept[¶]

Tests whether the node has an extra register operand.

RegOnly& InstNode::extra_reg()nodiscardnoexcept[1/2][¶]

Returns extra register operand.

const RegOnly& InstNode::extra_reg() constnodiscardnoexcept[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::set_extra_reg(
const Reg& reg
)noexcept[1/2][¶]

Sets extra register operand to reg.

void InstNode::set_extra_reg(
const RegOnly& reg
)noexcept[2/2][¶]

Sets extra register operand to reg.

void InstNode::reset_extra_reg()noexcept[¶]

Resets extra register operand.

Span<Operand>InstNode::operands()nodiscardnoexcept[1/2][¶]

Returns all operands instruction uses as Span<Operand>.

Span<const Operand>InstNode::operands() constnodiscardnoexcept[2/2][¶]

Returns all operands instruction uses as Span<const Operand>.

Operand* InstNode::operands_data()nodiscardnoexcept[1/2][¶]

Returns operands array.

const Operand* InstNode::operands_data() constnodiscardnoexcept[2/2][¶]

Returns operands array (const).

size_t InstNode::op_count() constnodiscardnoexcept[¶]

Returns operand count.

size_t InstNode::op_capacity() constnodiscardnoexcept[¶]

Returns operand capacity.

void InstNode::set_op_count(
size_t op_count
)noexcept[¶]

Sets operand count.

Operand& InstNode::op(
size_t index
)nodiscardnoexcept[1/2][¶]

Returns operand at the given index.

const Operand& InstNode::op(
size_t index
) constnodiscardnoexcept[2/2][¶]

Returns operand at the given index (const).

void InstNode::set_op(
size_t index,
const Operand_& op
)noexcept[¶]

Sets operand at the given index to op.

void InstNode::reset_op(
size_t index
)noexcept[¶]

Resets operand at the given index to none.

void InstNode::reset_op_range(
size_t start,
size_t end
)noexcept[¶]

Resets operands at [start, end) range.

bool InstNode::has_op_type() constnodiscardnoexcept[¶]

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

bool InstNode::has_reg_op() constnodiscardnoexcept[¶]

Tests whether the instruction uses at least one register operand.

bool InstNode::has_mem_op() constnodiscardnoexcept[¶]

Tests whether the instruction uses at least one memory operand.

bool InstNode::has_imm_op() constnodiscardnoexcept[¶]

Tests whether the instruction uses at least one immediate operand.

bool InstNode::has_label_op() constnodiscardnoexcept[¶]

Tests whether the instruction uses at least one label operand.

size_t InstNode::index_of_op_type() constnodiscardnoexcept[¶]

Returns the index of the given operand type op_type.

Note

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

size_t InstNode::index_of_mem_op() constnodiscardnoexcept[¶]

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

size_t InstNode::index_of_imm_op() constnodiscardnoexcept[¶]

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

size_t InstNode::index_of_label_op() constnodiscardnoexcept[¶]

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

uint32_t InstNode::kBaseOpCapacity = 3ustaticconstexpr[¶]

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::kMaxOpCountstaticconstexpr[¶]

Count of maximum number of operands InstNode can hold.

BaseInst InstNode::_base_inst[¶]

Base instruction data.