Ejemplo n.º 1
0
 def load(self, meth):
     holdertype = self.holder.GetType()
     funcfield = holdertype.GetField('func')
     Const.load(self, meth)
     meth.il.Emit(OpCodes.Castclass, holdertype)
     meth.il.Emit(OpCodes.Ldfld, funcfield)
     meth.il.Emit(OpCodes.Castclass, dotnet.typeof(LoopDelegate))
Ejemplo n.º 2
0
    def setinteriorfield(self, index, ofs, value):
        raise NotImplementedError


class ConstantValue(OptValue):
    def __init__(self, box):
        self.make_constant(box)

    def __repr__(self):
        return 'Constant(%r)' % (self.box,)

CONST_0      = ConstInt(0)
CONST_1      = ConstInt(1)
CVAL_ZERO    = ConstantValue(CONST_0)
CVAL_ZERO_FLOAT = ConstantValue(Const._new(0.0))
llhelper.CVAL_NULLREF = ConstantValue(llhelper.CONST_NULL)
oohelper.CVAL_NULLREF = ConstantValue(oohelper.CONST_NULL)
REMOVED = AbstractResOp(None)


class Optimization(object):
    next_optimization = None

    def __init__(self):
        pass # make rpython happy

    def propagate_forward(self, op):
        raise NotImplementedError

    def emit_operation(self, op):
Ejemplo n.º 3
0
    def setinteriorfield(self, index, ofs, value):
        raise NotImplementedError


class ConstantValue(OptValue):
    def __init__(self, box):
        self.make_constant(box)

    def __repr__(self):
        return 'Constant(%r)' % (self.box, )


CONST_0 = ConstInt(0)
CONST_1 = ConstInt(1)
CVAL_ZERO = ConstantValue(CONST_0)
CVAL_ZERO_FLOAT = ConstantValue(Const._new(0.0))
llhelper.CVAL_NULLREF = ConstantValue(llhelper.CONST_NULL)
oohelper.CVAL_NULLREF = ConstantValue(oohelper.CONST_NULL)
REMOVED = AbstractResOp(None)


class Optimization(object):
    next_optimization = None

    def __init__(self):
        pass  # make rpython happy

    def propagate_forward(self, op):
        raise NotImplementedError

    def emit_operation(self, op):