Did I find the right examples for you? yes no

All Samples(10)  |  Call(0)  |  Derive(0)  |  Import(10)

src/s/y/Sypy-HEAD/jit/metainterp/typesystem.py   Sypy(Download)
    def cls_of_box(self, box):
        obj = box.getref(lltype.Ptr(rclass.OBJECT))
        cls = llmemory.cast_ptr_to_adr(obj.typeptr)
        return history.ConstInt(heaptracker.adr2int(cls))
 
    def get_exception_obj(self, evaluebox):
        # only works when translated
        obj = evaluebox.getref(lltype.Ptr(rclass.OBJECT))
        return cast_base_ptr_to_instance(Exception, obj)
 
    def cast_to_baseclass(self, value):
        return lltype.cast_opaque_ptr(lltype.Ptr(rclass.OBJECT), value)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/jit/metainterp/typesystem.py   plexnet(Download)
    def cls_of_box(self, cpu, box):
        obj = box.getref(lltype.Ptr(rclass.OBJECT))
        cls = llmemory.cast_ptr_to_adr(obj.typeptr)
        return history.ConstInt(cpu.cast_adr_to_int(cls))
 
    def get_exception_obj(self, evaluebox):
        # only works when translated
        obj = evaluebox.getref(lltype.Ptr(rclass.OBJECT))
        return cast_base_ptr_to_instance(Exception, obj)
 
    def cast_to_baseclass(self, value):
        return lltype.cast_opaque_ptr(lltype.Ptr(rclass.OBJECT), value)

src/s/y/Sypy-HEAD/jit/metainterp/virtualref.py   Sypy(Download)
        # we make the low-level type of an RPython class directly
        self.JIT_VIRTUAL_REF = lltype.GcStruct('JitVirtualRef',
            ('super', rclass.OBJECT),
            ('virtual_token', lltype.Signed),
            ('forced', rclass.OBJECTPTR))

src/s/y/Sypy-HEAD/rpython/lltypesystem/ll2ctypes.py   Sypy(Download)
from pypy.annotation import model as annmodel
from pypy.rpython.llinterp import LLInterpreter, LLException
from pypy.rpython.lltypesystem.rclass import OBJECT, OBJECT_VTABLE
from pypy.rpython import raddress
from pypy.translator.platform import platform
            else:
                # special treatment of 'OBJECT' subclasses
                if get_rtyper() and lltype._castdepth(REAL_TYPE, OBJECT) >= 0:
                    # figure out the real type of the object
                    containerheader = lltype._struct(OBJECT)
                    cobjheader = ctypes.cast(cobj,
                                       get_ctypes_type(lltype.Ptr(OBJECT)))

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/jit/backend/llgraph/llimpl.py   plexnet(Download)
        # for tests, a random emulated ll_inst will do
        if Class not in _pseudo_exceptions:
            ll_inst = lltype.malloc(rclass.OBJECT)
            ll_inst.typeptr = lltype.malloc(rclass.OBJECT_VTABLE,
                                            immortal=True)

src/s/y/Sypy-HEAD/jit/backend/llsupport/llmodel.py   Sypy(Download)
            self.vtable_offset = None
        else:
            self.vtable_offset, _ = symbolic.get_field_token(rclass.OBJECT,
                                                             'typeptr',
                                                        translate_support_code)
        else:
            # for tests, a random emulated ll_inst will do
            ll_inst = lltype.malloc(rclass.OBJECT)
            ll_inst.typeptr = lltype.malloc(rclass.OBJECT_VTABLE,
                                            immortal=True)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/jit/backend/llvm/runner.py   plexnet(Download)
            ]
        self._descr_caches = {}
        self.fielddescr_vtable = self.fielddescrof(rclass.OBJECT, 'typeptr')
        if sys.maxint == 2147483647:
            self.size_of_int = 4
        self.unicode_index_array = basesize
        self.unicode_index_length = ofs_length
        self.vtable_descr = self.fielddescrof(rclass.OBJECT, 'typeptr')
        self._ovf_error_instance = self._get_prebuilt_error(OverflowError)
        self._zer_error_instance = self._get_prebuilt_error(ZeroDivisionError)
        else:
            # for tests, a random emulated ll_inst will do
            ll_inst = lltype.malloc(rclass.OBJECT)
            ll_inst.typeptr = lltype.malloc(rclass.OBJECT_VTABLE,
                                            immortal=True)

src/s/y/Sypy-HEAD/jit/backend/llvm/runner.py   Sypy(Download)
            ]
        self._descr_caches = {}
        self.fielddescr_vtable = self.fielddescrof(rclass.OBJECT, 'typeptr')
        if sys.maxint == 2147483647:
            self.size_of_int = 4
        self.unicode_index_array = basesize
        self.unicode_index_length = ofs_length
        self.vtable_descr = self.fielddescrof(rclass.OBJECT, 'typeptr')
        self._ovf_error_instance = self._get_prebuilt_error(OverflowError)
        self._zer_error_instance = self._get_prebuilt_error(ZeroDivisionError)
        else:
            # for tests, a random emulated ll_inst will do
            ll_inst = lltype.malloc(rclass.OBJECT)
            ll_inst.typeptr = lltype.malloc(rclass.OBJECT_VTABLE,
                                            immortal=True)

src/s/y/Sypy-HEAD/jit/codewriter/heaptracker.py   Sypy(Download)
def _count_fields(STRUCT):
    if STRUCT == rclass.OBJECT:
        return 0    # don't count 'typeptr'
    result = 0
    for fieldname, TYPE in STRUCT._flds.items():
def finish_registering(cpu):
    # annotation hack for small examples which have no vtable at all
    if not hasattr(cpu, '_all_size_descrs_with_vtable'):
        vtable = lltype.malloc(rclass.OBJECT_VTABLE, immortal=True)
        register_known_gctype(cpu, vtable, rclass.OBJECT)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/jit/backend/llsupport/llmodel.py   plexnet(Download)
            translator = None
        self.gc_ll_descr = get_ll_description(gcdescr, translator)
        self.vtable_offset, _ = symbolic.get_field_token(rclass.OBJECT,
                                                         'typeptr',
                                                        translate_support_code)
        else:
            # for tests, a random emulated ll_inst will do
            ll_inst = lltype.malloc(rclass.OBJECT)
            ll_inst.typeptr = lltype.malloc(rclass.OBJECT_VTABLE,
                                            immortal=True)

  1 | 2 | 3 | 4 | 5  Next