Пример #1
0
 def callmeth(selfbox, argboxes):
     selfobj = selfbox.getref(SELFTYPE)
     meth = getattr(selfobj, methname)
     methargs = getargs(argboxes)
     res = meth(*methargs)
     if METH.RESULT is not ootype.Void:
         return boxresult(METH.RESULT, res)
Пример #2
0
 def callmeth(selfbox, argboxes):
     selfobj = selfbox.getref(SELFTYPE)
     meth = getattr(selfobj, methname)
     methargs = getargs(argboxes)
     res = meth(*methargs)
     if METH.RESULT is not ootype.Void:
         return boxresult(METH.RESULT, res)
Пример #3
0
 def getfield(objbox):
     obj = objbox.getref(TYPE)
     value = getattr(obj, fieldname)
     return boxresult(T, value)
Пример #4
0
 def callfunc(funcbox, argboxes):
     funcobj = funcbox.getref(FUNC)
     funcargs = getargs(argboxes)
     res = funcobj(*funcargs)
     if RESULT is not ootype.Void:
         return boxresult(RESULT, res)
Пример #5
0
 def getarraylength(arraybox):
     array = arraybox.getref(ARRAY)
     return boxresult(ootype.Signed, array.ll_length())
Пример #6
0
 def getarrayitem(arraybox, ibox):
     array = arraybox.getref(ARRAY)
     i = ibox.getint()
     if TYPE is not ootype.Void:
         return boxresult(TYPE, array.ll_getitem_fast(i))
Пример #7
0
 def create_array(lengthbox):
     n = lengthbox.getint()
     return boxresult(ARRAY, ootype.oonewarray(ARRAY, n))
Пример #8
0
 def create():
     if isinstance(TYPE, ootype.OOType):
         return boxresult(TYPE, ootype.new(TYPE))
     return None
Пример #9
0
 def getfield(objbox):
     obj = objbox.getref(TYPE)
     value = getattr(obj, fieldname)
     return boxresult(T, value)
Пример #10
0
 def callfunc(funcbox, argboxes):
     funcobj = funcbox.getref(FUNC)
     funcargs = getargs(argboxes)
     res = funcobj(*funcargs)
     if RESULT is not ootype.Void:
         return boxresult(RESULT, res)
Пример #11
0
 def getarraylength(arraybox):
     array = arraybox.getref(ARRAY)
     return boxresult(ootype.Signed, array.ll_length())
Пример #12
0
 def getarrayitem(arraybox, ibox):
     array = arraybox.getref(ARRAY)
     i = ibox.getint()
     if TYPE is not ootype.Void:
         return boxresult(TYPE, array.ll_getitem_fast(i))
Пример #13
0
 def create_array(lengthbox):
     n = lengthbox.getint()
     return boxresult(ARRAY, ootype.oonewarray(ARRAY, n))
Пример #14
0
 def create():
     if isinstance(TYPE, ootype.OOType):
         return boxresult(TYPE, ootype.new(TYPE))
     return None