Example #1
0
    def __init__(self, rtyper, classdef, gcflavor='ignored'):
        AbstractInstanceRepr.__init__(self, rtyper, classdef)

        self.baserepr = None
        if self.classdef is None:
            self.lowleveltype = OBJECT
        else:
            b = self.classdef.basedef
            if b is not None:
                self.baserepr = getinstancerepr(rtyper, b)
                b = self.baserepr.lowleveltype
            else:
                b = OBJECT

            if hasattr(classdef.classdesc.pyobj, '_rpython_hints'):
                hints = classdef.classdesc.pyobj._rpython_hints
            else:
                hints = {}
            hints = self._check_for_immutable_hints(hints)
            self.lowleveltype = ootype.Instance(classdef.name,
                                                b, {}, {},
                                                _hints=hints)
        self.iprebuiltinstances = identity_dict()
        self.object_type = self.lowleveltype
        self.gcflavor = gcflavor
Example #2
0
    def __init__(self, rtyper, classdef, gcflavor='gc'):
        AbstractInstanceRepr.__init__(self, rtyper, classdef)
        if classdef is None:
            self.object_type = OBJECT_BY_FLAVOR[LLFLAVOR[gcflavor]]
        else:
            ForwardRef = lltype.FORWARDREF_BY_FLAVOR[LLFLAVOR[gcflavor]]
            self.object_type = ForwardRef()

        self.iprebuiltinstances = identity_dict()
        self.lowleveltype = Ptr(self.object_type)
        self.gcflavor = gcflavor
Example #3
0
 def __init__(self, rtyper, classdef, gcflavor='gc'):
     AbstractInstanceRepr.__init__(self, rtyper, classdef)
     if classdef is None:
         self.object_type = OBJECT_BY_FLAVOR[LLFLAVOR[gcflavor]]
     else:
         ForwardRef = lltype.FORWARDREF_BY_FLAVOR[LLFLAVOR[gcflavor]]
         self.object_type = ForwardRef()
         
     self.prebuiltinstances = {}   # { id(x): (x, _ptr) }
     self.lowleveltype = Ptr(self.object_type)
     self.gcflavor = gcflavor
Example #4
0
    def __init__(self, rtyper, classdef, gcflavor="gc"):
        AbstractInstanceRepr.__init__(self, rtyper, classdef)
        if classdef is None:
            self.object_type = OBJECT_BY_FLAVOR[LLFLAVOR[gcflavor]]
        else:
            ForwardRef = lltype.FORWARDREF_BY_FLAVOR[LLFLAVOR[gcflavor]]
            self.object_type = ForwardRef()

        self.iprebuiltinstances = identity_dict()
        self.lowleveltype = Ptr(self.object_type)
        self.gcflavor = gcflavor
Example #5
0
    def __init__(self, rtyper, classdef, gcflavor='ignored'):
        AbstractInstanceRepr.__init__(self, rtyper, classdef)

        self.baserepr = None
        if self.classdef is None:
            self.lowleveltype = OBJECT
        else:
            b = self.classdef.basedef
            if b is not None:
                self.baserepr = getinstancerepr(rtyper, b)
                b = self.baserepr.lowleveltype
            else:
                b = OBJECT

            if hasattr(classdef.classdesc.pyobj, '_rpython_hints'):
                hints = classdef.classdesc.pyobj._rpython_hints
            else:
                hints = {}
            self.lowleveltype = ootype.Instance(classdef.name, b, {}, {}, _hints = hints)
        self.prebuiltinstances = {}   # { id(x): (x, _ptr) }
        self.object_type = self.lowleveltype
        self.gcflavor = gcflavor
Example #6
0
    def __init__(self, rtyper, classdef, gcflavor='ignored'):
        AbstractInstanceRepr.__init__(self, rtyper, classdef)

        self.baserepr = None
        if self.classdef is None:
            self.lowleveltype = OBJECT
        else:
            b = self.classdef.basedef
            if b is not None:
                self.baserepr = getinstancerepr(rtyper, b)
                b = self.baserepr.lowleveltype
            else:
                b = OBJECT

            if hasattr(classdef.classdesc.pyobj, '_rpython_hints'):
                hints = classdef.classdesc.pyobj._rpython_hints
            else:
                hints = {}
            hints = self._check_for_immutable_hints(hints)
            self.lowleveltype = ootype.Instance(classdef.name, b, {}, {}, _hints = hints)
        self.iprebuiltinstances = identity_dict()
        self.object_type = self.lowleveltype
        self.gcflavor = gcflavor
Example #7
0
    def __init__(self, rtyper, classdef, gcflavor='ignored'):
        AbstractInstanceRepr.__init__(self, rtyper, classdef)

        self.baserepr = None
        if self.classdef is None:
            self.lowleveltype = OBJECT
        else:
            b = self.classdef.basedef
            if b is not None:
                self.baserepr = getinstancerepr(rtyper, b)
                b = self.baserepr.lowleveltype
            else:
                b = OBJECT

            if hasattr(classdef.classdesc.pyobj, '_rpython_hints'):
                hints = classdef.classdesc.pyobj._rpython_hints
            else:
                hints = {}
            self.lowleveltype = ootype.Instance(classdef.name,
                                                b, {}, {},
                                                _hints=hints)
        self.prebuiltinstances = {}  # { id(x): (x, _ptr) }
        self.object_type = self.lowleveltype
        self.gcflavor = gcflavor