Dedicate a throwaway register.
This commit is contained in:
parent
a96d503095
commit
230a50c532
|
@ -90,10 +90,8 @@ module Chalk
|
|||
generate! tree, entry.function, table, target, free
|
||||
when Trees::TreeBlock
|
||||
table = Table.new(table)
|
||||
throwaway = free
|
||||
free += 1
|
||||
tree.children.each do |child|
|
||||
free += generate! child, table, throwaway, free
|
||||
free += generate! child, table, THROWAWAY_REG, free
|
||||
end
|
||||
when Trees::TreeVar
|
||||
entry = table[tree.name]?
|
||||
|
|
|
@ -4,6 +4,8 @@ module Chalk
|
|||
RETURN_REG = 14
|
||||
# The register into which the "stack pointer" is stored.
|
||||
STACK_REG = 13
|
||||
# Register used for throwing away values.
|
||||
THROWAWAY_REG = 12
|
||||
|
||||
# Module to emit instructions and store
|
||||
# them into an existing array.
|
||||
|
|
Loading…
Reference in New Issue
Block a user