register and boot consequences of typed method

This commit is contained in:
Torsten Ruger
2016-12-14 13:23:46 +02:00
parent 021fab31db
commit b3a9d8b1bc
3 changed files with 10 additions and 9 deletions

View File

@ -129,7 +129,7 @@ module Register
:super_class_name => :Word},
:Dictionary => {:keys => :List , :values => :List } ,
:TypedMethod => {:name => :Word, :source => :Object, :instructions => :Object, :binary => :Object,
:arguments => :List , :for_class => :Class, :locals => :List } ,
:arguments => :Type , :for_type => :Type, :locals => :Type } ,
:Value => {},
:Variable => {:value_type => :Class, :name => :Word , :value => :Object}
}
@ -144,26 +144,27 @@ module Register
# very fiddly chicken 'n egg problem. Functions need to be in the right order, and in fact we
# have to define some dummies, just for the others to compile
# TODO go through the virtual parfait layer and adjust function names to what they really are
@space.get_class_by_name(:Space).add_instance_method Builtin::Space.send(:main, nil)
space = @space.get_class_by_name(:Space)
space.instance_type.add_instance_method Builtin::Space.send(:main, nil)
obj = @space.get_class_by_name(:Object)
[ :get_internal_word , :set_internal_word ].each do |f|
obj.add_instance_method Builtin::Object.send(f , nil)
obj.instance_type.add_instance_method Builtin::Object.send(f , nil)
end
obj = @space.get_class_by_name(:Kernel)
# create __init__ main first, __init__ calls it
[:exit , :__init__ ].each do |f|
obj.add_instance_method Builtin::Kernel.send(f , nil)
obj.instance_type.add_instance_method Builtin::Kernel.send(f , nil)
end
obj = @space.get_class_by_name(:Word)
[:putstring , :get_internal_byte , :set_internal_byte ].each do |f|
obj.add_instance_method Builtin::Word.send(f , nil)
obj.instance_type.add_instance_method Builtin::Word.send(f , nil)
end
obj = @space.get_class_by_name(:Integer)
[ :putint, :mod4, :div10].each do |f| #mod4 is just a forward declaration
obj.add_instance_method Builtin::Integer.send(f , nil)
obj.instance_type.add_instance_method Builtin::Integer.send(f , nil)
end
end
end