layout moves to 0
no more type word, only layout
This commit is contained in:
parent
df62b75c6f
commit
bb3d211c04
@ -13,9 +13,8 @@
|
|||||||
module Parfait
|
module Parfait
|
||||||
class Object < Value
|
class Object < Value
|
||||||
|
|
||||||
TYPE_WORD = 0
|
LAYOUT_INDEX = 0
|
||||||
LAYOUT_INDEX = 1
|
CLASS_INDEX = 1 #only used in class, but keep constants together
|
||||||
CLASS_INDEX = 2 #only used in class, but keep constants together
|
|
||||||
|
|
||||||
def self.new *args
|
def self.new *args
|
||||||
object = self.allocate
|
object = self.allocate
|
||||||
@ -43,13 +42,6 @@ module Parfait
|
|||||||
self.object_id == other.object_id
|
self.object_id == other.object_id
|
||||||
end
|
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
|
# 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)
|
# memory (as opposed to an integer that has no memory and so always has the same class)
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user