Externalise register allocation into own class

On the way to the register allocation
This commit is contained in:
2020-02-27 11:57:18 +02:00
parent fa144784fa
commit 685022a6e0
5 changed files with 129 additions and 13 deletions

View File

@ -18,6 +18,7 @@ module SlotMachine
# the register returned
def to_register(compiler, source)
type = known_object.get_type
raise "not sym for #{known_object}" if type.is_a?(String)
right = compiler.use_reg( type )
const = Risc.load_constant(source, known_object , right)
compiler.add_code const