remove tmp variables

sadly without having to touch tests
This commit is contained in:
Torsten Ruger
2015-09-27 14:00:24 +03:00
parent 5a2a857485
commit dba94827ec
4 changed files with 3 additions and 11 deletions

View File

@ -130,7 +130,7 @@ module Virtual
# instances are copied (shame on you)
:Class => [:object_layout , :name , :instance_methods , :super_class , :meta_class],
:Dictionary => [:keys , :values ] ,
:Method => [:name , :code ,:arg_names , :for_class, :locals , :tmps ] ,
:Method => [:name , :code ,:arg_names , :for_class, :locals ] ,
:Module => [:name , :instance_methods , :super_class , :meta_class ]
}
end

View File

@ -117,12 +117,6 @@ module Virtual
return new_b
end
def get_tmp
name = "__tmp__#{@tmps.length}"
@tmps << name
Ast::NameExpression.new(name)
end
# sugar to create instructions easily.
# any method will be passed on to the RegisterMachine and the result added to the insertion block
# With this trick we can write what looks like assembler,

View File

@ -8,7 +8,7 @@ module Virtual
# save return register to the message at instance return_address
new_codes << Register.save_return(code, :message , :return_address)
# and create a new frame if needed
unless code.method.locals.empty? and code.method.tmps.empty?
unless code.method.locals.empty?
new_codes << Virtual::NewFrame.new
end
block.replace(code , new_codes )