moving instrctions into own folders and arm machine out of the way

This commit is contained in:
Torsten Ruger
2014-10-03 10:25:10 +03:00
parent ad73e320b0
commit 220d9f6213
9 changed files with 238 additions and 418 deletions

View File

@ -79,30 +79,4 @@ module Register
end
end
end
# We insert push/pops as dummies to fill them later in CallSaving
# as we can not know ahead of time which locals wil be live in the code to come
# and also we don't want to "guess" later where the push/pops should be
# Here we check which registers need saving and add them
# Or sometimes just remove the push/pops, when no locals needed saving
class SaveLocals
def run block
push = block.call_block?
return unless push
return unless block.function
locals = block.function.locals_at block
pop = block.next.codes.first
if(locals.empty?)
#puts "Empty #{block.name}"
block.codes.delete(push)
block.next.codes.delete(pop)
else
#puts "PUSH #{push}"
push.set_registers(locals)
#puts "POP #{pop}"
pop.set_registers(locals)
end
end
end
end