Commit b159370a authored by Tobias Pape's avatar Tobias Pape

RPython cannot use super and doesn't handle mutlipe inheritance

The _mixin_ = True however allows us kind-of multiple-inheritances. Be caucious, tho
parent 869410df
......@@ -8,7 +8,7 @@ import time
class SystemPrimitives(Primitives):
def __init__(self, universe):
super(SystemPrimitives, self).__init__(universe)
Primitives.__init__(self, universe)
self._start_time = time.time() # a float of the time in seconds
def install_primitives(self):
......
......@@ -3,7 +3,7 @@ from som.vmobjects.object import Object
class Array(Object):
def __init__(self, nilObject):
super(Array, self).__init__(nilObject)
Object.__init__(self, nilObject)
# Private array of indexable fields
self._indexable_fields = None
......
......@@ -2,7 +2,7 @@ from som.vmobjects.object import Object
class BigInteger(Object):
def __init__(self, nilObject):
super(BigInteger, self).__init__(nilObject)
Object.__init__(self, nilObject)
self._embedded_biginteger = None
def get_embedded_biginteger(self):
......
......@@ -8,7 +8,7 @@ class Block(Object):
NUMBER_OF_BLOCK_FIELDS = 1 + CONTEXT_INDEX
def __init__(self, nilObject):
super(Block, self).__init__(nilObject)
Object.__init__(self, nilObject)
self._number_of_arguments = 0
def get_method(self):
......@@ -47,7 +47,7 @@ class Block(Object):
new_frame.copy_arguments_from(frame)
new_frame.set_context(context)
super(Block.Evaluation, self).__init__(self._compute_signature_string(num_args), universe, _invoke)
Primitive.__init__(self, self._compute_signature_string(num_args), universe, _invoke)
self._number_of_arguments = num_args
def _compute_signature_string(self, num_args):
......
......@@ -14,8 +14,8 @@ class Class(Object):
NUMBER_OF_CLASS_FIELDS = 1 + INSTANCE_INVOKABLES_INDEX
def __init__(self, universe, number_of_fields = None):
super(Class, self).__init__(universe.nilObject, number_of_fields)
def __init__(self, universe, number_of_fields=-1):
Object.__init__(self, universe.nilObject, number_of_fields)
self._invokables_table = {}
self._universe = universe
......
......@@ -3,7 +3,7 @@ from som.vmobjects.object import Object
class Double(Object):
def __init__(self, nilObject):
super(Double, self).__init__(nilObject)
Object.__init__(self, nilObject)
self._embedded_double = None
def get_embedded_double(self):
......
......@@ -20,7 +20,7 @@ class Frame(Array):
NUMBER_OF_FRAME_FIELDS = 1 + METHOD_INDEX
def __init__(self, nilObject):
super(Frame, self).__init__(nilObject)
Array.__init__(self, nilObject)
self._stack_pointer = None
self._bytecode_index = None
self._local_offset = None
......
......@@ -3,7 +3,7 @@ from som.vmobjects.object import Object
class Integer(Object):
def __init__(self, nilObject):
super(Integer, self).__init__(nilObject)
Object.__init__(self, nilObject)
self._embedded_integer = 0
def get_embedded_integer(self):
......
# An 'interface', or common super class for methods and primitives.
class Invokable(object):
_mixin_ = True
# Tells whether this is a primitive
def is_primitive(self):
raise NotImplementedError()
......
......@@ -18,7 +18,7 @@ class Method(Array, Invokable):
def __init__(self, nilObject):
super(Method, self).__init__(nilObject)
Array.__init__(self, nilObject)
self._receiver_class_table = []
self._invoked_methods = []
......
......@@ -10,8 +10,8 @@ class Primitive(Object, Invokable):
HOLDER_INDEX = 1 + SIGNATURE_INDEX
NUMBER_OF_PRIMITIVE_FIELDS = 1 + HOLDER_INDEX
def __init__(self, signature_string, universe, invoke, is_empty = None):
super(Primitive, self).__init__(universe.nilObject)
def __init__(self, signature_string, universe, invoke, is_empty=False):
Object.__init__(self, universe.nilObject)
# Set the class of this primitive to be the universal primitive class
self.set_class(universe.primitiveClass)
......
......@@ -3,7 +3,7 @@ from som.vmobjects.object import Object
class String(Object):
def __init__(self, nilObject):
super(String, self).__init__(nilObject)
Object.__init__(self, nilObject)
self._string = None
def get_embedded_string(self):
......
......@@ -3,7 +3,7 @@ from som.vmobjects.object import Object
class Symbol(Object):
def __init__(self, nilObject):
super(Symbol, self).__init__(nilObject)
Object.__init__(self, nilObject)
self._string = None
self._number_of_signature_arguments = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment