fix most of slot_load to_risc

higher orders not working yet
This commit is contained in:
Torsten Ruger
2018-03-17 21:32:09 +05:30
parent cddc25a595
commit 9c052c78a7
3 changed files with 31 additions and 17 deletions

View File

@ -84,7 +84,7 @@ module Risc
# The class can be mapped to a register, and so we get a memory address (reg+index)
def self.resolve_to_index( clazz_name , instance_name )
return instance_name unless instance_name.is_a? Symbol
real_name = clazz_name.to_s.split('_').last.capitalize.to_sym
real_name = clazz_name.to_s.split('_').collect{|p|p.capitalize}.join.to_sym
clazz = Parfait.object_space.get_class_by_name(real_name)
raise "Class name not given #{real_name} #{clazz_name} #{instance_name}" unless clazz
index = clazz.instance_type.variable_index( instance_name )