stop pinning self and frame

before: r0-message , r1-self , r2-frame , r3-new_message , r4 + tmps
now: r0-message , r1-new_message , r2 + tmps
programs got smaller, less fuss
also fix in return implementation that got the address from the wrong
message
This commit is contained in:
Torsten Ruger
2015-10-18 17:20:19 +03:00
parent da5502e301
commit 6c7e4c0fe2
19 changed files with 98 additions and 94 deletions

View File

@ -14,8 +14,6 @@ module Register
new_codes = []
# move the current new_message to message
new_codes << RegisterTransfer.new(code, Register.new_message_reg , Register.message_reg )
# "roll out" self into its register
new_codes << Register.get_slot( code , :message , :receiver, :self )
# do the register call
new_codes << FunctionCall.new( code , code.method )
block.replace(code , new_codes )

View File

@ -8,11 +8,8 @@ module Register
new_codes << RegisterTransfer.new(code, Register.message_reg , Register.new_message_reg )
# and restore the message from saved value in new_message
new_codes << Register.get_slot(code,:new_message , :caller , :message )
# "roll out" self and frame into their registers
new_codes << Register.get_slot(code, :message , :receiver , :self )
new_codes << Register.get_slot(code, :message , :frame , :frame )
#load the return address into pc, affecting return. (other cpus have commands for this, but not arm)
new_codes << FunctionReturn.new( code , Register.message_reg , Register.resolve_index(:message , :return_address) )
new_codes << FunctionReturn.new( code , Register.new_message_reg , Register.resolve_index(:message , :return_address) )
block.replace(code , new_codes )
end
end