change boot to new hash syntax

This commit is contained in:
Torsten Ruger 2018-03-25 13:27:15 +03:00
parent de7e02b0b8
commit bc4d4b428a
3 changed files with 29 additions and 28 deletions

View File

@ -47,7 +47,7 @@ module Mom
Parfait.object_space.get_class_by_name(:Word).instance_type Parfait.object_space.get_class_by_name(:Word).instance_type
end end
end end
class SymbolConstant < String class SymbolConstant < Constant
def ct_type def ct_type
Parfait.object_space.get_class_by_name(:Word).instance_type Parfait.object_space.get_class_by_name(:Word).instance_type
end end

View File

@ -110,43 +110,44 @@ module Risc
type = types[name] type = types[name]
clazz = classes[name] clazz = classes[name]
type.set_object_class( clazz ) type.set_object_class( clazz )
type.init_lists({:type => :Type }.merge(ivars)) type.init_lists({type: :Type }.merge(ivars))
end end
end end
# superclasses other than default object # superclasses other than default object
def super_class_names def super_class_names
{ :Object => :Kernel , :Kernel => :Value , :Integer => :Value , :BinaryCode => :Word } { Object: :Kernel , Kernel: :Value , Integer: :Value , BinaryCode: :Word }
end end
# the function really just returns a constant (just avoiding the constant) # the function really just returns a constant (just avoiding the constant)
# unfortuantely that constant condenses every detail about the system, class names # unfortuantely that constant condenses every detail about the system, class names
# and all instance variable names. Really have to find a better way # and all instance variable names. Really have to find a better way
def type_names def type_names
{ :Word => {:char_length => :Integer} , { Word: {char_length: :Integer} ,
:List => {:indexed_length => :Integer} , List: {indexed_length: :Integer} ,
:Message => { :next_message => :Message, :receiver => :Object, :frame => :NamedList , Message: { next_message: :Message, receiver: :Object, frame: :NamedList ,
:return_address => :Integer, :return_value => :Integer, return_address: :Integer, return_value: :Integer,
:caller => :Message , :name => :Word , :arguments => :NamedList }, caller: :Message , name: :Word , arguments: :NamedList },
:Integer => {}, Integer: {},
:TrueClass => {}, TrueClass: {},
:FalseClass => {}, FalseClass: {},
:NilClass => {}, NilClass: {},
:Object => {}, Object: {},
:Kernel => {}, #fix, kernel is a class, but should be a module Kernel: {}, #fix, kernel is a class, but should be a module
:BinaryCode => {:char_length => :Integer} , BinaryCode: {char_length: :Integer} ,
:Space => {:classes => :Dictionary , :types => :Dictionary , Space: {classes: :Dictionary , types: :Dictionary ,
:first_message => :Message , single_true: :TrueClass, first_message: :Message , single_true: :TrueClass,
single_false: :FalseClass , single_nil: :NilClass}, single_false: :FalseClass , single_nil: :NilClass},
:NamedList => {}, NamedList: {},
:Type => {:names => :List , :types => :List , Type: {names: :List , types: :List ,
:object_class => :Class, :methods => :List } , object_class: :Class, methods: :List } ,
:Class => {:instance_methods => :List, :instance_type => :Type, :name => :Word, Class: {instance_methods: :List, instance_type: :Type, name: :Word,
:super_class_name => :Word , :instance_names => :List }, super_class_name: :Word , instance_names: :List },
:Dictionary => {:keys => :List , :values => :List } , Dictionary: {keys: :List , values: :List } ,
:CacheEntry => {:cached_type => :Type , :cached_method => :TypedMethod } , CacheEntry: {cached_type: :Type , cached_method: :TypedMethod } ,
:TypedMethod => {:name => :Word, :source => :Object, :instructions => :Object, :binary => :Object, TypedMethod: {name: :Word, source: :Object, instructions: :Object,
:arguments => :Type , :for_type => :Type, :frame => :Type } , binary: :BinaryCode, arguments: :Type , for_type: :Type,
frame: :Type } ,
} }
end end

View File

@ -118,7 +118,7 @@ module Vool
Mom::SlotLoad.new([dynamic_call.cache_entry, :cached_type] , [:message , :receiver , :type]) Mom::SlotLoad.new([dynamic_call.cache_entry, :cached_type] , [:message , :receiver , :type])
end end
def build_method_cache_update(in_method) def build_method_cache_update(in_method)
receiver = StringConstant.new(@name) receiver = SymbolConstant.new(@name)
resolve = SendStatement.new(:resolve_method , receiver , [SelfExpression.new]) resolve = SendStatement.new(:resolve_method , receiver , [SelfExpression.new])
move_method = Mom::SlotLoad.new([dynamic_call.cache_entry, :cached_method] , [:message , :return_value]) move_method = Mom::SlotLoad.new([dynamic_call.cache_entry, :cached_method] , [:message , :return_value])
resolve.to_mom(in_method) << move_method resolve.to_mom(in_method) << move_method