From 12fe0b9a10f5ac5b994c883433400285015f1551 Mon Sep 17 00:00:00 2001 From: Torsten Date: Sun, 8 Mar 2020 18:47:47 +0200 Subject: [PATCH] add constants automatically --- lib/risc/callable_compiler.rb | 1 + lib/slot_machine/instructions/dynamic_call.rb | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/risc/callable_compiler.rb b/lib/risc/callable_compiler.rb index e070ce14..9cabc0d6 100644 --- a/lib/risc/callable_compiler.rb +++ b/lib/risc/callable_compiler.rb @@ -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 diff --git a/lib/slot_machine/instructions/dynamic_call.rb b/lib/slot_machine/instructions/dynamic_call.rb index accc05ce..f6800cbd 100644 --- a/lib/slot_machine/instructions/dynamic_call.rb +++ b/lib/slot_machine/instructions/dynamic_call.rb @@ -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)