fixing tests for shifting constants into slots
This commit is contained in:
@ -15,6 +15,7 @@ module Risc
|
||||
|
||||
# Produce a RegToSlot instruction.
|
||||
# From and to are registers or symbols that can be transformed to a register by resolve_to_register
|
||||
# (which are precisely the symbols :message or :new_message. or a register)
|
||||
# index resolves with resolve_to_index.
|
||||
def self.reg_to_slot( source , from_reg , to , index )
|
||||
from = resolve_to_register from_reg
|
||||
|
@ -86,7 +86,7 @@ module Risc
|
||||
return instance_name unless instance_name.is_a? Symbol
|
||||
real_name = clazz_name.to_s.split('_').last.capitalize.to_sym
|
||||
clazz = Parfait.object_space.get_class_by_name(real_name)
|
||||
raise "Class name not given #{real_name}" unless clazz
|
||||
raise "Class name not given #{real_name} #{clazz_name} #{instance_name}" unless clazz
|
||||
index = clazz.instance_type.variable_index( instance_name )
|
||||
raise "Instance name=#{instance_name} not found on #{real_name}:#{clazz.instance_type}" unless index.is_a?(Numeric)
|
||||
return index # the type word is at index 0, but type is a list and starts at 1 == type
|
||||
|
Reference in New Issue
Block a user