當前位置: 首頁>>代碼示例>>Python>>正文


Python ResOperation.descr方法代碼示例

本文整理匯總了Python中pypy.jit.metainterp.resoperation.ResOperation.descr方法的典型用法代碼示例。如果您正苦於以下問題:Python ResOperation.descr方法的具體用法?Python ResOperation.descr怎麽用?Python ResOperation.descr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pypy.jit.metainterp.resoperation.ResOperation的用法示例。


在下文中一共展示了ResOperation.descr方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: exc_handling

# 需要導入模塊: from pypy.jit.metainterp.resoperation import ResOperation [as 別名]
# 或者: from pypy.jit.metainterp.resoperation.ResOperation import descr [as 別名]
 def exc_handling(guard_op):
     # operations need to start with correct GUARD_EXCEPTION
     if guard_op._exc_box is None:
         op = ResOperation(rop.GUARD_NO_EXCEPTION, [], None)
     else:
         op = ResOperation(rop.GUARD_EXCEPTION, [guard_op._exc_box],
                           BoxPtr())
     op.descr = BasicFailDescr()
     op.fail_args = []
     return op
開發者ID:alkorzt,項目名稱:pypy,代碼行數:12,代碼來源:test_random.py

示例2: produce_into

# 需要導入模塊: from pypy.jit.metainterp.resoperation import ResOperation [as 別名]
# 或者: from pypy.jit.metainterp.resoperation.ResOperation import descr [as 別名]
 def produce_into(self, builder, r):
     fail_subset = builder.subset_of_intvars(r)
     original_intvars = builder.intvars[:]
     super(AbstractOvfOperation, self).produce_into(builder, r)
     if builder.cpu._overflow_flag:   # overflow detected
         del builder.cpu._overflow_flag
         op = ResOperation(rop.GUARD_OVERFLOW, [], None)
         # the overflowed result should not be used any more, but can
         # be used on the failure path: recompute fail_subset including
         # the result, and then remove it from builder.intvars.
         fail_subset = builder.subset_of_intvars(r)
         builder.intvars[:] = original_intvars
     else:
         op = ResOperation(rop.GUARD_NO_OVERFLOW, [], None)
     op.descr = BasicFailDescr()
     op.fail_args = fail_subset
     builder.loop.operations.append(op)
開發者ID:alkorzt,項目名稱:pypy,代碼行數:19,代碼來源:test_random.py


注:本文中的pypy.jit.metainterp.resoperation.ResOperation.descr方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。