Fix first Slot instruction that uses builder

now without method_missing and names
but still with instance_eval, hmm. Tried without, makes code much less readable
This commit is contained in:
2020-03-01 18:07:42 +02:00
parent 4888b3b6db
commit 4b303977a7
5 changed files with 22 additions and 13 deletions

View File

@ -142,6 +142,9 @@ module Risc
return ins
end
def load_object(object)
@compiler.load_object(object)
end
# for some methods that return an integer it is beneficial to pre allocate the
# integer and store it in the return value. That is what this function does.
#

View File

@ -96,6 +96,7 @@ module Risc
def load_object( object )
raise "must be Parfait, not #{object.class}" unless object.is_a?(Parfait::Object)
ins = Risc.load_constant("load to #{object.type}" , object)
ins.register.set_compiler(self)
add_code ins
# todo for constants (not objects)
# add_constant(right) if compiler