IndexCompilerasmjit::FuncNode

asmjit::FuncNode Class Reference [¶]

Inheritance diagram for asmjit::FuncNode:
asmjit::LabelNode asmjit::BaseNode

Function node represents a function used by BaseCompiler.

A function is composed of the following:

In a node list, the function and its body looks like the following:

[...] - Anything before the function.
[FuncNode] - Entry point of the function, acts as a label as well.
<Prolog> - Prolog inserted by the register allocator.
{...} - Function body - user code basically.
[ExitLabel] - Exit label
<Epilog> - Epilog inserted by the register allocator.
<Return> - Return inserted by the register allocator.
{...} - Can contain data or user code (error handling, special cases, ...).
[FuncEnd] - End sentinel
[...] - Anything after the function.

When a function is added to the instruction stream by BaseCompiler::add_func() it actually inserts 3 nodes (FuncNode, ExitLabel, and FuncEnd) and sets the current cursor to be FuncNode. When BaseCompiler::end_func() is called the cursor is set to FuncEnd. This guarantees that user can use ExitLabel as a marker after additional code or data can be placed, which is a common practice.

Classes

Member Functions

Construction & Destruction
Accessors
Public Member Functions inherited from asmjit::LabelNode
Public Member Functions inherited from asmjit::BaseNode

FuncNode::FuncNode(
uint32_t label_id = Globals::kInvalidId
)explicitnoexcept[¶]

Creates a new FuncNode instance.

Always use BaseCompiler::add_func() to create a new FuncNode.

LabelNode* FuncNode::exit_node() constnodiscardnoexcept[¶]

Returns function exit LabelNode.

Label FuncNode::exit_label() constnodiscardnoexcept[¶]

Returns function exit label.

SentinelNode* FuncNode::end_node() constnodiscardnoexcept[¶]

Returns "End of Func" sentinel node.

FuncDetail& FuncNode::detail()nodiscardnoexcept[1/2][¶]

Returns function detail.

const FuncDetail& FuncNode::detail() constnodiscardnoexcept[2/2][¶]

Returns function detail.

FuncFrame& FuncNode::frame()nodiscardnoexcept[1/2][¶]

Returns function frame.

const FuncFrame& FuncNode::frame() constnodiscardnoexcept[2/2][¶]

Returns function frame.

FuncAttributes FuncNode::attributes() constnodiscardnoexcept[¶]

Returns function attributes.

void FuncNode::add_attributes()noexcept[¶]

Adds attrs to the function attributes.

uint32_t FuncNode::arg_count() constnodiscardnoexcept[¶]

Returns arguments count.

ArgPack* FuncNode::arg_packs() constnodiscardnoexcept[¶]

Returns argument packs.

bool FuncNode::has_ret() constnodiscardnoexcept[¶]

Tests whether the function has a return value.

ArgPack& FuncNode::arg_pack(
size_t arg_index
) constnodiscardnoexcept[¶]

Returns argument pack at arg_index.

void FuncNode::set_arg(
size_t arg_index,
const Reg& virt_reg
)noexcept[1/4][¶]

Sets argument at arg_index.

void FuncNode::set_arg(
size_t arg_index,
const RegOnly& virt_reg
)noexcept[2/4][¶]

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

void FuncNode::set_arg(
size_t arg_index,
size_t value_index,
const Reg& virt_reg
)noexcept[3/4][¶]

Sets argument at arg_index and value_index.

void FuncNode::set_arg(
size_t arg_index,
size_t value_index,
const RegOnly& virt_reg
)noexcept[4/4][¶]

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

void FuncNode::reset_arg(
size_t arg_index
)noexcept[1/2][¶]

Resets argument pack at arg_index.

void FuncNode::reset_arg(
size_t arg_index,
size_t value_index
)noexcept[2/2][¶]

Resets argument pack at arg_index.

FuncDetail FuncNode::_func_detail[¶]

Function detail.

FuncFrame FuncNode::_frame[¶]

Function frame.

LabelNode* FuncNode::_exit_node[¶]

Function exit label.

SentinelNode* FuncNode::_end[¶]

Function end (sentinel).

ArgPack* FuncNode::_args[¶]

Argument packs.