fixing fragment tests, most done

This commit is contained in:
Torsten Ruger
2014-06-07 23:22:32 +03:00
parent 6b715bbb1b
commit 0a14cffefb
16 changed files with 49 additions and 42 deletions

View File

@ -45,7 +45,7 @@ module Vm
args.each_with_index do |arg , i|
if arg.is_a?(Value)
@args[i] = arg
raise "arg in non std register #{arg.inspect}" unless RECEIVER_REG == arg.used_register.next_reg(i - 1)
raise "arg #{i}in non std register #{arg.inspect}" unless RECEIVER_REG == arg.used_register.next_reg(-1-i)
else
@args[i] = arg.new(RegisterUse.new(RECEIVER_REG).next_reg(i + 1))
end

View File

@ -1,5 +1,4 @@
require_relative "code"
require "support/hash_attributes"
module Vm
# Because the idea of what one instruction does, does not always map one to one to real machine

View File

@ -122,9 +122,6 @@ module Vm
def less_than block , right
RegisterMachine.instance.integer_less_than block , self , right
end
def equals block , right
RegisterMachine.instance.integer_equals block , self , right
end
def == other
code = class_for(CompareInstruction).new(self , other , opcode: :cmp)
end
@ -146,6 +143,9 @@ module Vm
def left_shift block , first , right
RegisterMachine.instance.integer_left_shift block , self , first , right
end
def equals block , right
RegisterMachine.instance.integer_equals block , self , right
end
def load block , right
if(right.is_a? IntegerConstant)