alloc-stack-param ( rep -- n ) (original) (raw)

alloc-stack-param ( rep -- n )

Vocabulary
compiler.cfg.builder.alien.params

Inputs

rep a representation

Outputs

n an integer

Word description
Allocates space for a stack parameter value of the given representation and returns the previous stack parameter offset.

Examples
On 32-bit architectures, the offsets will be aligned to four byte boundaries.

0 stack-params set float-rep alloc-stack-param stack-params get . . 4
0

Definition

IN: compiler.cfg.builder.alien.params

GENERIC: alloc-stack-param ( rep -- n )

Methods

USING: compiler.cfg.builder.alien.params cpu.architecture kernel
layouts math namespaces ;

M: float-rep alloc-stack-param
stack-params get swap rep-size
[ cell align stack-params +@ ] keep
float-right-align-on-stack? [ + ] [ drop ] if ;

USING: compiler.cfg.builder.alien.params cpu.architecture kernel
layouts math namespaces ;

M: object alloc-stack-param
stack-params get [ rep-size cell align stack-params +@ ] dip
;