class Metasm::Ia32::CCompiler::State
holds compiler state information for a function registers are saved as register number (see Ia32::Reg
) TODO cache eflags ? or just z ? (may be defered to asm_optimize)
Attributes
list of reg values that are not kept across function call
list of regs we can trash without restoring them
variable => register for current scope (variable never on the stack) bound registers are also in used
register => CExpression
array of register values used in the function (to save/restore at prolog/epilog)
the current function
the array of args in use (reg/modrm/composite) the reg dependencies are in used
variable => offset from ebp (::Integer or CExpression)
used
includes ebp if true nil if ebp is not reserved for stack variable addressing Reg
if used
the array of register values currently not available
Public Class Methods
# File metasm/cpu/ia32/compile_c.rb, line 42 def initialize(func) @func = func @offset = {} @cache = {} @dirty = [] @used = [4] # esp is always in use @inuse = [] @bound = {} @abi_flushregs_call = [0, 1, 2] # eax, ecx, edx (r8 etc ?) @abi_trashregs = [0, 1, 2] end