%check-nursery-branch ( label size cc temp1 temp2 -- )
CPU architecture description model

Prev:%call-gc ( gc-map -- )
Next:%clear ( loc -- )


Vocabulary
cpu.architecture

Inputs
labellabel
sizean integer
cccomparison symbol
temp1first temporary register
temp2second temporary register


Outputs
None

Word description
Emits code for jumping to the nursery garbage collection block if an allocation of size 'size' requires a garbage collection.

Definition


Methods

M:: arm.64 %check-nursery-branch
( label size cc TEMP1 TEMP2 -- )
"nursery" vm offset-of :> offset TEMP1 VM offset [+] LDR
TEMP1 TEMP1 size ADD TEMP2 VM offset 2 cells + [+] LDR
TEMP1 TEMP2 CMP cc
{ { cc<= [ label BLE ] } { cc/<= [ label BGT ] } } case ;



M:: x86 %check-nursery-branch
( label size cc temp1 temp2 -- )
temp1 load-zone-offset temp2 temp1 [] MOV temp2 size ADD
temp2 temp1 2 cells [+] CMP cc
{ { cc<= [ label JLE ] } { cc/<= [ label JG ] } } case ;