本文整理匯總了Python中pypy.jit.metainterp.resoperation.ResOperation.getarg方法的典型用法代碼示例。如果您正苦於以下問題:Python ResOperation.getarg方法的具體用法?Python ResOperation.getarg怎麽用?Python ResOperation.getarg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pypy.jit.metainterp.resoperation.ResOperation
的用法示例。
在下文中一共展示了ResOperation.getarg方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _optimize_NEWSTR
# 需要導入模塊: from pypy.jit.metainterp.resoperation import ResOperation [as 別名]
# 或者: from pypy.jit.metainterp.resoperation.ResOperation import getarg [as 別名]
def _optimize_NEWSTR(self, op, mode):
length_box = self.get_constant_box(op.getarg(0))
if length_box:
# 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(mode.NEWSTR, [length_box], op.result)
vvalue = self.make_vstring_plain(op.result, op, mode)
vvalue.setup(length_box.getint())
else:
self.getvalue(op.result).ensure_nonnull()
self.emit_operation(op)
self.pure(mode.STRLEN, [op.result], op.getarg(0))
示例2: optimize_VIRTUAL_REF
# 需要導入模塊: from pypy.jit.metainterp.resoperation import ResOperation [as 別名]
# 或者: from pypy.jit.metainterp.resoperation.ResOperation import getarg [as 別名]
def optimize_VIRTUAL_REF(self, op):
op = ResOperation(rop.SAME_AS, [op.getarg(0)], op.result)
self.emit_operation(op)