class Stacklang::Function::Memory
- Stacklang::Function::Memory
- Reference
- Object
Overview
Represent a memory location as an offset to an address stored in a register or a variable. It can also be specified that this memory is mapped to a (temporary or restricted) variable. This allows use of cached values. That memory can be used as a source or a destination.
Defined in:
stacklang/compiler/function/function.crConstructors
Class Method Summary
-
.absolute(register : Registers | Variable)
Create an absolute memory location relative to any register.
-
.offset(value : Int32, var : Variable | Nil = nil)
Create a memory that is an offset to the stack.
Instance Method Summary
-
#reference_register : Registers | Variable
the register containing the address.
-
#reference_register!
Helper method to use when you KNOW that the register is not held in a temporary value.
-
#reference_register=(reference_register : Registers | Variable)
the register containing the address.
-
#used_registers : Array(Registers)
Return a list of registers that this memory is using
-
#value : Int32
An offset to the reference register
-
#value=(value : Int32)
An offset to the reference register
- #within_var : Variable | Nil
Constructor Detail
Class Method Detail
Create an absolute memory location relative to any register.
Create a memory that is an offset to the stack. Used to create memory for variable.
Instance Method Detail
the register containing the address. Or a variable If the address is stored in a variable. For exemple, if it is r0 then this is an absolute address, if it r7 it likely a variable.
Helper method to use when you KNOW that the register is not held in a temporary value.
the register containing the address. Or a variable If the address is stored in a variable. For exemple, if it is r0 then this is an absolute address, if it r7 it likely a variable.
Return a list of registers that this memory is using