implementation passes involving assembly go to register directory

This commit is contained in:
Torsten Ruger
2014-08-23 21:49:09 +03:00
parent 495df14e19
commit 435fefd310
2 changed files with 8 additions and 7 deletions

View File

@ -1,14 +0,0 @@
module Virtual
# This implements the send logic
# Send is so complicated that we actually code it in ruby and stick it in
# That off course opens up an endless loop possibility that we stop by reducing to Class and Module methods
class GetImplementation
def run block
block.codes.dup.each do |code|
next unless code.is_a? InstanceGet
raise "Start coding"
end
end
end
Object.space.add_pass_after GetImplementation, SendImplementation
end

View File

@ -1,20 +0,0 @@
module Virtual
# This implements the send logic
# Send is so complicated that we actually code it in ruby and stick it in
# That off course opens up an endless loop possibility that we stop by reducing to Class and Module methods
class SetImplementation
def run block
block.codes.dup.each do |code|
next unless code.is_a? Virtual::Set
if( code.to.is_a? NewMessageSlot)
to = RegisterReference.new(:r0)
tmp = RegisterReference.new(:r5)
move = RegisterMachine.mov( to , tmp , code.index )
else
raise "Start coding #{code.inspect}"
end
end
end
end
Object.space.add_pass_after SetImplementation , GetImplementation
end