to_risc for NotSameCheck

which is only used in call cache checking
some fixing, needed to add a abel for the cache check jump
This commit is contained in:
Torsten Ruger
2018-03-21 12:38:28 +05:30
parent 12c71fa394
commit fa797f722d
5 changed files with 30 additions and 13 deletions

View File

@ -9,12 +9,18 @@ module Mom
class NotSameCheck < Check
attr_reader :left , :right
def initialize(left, right)
def initialize(left, right , label)
super(label)
@left , @right = left , right
end
def to_risc(context)
Risc::Label.new(self,"NotSameCheck")
# basically move both left and right values into register and issue a
# risc comparison
def to_risc(compiler)
l_val = left.to_register(compiler, self)
r_val = right.to_register(compiler, self)
check = Risc::NotSame.new(self, l_val.register, r_val.register, false_jump.to_risc(compiler))
l_val << r_val << check
end
end
end