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::addFunc() it actually inserts 3 nodes (FuncNode, ExitLabel, and FuncEnd) and sets the current cursor to be FuncNode. When BaseCompiler::endFunc() 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.

Public Members

Members
- Public Attributes inherited from asmjit::LabelNode
- Public Attributes inherited from asmjit::BaseNode

Classes

Member Functions

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

Constructor & Destructor Documentation

FuncNode::FuncNode(BaseBuilder* cb)noexcept◆ 

Creates a new FuncNode instance.

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

Member Function Documentation

LabelNode* FuncNode::exitNode() constnoexcept◆ 

Returns function exit LabelNode.

Label FuncNode::exitLabel() constnoexcept◆ 

Returns function exit label.

SentinelNode* FuncNode::endNode() constnoexcept◆ 

Returns "End of Func" sentinel node.

FuncDetail& FuncNode::detail()noexcept[1/2]◆ 

Returns function detail.

const FuncDetail& FuncNode::detail() constnoexcept[2/2]◆ 

Returns function detail.

FuncFrame& FuncNode::frame()noexcept[1/2]◆ 

Returns function frame.

const FuncFrame& FuncNode::frame() constnoexcept[2/2]◆ 

Returns function frame.

FuncAttributes FuncNode::attributes() constnoexcept◆ 

Returns function attributes.

void FuncNode::addAttributes(FuncAttributes attrs)noexcept◆ 

Adds attrs to the function attributes.

uint32_t FuncNode::argCount() constnoexcept◆ 

Returns arguments count.

ArgPack* FuncNode::argPacks() constnoexcept◆ 

Returns argument packs.

bool FuncNode::hasRet() constnoexcept◆ 

Tests whether the function has a return value.

ArgPack& FuncNode::argPack(size_t argIndex) constnoexcept◆ 

Returns argument pack at argIndex.

void FuncNode::setArg(size_t argIndex, const BaseReg& vReg)noexcept[1/4]◆ 

Sets argument at argIndex.

void FuncNode::setArg(size_t argIndex, const RegOnly& vReg)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::setArg(size_t argIndex, size_t valueIndex, const BaseReg& vReg)noexcept[3/4]◆ 

Sets argument at argIndex and valueIndex.

void FuncNode::setArg(size_t argIndex, size_t valueIndex, const RegOnly& vReg)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::resetArg(size_t argIndex)noexcept[1/2]◆ 

Resets argument pack at argIndex.

void FuncNode::resetArg(size_t argIndex, size_t valueIndex)noexcept[2/2]◆ 

Resets argument pack at argIndex.

Member Data Documentation

FuncDetail FuncNode::_funcDetail◆ 

Function detail.

FuncFrame FuncNode::_frame◆ 

Function frame.

LabelNode* FuncNode::_exitNode◆ 

Function exit label.

SentinelNode* FuncNode::_end◆ 

Function end (sentinel).

ArgPack* FuncNode::_args◆ 

Argument packs.