fixed
This commit is contained in:
parent
c5765d4255
commit
f5ec7f3bdb
@ -5,14 +5,14 @@ module Register
|
|||||||
next unless code.is_a? Virtual::MethodReturn
|
next unless code.is_a? Virtual::MethodReturn
|
||||||
new_codes = []
|
new_codes = []
|
||||||
# move the current message to new_message
|
# move the current message to new_message
|
||||||
new_codes << RegisterMachine.instance.mov( Slot.MESSAGE_REGISTER , Slot::NEW_MESSAGE_REGISTER )
|
new_codes << RegisterMachine.instance.mov( Virtual::Slot::MESSAGE_REGISTER , Virtual::Slot::NEW_MESSAGE_REGISTER )
|
||||||
# and restore the message from saved value in new_message
|
# and restore the message from saved value in new_message
|
||||||
new_codes << RegisterMachine.instance.ldr( Slot.MESSAGE_REGISTER ,Slot.NEW_MESSAGE_REGISTER , Virtual::Slot::MESSAGE_CALLER )
|
new_codes << RegisterMachine.instance.ldr( Virtual::Slot::MESSAGE_REGISTER ,Virtual::Slot::NEW_MESSAGE_REGISTER , Virtual::Slot::MESSAGE_CALLER )
|
||||||
# "roll out" self and frame into their registers
|
# "roll out" self and frame into their registers
|
||||||
new_codes << RegisterMachine.instance.ldr( Slot.SELF_REGISTER ,Slot.MESSAGE_REGISTER , Virtual::Slot::MESSAGE_SELF )
|
new_codes << RegisterMachine.instance.ldr( Virtual::Slot::SELF_REGISTER ,Virtual::Slot::MESSAGE_REGISTER , Virtual::Slot::MESSAGE_SELF )
|
||||||
new_codes << RegisterMachine.instance.ldr( Slot.FRAME_REGISTER ,Slot.MESSAGE_REGISTER , Virtual::Slot::MESSAGE_FRAME )
|
new_codes << RegisterMachine.instance.ldr( Virtual::Slot::FRAME_REGISTER ,Virtual::Slot::MESSAGE_REGISTER , Virtual::Slot::MESSAGE_FRAME )
|
||||||
#load the return address into pc, affecting return. (other cpus have commands for this, but not arm)
|
#load the return address into pc, affecting return. (other cpus have commands for this, but not arm)
|
||||||
new_codes << RegisterMachine.instance.ldr( :pc ,Slot.MESSAGE_REGISTER , Virtual::Slot::MESSAGE_RETURN_ADDRESS )
|
new_codes << RegisterMachine.instance.ldr( :pc ,Virtual::Slot::MESSAGE_REGISTER , Virtual::Slot::MESSAGE_RETURN_ADDRESS )
|
||||||
block.replace(code , new_codes )
|
block.replace(code , new_codes )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user