fibinacci actually compiles, doesnt mean it works though

This commit is contained in:
Torsten Ruger
2014-05-19 11:29:18 +03:00
parent c56b7cdf09
commit 8ba79d8de8
5 changed files with 34 additions and 17 deletions

View File

@ -11,10 +11,24 @@ module Ast
function = context.program.get_or_create_function(name)
raise "Forward declaration not implemented (#{name}) #{inspect}" if function == nil
call = Vm::CallSite.new( name , params , function)
save_locals context , into
call.load_args into
call.do_call into
resore_locals context , into
end
def save_locals context , into
into.instance_eval do
push [:r0, :r1 , :r2]
end
end
def resore_locals context , into
into.instance_eval do
pop [:r0, :r1 , :r2]
end
end
def inspect
self.class.name + ".new(" + name.inspect + ", ["+
args.collect{|m| m.inspect }.join( ",") +"] )"