IndexFunctionasmjit::CallConv

asmjit::CallConv Struct Reference [¶]

Function calling convention.

Function calling convention is a scheme that defines how function parameters are passed and how function returns its result. AsmJit defines a variety of architecture and OS specific calling conventions and also provides a compile time detection to make the code-generation easier.

Static Public Attributes

Constants

Classes

Member Functions

Construction & Destruction

Accessors

Error CallConv::init(
CallConvId call_conv_id,
const Environment& environment
)noexcept[¶]

Initializes this calling convention to the given call_conv_id based on the environment.

See CallConvId and Environment for more details.

void CallConv::reset()noexcept[¶]

Resets this CallConv struct into a defined state.

It's recommended to reset the CallConv struct in case you would like create a custom calling convention as it prevents from using an uninitialized data (CallConv doesn't have a constructor that would initialize it, it's just a struct).

Arch CallConv::arch() constnodiscardnoexcept[¶]

Returns the target architecture of this calling convention.

void CallConv::set_arch(
Arch arch
)noexcept[¶]

Sets the target architecture of this calling convention.

CallConvId CallConv::id() constnodiscardnoexcept[¶]

Returns the calling convention id.

void CallConv::set_id(
CallConvId call_conv_id
)noexcept[¶]

Sets the calling convention id.

CallConvStrategy CallConv::strategy() constnodiscardnoexcept[¶]

Returns the strategy used to assign registers to arguments.

void CallConv::set_strategy()noexcept[¶]

Sets the strategy used to assign registers to arguments.

bool CallConv::has_flag() constnodiscardnoexcept[¶]

Tests whether the calling convention has the given flag set.

CallConvFlags CallConv::flags() constnodiscardnoexcept[¶]

Returns the calling convention flags, see Flags.

void CallConv::set_flags()noexcept[¶]

Adds the calling convention flags, see Flags.

void CallConv::add_flags()noexcept[¶]

Adds the calling convention flags, see Flags.

bool CallConv::has_red_zone() constnodiscardnoexcept[¶]

Tests whether this calling convention specifies 'Red Zone'.

bool CallConv::has_spill_zone() constnodiscardnoexcept[¶]

Tests whether this calling convention specifies 'Spill Zone'.

uint32_t CallConv::red_zone_size() constnodiscardnoexcept[¶]

Returns size of 'Red Zone'.

void CallConv::set_red_zone_size(
uint32_t size
)noexcept[¶]

Sets size of 'Red Zone'.

uint32_t CallConv::spill_zone_size() constnodiscardnoexcept[¶]

Returns size of 'Spill Zone'.

void CallConv::set_spill_zone_size(
uint32_t size
)noexcept[¶]

Sets size of 'Spill Zone'.

uint32_t CallConv::natural_stack_alignment() constnodiscardnoexcept[¶]

Returns a natural stack alignment.

void CallConv::set_natural_stack_alignment(
uint32_t value
)noexcept[¶]

Sets a natural stack alignment.

This function can be used to override the default stack alignment in case that you know that it's alignment is different. For example it allows to implement custom calling conventions that guarantee higher stack alignment.

uint32_t CallConv::save_restore_reg_size() constnodiscardnoexcept[¶]

Returns the size of a register (or its part) to be saved and restored of the given group.

void CallConv::set_save_restore_reg_size(
RegGroup group,
uint32_t size
)noexcept[¶]

Sets the size of a vector register (or its part) to be saved and restored.

uint32_t CallConv::save_restore_alignment() constnodiscardnoexcept[¶]

Returns the alignment of a save-restore area of the given group.

void CallConv::set_save_restore_alignment(
RegGroup group,
uint32_t alignment
)noexcept[¶]

Sets the alignment of a save-restore area of the given group.

const uint8_t* CallConv::passed_order() constnodiscardnoexcept[¶]

Returns the order of passed registers of the given group.

RegMask CallConv::passed_regs() constnodiscardnoexcept[¶]

Returns the mask of passed registers of the given group.

void CallConv::set_passed_to_none()noexcept[¶]

Resets the order and mask of passed registers.

void CallConv::set_passed_order(
RegGroup group,
uint32_t a0,
uint32_t a1 = 0xFF,
uint32_t a2 = 0xFF,
uint32_t a3 = 0xFF,
uint32_t a4 = 0xFF,
uint32_t a5 = 0xFF,
uint32_t a6 = 0xFF,
uint32_t a7 = 0xFF
)noexcept[¶]

Sets the order and mask of passed registers.

RegMask CallConv::preserved_regs() constnodiscardnoexcept[¶]

Returns preserved register mask of the given group.

void CallConv::set_preserved_regs(
RegGroup group,
)noexcept[¶]

Sets preserved register mask of the given group.

uint32_t CallConv::kMaxRegArgsPerGroup = 16staticconstexpr[¶]

Maximum number of register arguments per register group.

Note

This is not really AsmJit's limitation, it's just the number that makes sense considering all common calling conventions. Usually even conventions that use registers to pass function arguments are limited to 8 and less arguments passed via registers per group.

Arch CallConv::_arch[¶]

Target architecture.

CallConvId CallConv::_id[¶]

Calling convention id.

CallConvStrategy CallConv::_strategy[¶]

Register assignment strategy.

uint8_t CallConv::_red_zone_size[¶]

Red zone size (AMD64 == 128 bytes).

uint8_t CallConv::_spill_zone_size[¶]

Spill zone size (WIN-X64 == 32 bytes).

uint8_t CallConv::_natural_stack_alignment[¶]

Natural stack alignment as defined by OS/ABI.

CallConvFlags CallConv::_flags[¶]

Calling convention flags.

Support::Array<uint8_t, Globals::kNumVirtGroups>CallConv::_save_restore_reg_size[¶]

Size to save/restore per register group.

Support::Array<uint8_t, Globals::kNumVirtGroups>CallConv::_save_restore_alignment[¶]

Alignment of save/restore groups.

Support::Array<RegMask, Globals::kNumVirtGroups>CallConv::_passed_regs[¶]

Mask of all passed registers, per group.

Support::Array<RegMask, Globals::kNumVirtGroups>CallConv::_preserved_regs[¶]

Mask of all preserved registers, per group.

Support::Array<RegOrder, Globals::kNumVirtGroups>CallConv::_passed_order[¶]

Passed registers' order, per register group.