actually adding risc instructions

fix test harness
1 working test (yeh)
This commit is contained in:
Torsten Ruger
2018-03-14 17:41:09 +05:30
parent 79b4b07ac4
commit 7db329fa6b
4 changed files with 28 additions and 23 deletions

View File

@ -24,6 +24,12 @@ module Vool
end
def create_objects
create_class_object
body.collect([]).each {|node| node.set_class(@clazz) }
body.create_objects
end
def create_class_object
@clazz = Parfait.object_space.get_class_by_name(@name )
if(@clazz)
#FIXME super class check with "sup"
@ -36,9 +42,6 @@ module Vool
vars.each { |var| ivar_hash[var] = :Object }
@clazz.set_instance_type( Parfait::Type.for_hash( @clazz , ivar_hash ) )
end
body.collect([]).each {|node| node.set_class(@clazz) }
body.create_objects
end
end
end

View File

@ -36,7 +36,7 @@ module Vool
typed_method = method.create_parfait_method(clazz.instance_type)
compiler = Risc::MethodCompiler.new( typed_method ).init_method
head = @body.to_mom( method ).flatten
head.to_risc(compiler)
compiler.add_mom(head)
end
private