%box-alien ( dst src temp -- )


Vocabulary
cpu.architecture

Inputs and outputs
dstdestination register
srcregister containing pointer to the alien
temptemporary register


Word description
Emits machine code for boxing an alien value. If the alien is not a NULL pointer, then five cells will be allocated in the nursery space to wrap the object. See vm/layouts.hpp for details.

Examples

USING: compiler.codegen compiler.codegen.relocation cpu.architecture make ; [ RAX RBX RCX %box-alien ] with-fixup 4 swap nth disassemble 000000e9fcc720a0: 48b80100000000000000 mov eax, 0x1 000000e9fcc720aa: 4885db test rbx, rbx 000000e9fcc720ad: 0f8400000000 jz dword 0xe9fcc720b3 000000e9fcc720b3: 498d4d10 lea rcx, [r13+0x10] 000000e9fcc720b7: 488b01 mov rax, [rcx] 000000e9fcc720ba: 48c70018000000 mov qword [rax], 0x18 000000e9fcc720c1: 4883c806 or rax, 0x6 000000e9fcc720c5: 48830130 add qword [rcx], 0x30 000000e9fcc720c9: 48c7400201000000 mov qword [rax+0x2], 0x1 000000e9fcc720d1: 48c7400a01000000 mov qword [rax+0xa], 0x1 000000e9fcc720d9: 48895812 mov [rax+0x12], rbx 000000e9fcc720dd: 4889581a mov [rax+0x1a], rbx


See also
##box-alien, %allot

Definition


Methods