shaves an instruction off resolve_method

by loading nil directly,  not space first
This commit is contained in:
Torsten Ruger
2018-09-01 11:20:59 +03:00
parent c3b026a180
commit 0a390cc5a9
7 changed files with 61 additions and 66 deletions

View File

@@ -101,9 +101,6 @@ module Arm
right = Risc::Position.get(left) - 8
right -= Risc::Position.get(self).at
if( (right < 0) && ((opcode == :add) || (opcode == :sub)) )
puts "Inverting, was #{right} , new #{-1*right}"
puts "left #{left.class} #{Risc::Position.get(left)}"
puts "self #{Risc::Position.get(self)}"
right *= -1 # this works as we never issue sub only add
set_opcode :sub # so (as we can't change the sign permanently) we can change the opcode
end # and the sign even for sub (beucase we created them)

View File

@@ -45,9 +45,8 @@ module Mom
add_code while_start_label
space! << Parfait.object_space
space << space[:nil_object]
space - callable_method
object! << Parfait.object_space.nil_object
object - callable_method
if_zero exit_label
name! << callable_method[:name]

View File

@@ -103,7 +103,9 @@ module Risc
def prerun
assemblers.each do |asm|
asm.instructions.each {|i| i.precheck }
asm.instructions.each do |ins|
ins.precheck
end
end
end