예제 #1
0
 def compute_types(self):
     box2classes = {} # box --> [ootype.Class]
     self._collect_types(self.cliloop.operations, box2classes)
     for box, classes in box2classes.iteritems():
         cls = classes[0]
         for cls2 in classes[1:]:
             if ootype.subclassof(cls, cls2):
                 cls = cls2
             else:
                 assert ootype.subclassof(cls2, cls)
         self.box2type[box] = dotnet.class2type(cls)
예제 #2
0
파일: test_basic.py 프로젝트: enyst/plexnet
 def f(flag, n):
     res = True
     while n > -100:
         myjitdriver.can_enter_jit(n=n, flag=flag, res=res)
         myjitdriver.jit_merge_point(n=n, flag=flag, res=res)
         cls = getcls(flag)
         n -= 1
         res = ootype.subclassof(cls, clsB)
     return res
예제 #3
0
 def f(flag, n):
     res = True
     while n > -100:
         myjitdriver.can_enter_jit(n=n, flag=flag, res=res)
         myjitdriver.jit_merge_point(n=n, flag=flag, res=res)
         cls = getcls(flag)
         n -= 1
         res = ootype.subclassof(cls, clsB)
     return res
예제 #4
0
파일: function.py 프로젝트: alkorzt/pypy
    def _auto_propagate(self, link, block):
        assert block.exitswitch is flowmodel.c_last_exception
        if not self.auto_propagate_exceptions:
            return False
        if not self._is_raise_block(link.target):
            return False
        llexc = link.llexitcase
        i = list(block.exits).index(link)
        next_links = block.exits[i+1:]
        for next_link in next_links:
            # if one of the next links catches a superclass of llexc, we
            # *have* to insert a catch block here, else the exception might be
            # caught by the wrong one
            if ootype.subclassof(llexc, next_link.llexitcase):
                return False

        # if all the checks were ok, it's safe to avoid the catch block and
        # let the exception propagate
        return True
예제 #5
0
    def _auto_propagate(self, link, block):
        assert block.exitswitch is flowmodel.c_last_exception
        if not self.auto_propagate_exceptions:
            return False
        if not self._is_raise_block(link.target):
            return False
        llexc = link.llexitcase
        i = list(block.exits).index(link)
        next_links = block.exits[i + 1:]
        for next_link in next_links:
            # if one of the next links catches a superclass of llexc, we
            # *have* to insert a catch block here, else the exception might be
            # caught by the wrong one
            if ootype.subclassof(llexc, next_link.llexitcase):
                return False

        # if all the checks were ok, it's safe to avoid the catch block and
        # let the exception propagate
        return True
예제 #6
0
파일: rclass.py 프로젝트: alkorzt/pypy
def ll_issubclass(class1, class2):
    # helper for exceptiondata.py
    return ootype.subclassof(class1, class2)
예제 #7
0
파일: rclass.py 프로젝트: antoine1fr/pygirl
def ll_issubclass(meta1, meta2):
    class1 = meta1.class_
    class2 = meta2.class_
    return ootype.subclassof(class1, class2)
예제 #8
0
def ll_isinstance(inst, class_):
    c1 = ootype.classof(inst)
    return ootype.subclassof(c1, class_)
예제 #9
0
def ll_isinstance(inst, class_):
    c1 = ootype.classof(inst)
    return ootype.subclassof(c1, class_)
예제 #10
0
def ll_issubclass(class1, class2):
    # helper for exceptiondata.py
    return ootype.subclassof(class1, class2)
예제 #11
0
 def subclassOf(self, cpu, clsbox1, clsbox2):
     cls1 = clsbox1.getref(ootype.Class)
     cls2 = clsbox2.getref(ootype.Class)
     return ootype.subclassof(cls1, cls2)
예제 #12
0
def op_subclassof(class1, class2):
    return ootype.subclassof(class1, class2)
예제 #13
0
def ll_isinstance(inst, meta):
    c1 = inst.meta.class_
    c2 = meta.class_
    return ootype.subclassof(c1, c2)
예제 #14
0
파일: rclass.py 프로젝트: chyyuu/pygirl
def ll_issubclass(meta1, meta2):
    class1 = meta1.class_
    class2 = meta2.class_
    return ootype.subclassof(class1, class2)
예제 #15
0
파일: ooopimpl.py 프로젝트: njues/Sypy
def op_subclassof(class1, class2):
    return ootype.subclassof(class1, class2)