本文整理匯總了Python中pypy.jit.metainterp.resoperation.ResOperation.getdescr方法的典型用法代碼示例。如果您正苦於以下問題:Python ResOperation.getdescr方法的具體用法?Python ResOperation.getdescr怎麽用?Python ResOperation.getdescr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pypy.jit.metainterp.resoperation.ResOperation
的用法示例。
在下文中一共展示了ResOperation.getdescr方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: optimize_NEW_ARRAY
# 需要導入模塊: from pypy.jit.metainterp.resoperation import ResOperation [as 別名]
# 或者: from pypy.jit.metainterp.resoperation.ResOperation import getdescr [as 別名]
def optimize_NEW_ARRAY(self, op):
sizebox = self.get_constant_box(op.getarg(0))
if sizebox is not None:
# if the original 'op' did not have a ConstInt as argument,
# build a new one with the ConstInt argument
if not isinstance(op.getarg(0), ConstInt):
op = ResOperation(rop.NEW_ARRAY, [sizebox], op.result, descr=op.getdescr())
self.make_varray(op.getdescr(), sizebox.getint(), op.result, op)
else:
self.getvalue(op.result).ensure_nonnull()
self.emit_operation(op)
示例2: has_pure_result
# 需要導入模塊: from pypy.jit.metainterp.resoperation import ResOperation [as 別名]
# 或者: from pypy.jit.metainterp.resoperation.ResOperation import getdescr [as 別名]
def has_pure_result(self, opnum, args, descr):
op = ResOperation(opnum, args, None, descr)
key = self.optimizer.make_args_key(op)
op = self.optimizer.pure_operations.get(key, None)
if op is None:
return False
return op.getdescr() is descr
示例3: handle_malloc_operation
# 需要導入模塊: from pypy.jit.metainterp.resoperation import ResOperation [as 別名]
# 或者: from pypy.jit.metainterp.resoperation.ResOperation import getdescr [as 別名]
def handle_malloc_operation(self, op):
opnum = op.getopnum()
if opnum == rop.NEW:
self.handle_new_fixedsize(op.getdescr(), op)
elif opnum == rop.NEW_WITH_VTABLE:
classint = op.getarg(0).getint()
descr = heaptracker.vtable2descr(self.cpu, classint)
self.handle_new_fixedsize(descr, op)
if self.gc_ll_descr.fielddescr_vtable is not None:
op = ResOperation(rop.SETFIELD_GC,
[op.result, ConstInt(classint)], None,
descr=self.gc_ll_descr.fielddescr_vtable)
self.newops.append(op)
elif opnum == rop.NEW_ARRAY:
descr = op.getdescr()
assert isinstance(descr, ArrayDescr)
self.handle_new_array(descr, op)
elif opnum == rop.NEWSTR:
self.handle_new_array(self.gc_ll_descr.str_descr, op)
elif opnum == rop.NEWUNICODE:
self.handle_new_array(self.gc_ll_descr.unicode_descr, op)
else:
raise NotImplementedError(op.getopname())