2014-08-23 12:57:14 +02:00
|
|
|
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
|
2014-08-23 19:25:19 +02:00
|
|
|
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
|
2014-08-23 12:57:14 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
Object.space.add_pass_after SetImplementation , GetImplementation
|
|
|
|
end
|