layout moves to 0

no more type word, only layout
This commit is contained in:
Torsten Ruger 2015-10-25 20:44:30 +02:00
parent df62b75c6f
commit bb3d211c04

View File

@ -13,9 +13,8 @@
module Parfait
class Object < Value
TYPE_WORD = 0
LAYOUT_INDEX = 1
CLASS_INDEX = 2 #only used in class, but keep constants together
LAYOUT_INDEX = 0
CLASS_INDEX = 1 #only used in class, but keep constants together
def self.new *args
object = self.allocate
@ -43,13 +42,6 @@ module Parfait
self.object_id == other.object_id
end
def get_type_of( index )
type_word = internal_object_get( TYPE_WORD )
res = type_word >> (index*4)
# least significant nibble, this is still adhoc, not tested. but the idea is there
res & 0xF
end
# This is the crux of the object system. The class of an object is stored in the objects
# memory (as opposed to an integer that has no memory and so always has the same class)
#