tighter integration with factory methods for adding code

define methods to collapse the code Register.
in add_code Register.factory_method
most instructions done, except op and branch that are rare
This commit is contained in:
Torsten Ruger
2016-12-28 20:37:54 +02:00
parent 8cfcb84c8d
commit e551732f18
13 changed files with 79 additions and 73 deletions

View File

@ -17,8 +17,8 @@ module Register
# Load the value
def load_int_arg_at(compiler, source , at)
int_arg = compiler.use_reg :Integer
compiler.add_code Register.slot_to_reg(source , :message , :arguments , int_arg )
compiler.add_code Register.slot_to_reg(source , int_arg , at + 1, int_arg ) #1 for type
compiler.add_slot_to_reg(source , :message , :arguments , int_arg )
compiler.add_slot_to_reg(source , int_arg , at + 1, int_arg ) #1 for type
return int_arg
end