type attr cleanup
and sizes up top
This commit is contained in:
parent
d82cedf4c0
commit
c3c2ab606c
@ -7,7 +7,7 @@ module Parfait
|
||||
# and as the last code of each link is a jump to the next link.
|
||||
#
|
||||
class BinaryCode < Data32
|
||||
attr_reader :type, :next_code
|
||||
attr_reader :next_code
|
||||
|
||||
def self.type_length
|
||||
2 #type + next (could get from space, maybe later)
|
||||
|
@ -8,9 +8,10 @@
|
||||
module Parfait
|
||||
class CacheEntry < Object
|
||||
|
||||
attr_reader :type, :cached_type, :cached_method
|
||||
attr_reader :cached_type, :cached_method
|
||||
|
||||
def initialize(type , method)
|
||||
super()
|
||||
@cached_type = type
|
||||
@cached_method = method
|
||||
end
|
||||
|
@ -12,13 +12,16 @@ module Parfait
|
||||
#
|
||||
class Callable < Object
|
||||
|
||||
attr_reader :type, :self_type , :arguments_type , :frame_type , :binary
|
||||
attr_reader :self_type , :arguments_type , :frame_type , :binary
|
||||
attr_reader :blocks , :name
|
||||
attr_reader :next_callable
|
||||
|
||||
def self.type_length
|
||||
8
|
||||
end
|
||||
def self.memory_size
|
||||
8
|
||||
end
|
||||
|
||||
def initialize( name , self_type , arguments_type , frame_type)
|
||||
super()
|
||||
|
@ -18,12 +18,15 @@ module Parfait
|
||||
class Class < Object
|
||||
include Behaviour
|
||||
|
||||
attr_reader :type, :instance_type , :name , :instance_methods
|
||||
attr_reader :instance_type , :name , :instance_methods
|
||||
attr_reader :super_class_name , :meta_class
|
||||
|
||||
def self.type_length
|
||||
6
|
||||
end
|
||||
def self.memory_size
|
||||
8
|
||||
end
|
||||
|
||||
def initialize( name , superclass , instance_type)
|
||||
super()
|
||||
|
@ -3,11 +3,14 @@
|
||||
module Parfait
|
||||
class Dictionary < Object
|
||||
|
||||
attr_reader :type, :i_keys , :i_values
|
||||
attr_reader :i_keys , :i_values
|
||||
|
||||
def self.type_length
|
||||
3
|
||||
end
|
||||
def self.memory_size
|
||||
8
|
||||
end
|
||||
|
||||
# only empty initialization for now
|
||||
#
|
||||
|
@ -14,7 +14,13 @@
|
||||
|
||||
module Parfait
|
||||
class Factory < Object
|
||||
attr_reader :type , :for_type , :next_object , :reserve , :attribute_name , :page_size
|
||||
attr_reader :for_type , :next_object , :reserve , :attribute_name , :page_size
|
||||
def self.type_length
|
||||
6
|
||||
end
|
||||
def self.memory_size
|
||||
8
|
||||
end
|
||||
|
||||
# initialize for a given type (for_type). The attribute that is used to create the
|
||||
# list is the first that starts with next_ . "next" itself would have been nice and general
|
||||
|
@ -6,17 +6,7 @@
|
||||
module Parfait
|
||||
class Integer < Data4
|
||||
|
||||
attr_reader :type, :next_integer
|
||||
|
||||
def initialize(value , next_i = nil)
|
||||
super()
|
||||
@next_integer = next_i
|
||||
set_internal_word(Integer.integer_index, value)
|
||||
end
|
||||
|
||||
def value
|
||||
get_internal_word(Integer.integer_index)
|
||||
end
|
||||
attr_reader :next_integer
|
||||
|
||||
def self.type_length
|
||||
2 # 0 type, 1 next_i
|
||||
@ -30,6 +20,16 @@ module Parfait
|
||||
type_length
|
||||
end
|
||||
|
||||
def initialize(value , next_i = nil)
|
||||
super()
|
||||
@next_integer = next_i
|
||||
set_internal_word(Integer.integer_index, value)
|
||||
end
|
||||
|
||||
def value
|
||||
get_internal_word(Integer.integer_index)
|
||||
end
|
||||
|
||||
def to_s
|
||||
"Integer " + value.to_s
|
||||
end
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
module Parfait
|
||||
class List < Data16
|
||||
attr_reader :type, :indexed_length , :next_list
|
||||
attr_reader :indexed_length , :next_list
|
||||
|
||||
def self.type_length
|
||||
3 # 0 type , 1 length , 2 - next_list
|
||||
|
@ -11,22 +11,15 @@
|
||||
module Parfait
|
||||
class Message < Object
|
||||
|
||||
# :next_message => :Message, :receiver => :Object, :frame => :NamedList ,
|
||||
# :return_address => :Integer, :return_value => :Integer,
|
||||
# :caller => :Message , :name => :Word , :arguments => :NamedList
|
||||
|
||||
attr_reader :type, :next_message
|
||||
attr_reader :receiver
|
||||
attr_reader :next_message, :receiver
|
||||
attr_reader :return_address, :return_value
|
||||
attr_reader :caller , :method
|
||||
attr_reader :arguments_given
|
||||
attr_reader :arg1 , :arg2, :arg3, :arg4, :arg5, :arg6
|
||||
attr_reader :locals_used
|
||||
attr_reader :local1 , :local2, :local3, :local4, :local5, :local6 ,:local7,:local8
|
||||
attr_reader :local9 ,:local10, :local11 , :local12, :local13, :local14
|
||||
attr_reader :arguments_given, :arg1 , :arg2, :arg3, :arg4, :arg5, :arg6
|
||||
attr_reader :locals_used, :local1 , :local2, :local3, :local4, :local5, :local6 ,:local7
|
||||
attr_reader :local8 , :local9 ,:local10, :local11 , :local12, :local13, :local14
|
||||
|
||||
def self.type_length
|
||||
31
|
||||
30
|
||||
end
|
||||
def self.memory_size
|
||||
32
|
||||
|
@ -20,11 +20,14 @@ module Parfait
|
||||
class MetaClass < Object
|
||||
include Behaviour
|
||||
|
||||
attr_reader :type, :instance_type , :instance_methods , :clazz
|
||||
attr_reader :instance_type , :instance_methods , :clazz
|
||||
|
||||
def self.type_length
|
||||
4
|
||||
end
|
||||
def self.memory_size
|
||||
8
|
||||
end
|
||||
|
||||
def initialize( clazz )
|
||||
super()
|
||||
|
@ -23,8 +23,6 @@
|
||||
module Parfait
|
||||
class NamedList < Object
|
||||
|
||||
attr_reader :type
|
||||
|
||||
def self.memory_size
|
||||
16
|
||||
end
|
||||
|
@ -15,6 +15,14 @@
|
||||
module Parfait
|
||||
class Object
|
||||
attr_reader :type
|
||||
def self.type_length
|
||||
1
|
||||
end
|
||||
def self.memory_size
|
||||
4
|
||||
end
|
||||
|
||||
|
||||
def type=(t)
|
||||
set_type( t )
|
||||
end
|
||||
|
@ -30,8 +30,14 @@ module Parfait
|
||||
|
||||
class Space < Object
|
||||
|
||||
attr_reader :type, :classes , :types , :factories
|
||||
attr_reader :classes , :types , :factories
|
||||
attr_reader :true_object , :false_object , :nil_object
|
||||
def self.type_length
|
||||
7
|
||||
end
|
||||
def self.memory_size
|
||||
8
|
||||
end
|
||||
|
||||
def initialize( classes , pages)
|
||||
@classes = classes
|
||||
@ -54,13 +60,6 @@ module Parfait
|
||||
@nil_object = Parfait::NilClass.new
|
||||
end
|
||||
|
||||
def self.type_length
|
||||
12
|
||||
end
|
||||
def self.memory_size
|
||||
16
|
||||
end
|
||||
|
||||
def init_message_chain( message )
|
||||
prev = nil
|
||||
while(message)
|
||||
|
@ -36,7 +36,7 @@ module Parfait
|
||||
|
||||
class Type < Object
|
||||
|
||||
attr_reader :type, :object_class , :names , :types , :methods
|
||||
attr_reader :object_class , :names , :types , :methods
|
||||
|
||||
def self.type_length
|
||||
5
|
||||
|
@ -12,7 +12,7 @@ module Parfait
|
||||
#
|
||||
class VoolMethod < Object
|
||||
|
||||
attr_reader :type, :name , :args_type , :frame_type
|
||||
attr_reader :name , :args_type , :frame_type
|
||||
attr_reader :source
|
||||
|
||||
def initialize(name , args_type , frame_type , source )
|
||||
|
@ -13,7 +13,7 @@ module Parfait
|
||||
# Object length is measured in non-type cells though
|
||||
|
||||
class Word < Data8
|
||||
attr_reader :type, :char_length
|
||||
attr_reader :char_length
|
||||
|
||||
def self.type_length
|
||||
2 # 0 type , 1 char_length
|
||||
|
Loading…
x
Reference in New Issue
Block a user