start using tmp registers at 1

which used to be reserved for the next message
This commit is contained in:
Torsten Ruger 2018-03-23 18:57:16 +02:00
parent 472b1a638a
commit a306c464b7
2 changed files with 4 additions and 4 deletions

View File

@ -72,7 +72,7 @@ module Mom
case object
when :frame
type = compiler.method.frame
when :message , :next_message
when :message , :next_message , :caller
type = Parfait.object_space.get_class_by_name(:Message).instance_type
when :arguments
type = compiler.method.arguments

View File

@ -45,9 +45,9 @@ module Risc
end
#helper method to calculate with register symbols
def next_reg_use type , value = nil
def next_reg_use( type , value = nil )
int = @symbol[1,3].to_i
raise "No more registers #{self}" if int > 12
raise "No more registers #{self}" if int > 8
sym = "r#{int + 1}".to_sym
RiscValue.new( sym , type, value)
end
@ -75,7 +75,7 @@ module Risc
# The first scratch register. There is a next_reg_use to get a next and next.
# Current thinking is that scratch is schatch between instructions
def self.tmp_reg( type , value = nil)
RiscValue.new :r2 , type , value
RiscValue.new :r1 , type , value
end
# The first arg is a class name (possibly lowercase) and the second an instance variable name.