up to, ut not including, creating frames
This commit is contained in:
@ -164,6 +164,10 @@ module Register
|
||||
send("add_#{clazz}".to_sym , object)
|
||||
end
|
||||
|
||||
def add_Message m
|
||||
end
|
||||
def add_Frame f
|
||||
end
|
||||
def add_Array( array )
|
||||
# also array has constant overhead, the padded helper fixes it to multiple of 8
|
||||
array.each do |elem|
|
||||
|
@ -4,11 +4,12 @@ module Register
|
||||
def run block
|
||||
block.codes.dup.each do |code|
|
||||
next unless code.is_a? Virtual::MethodEnter
|
||||
new_codes = []
|
||||
# save return register and create a new frame
|
||||
to = RegisterReference.new(:r0) # message base
|
||||
pc = RegisterReference.new(:pc)
|
||||
move1 = RegisterMachine.instance.str( pc , to , Virtual::Slot::MESSAGE_RETURN_VALUE )
|
||||
block.replace(code , [move1] )
|
||||
# lr is link register, ie where arm stores the return address when call is issued
|
||||
new_codes << RegisterMachine.instance.str( :lr , Virtual::Slot::MESSAGE_REGISTER , Virtual::Slot::MESSAGE_RETURN_ADDRESS )
|
||||
new_codes << Virtual::NewFrame.new
|
||||
block.replace(code , new_codes )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user