fibinacci actually compiles, doesnt mean it works though
This commit is contained in:
@ -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( ",") +"] )"
|
||||
|
Reference in New Issue
Block a user