示例#1
0
文件: runner.py 项目: sota/pypy
 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
文件: runner.py 项目: sota/pypy
 def getfield(objbox):
     obj = objbox.getref(TYPE)
     value = getattr(obj, fieldname)
     return boxresult(T, value)
示例#10
0
文件: runner.py 项目: sota/pypy
 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
文件: runner.py 项目: sota/pypy
 def getarraylength(arraybox):
     array = arraybox.getref(ARRAY)
     return boxresult(ootype.Signed, array.ll_length())
示例#12
0
文件: runner.py 项目: sota/pypy
 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
文件: runner.py 项目: sota/pypy
 def create_array(lengthbox):
     n = lengthbox.getint()
     return boxresult(ARRAY, ootype.oonewarray(ARRAY, n))
示例#14
0
文件: runner.py 项目: sota/pypy
 def create():
     if isinstance(TYPE, ootype.OOType):
         return boxresult(TYPE, ootype.new(TYPE))
     return None