add constants automatically

This commit is contained in:
Torsten 2020-03-08 18:47:47 +02:00
parent 28e9cd335a
commit 12fe0b9a10
2 changed files with 1 additions and 1 deletions

View File

@ -106,6 +106,7 @@ module Risc
ins.register.set_compiler(self)
add_code ins
# todo for constants (not objects)
add_constant( object) if object.is_a?(Parfait::Object)
# add_constant(right) if compiler
ins.register
end

View File

@ -32,7 +32,6 @@ module SlotMachine
# a target (not a label)
def to_risc(compiler)
entry = compiler.load_object(@cache_entry)[:cached_method].to_reg
compiler.add_constant( @cache_entry)
return_label = Risc.label(self, "continue_#{object_id}")
return_address = compiler.load_object(return_label)