• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python jit.virtual_ref_finish函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pypy.rlib.jit.virtual_ref_finish函数的典型用法代码示例。如果您正苦于以下问题:Python virtual_ref_finish函数的具体用法?Python virtual_ref_finish怎么用?Python virtual_ref_finish使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了virtual_ref_finish函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_direct_invalid

def test_direct_invalid():
    x1 = X()
    vref = virtual_ref(x1)
    assert vref._state == 'non-forced'
    virtual_ref_finish(vref, x1)
    assert vref._state == 'invalid'
    py.test.raises(InvalidVirtualRef, "vref()")
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:7,代码来源:test__jit_vref.py


示例2: f

 def f(n):
     while n > 0:
         myjitdriver.can_enter_jit(n=n)
         myjitdriver.jit_merge_point(n=n)
         xy = XY()
         xy.next1 = lltype.malloc(A, 0)
         xy.next2 = lltype.malloc(A, 0)
         xy.next3 = lltype.malloc(A, 0)
         xy.next4 = lltype.malloc(A, 0)
         xy.next5 = lltype.malloc(A, 0)
         xy.n = n
         exctx.topframeref = vref = virtual_ref(xy)
         if n % 6 == 0:
             xy.next1 = lltype.nullptr(A)
             xy.next2 = lltype.nullptr(A)
             xy.next3 = lltype.nullptr(A)
             externalfn(n)
         n -= 1
         exctx.topframeref = vref_None
         xy.next1 = lltype.nullptr(A)
         xy.next2 = lltype.nullptr(A)
         xy.next3 = lltype.nullptr(A)
         xy.next4 = lltype.nullptr(A)
         xy.next5 = lltype.nullptr(A)
         virtual_ref_finish(vref, xy)
     return exctx.m
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:26,代码来源:test_virtualref.py


示例3: test_direct_forced

def test_direct_forced():
    x1 = X()
    vref = virtual_ref(x1)
    assert vref._state == 'non-forced'
    assert vref() is x1
    assert vref._state == 'forced'
    virtual_ref_finish(vref, x1)
    assert vref._state == 'forced'
    assert vref() is x1
开发者ID:gorakhargosh,项目名称:pypy,代码行数:9,代码来源:test__jit_vref.py


示例4: leave

 def leave(self, frame, got_exception):
     frame_vref = self.topframeref
     self.topframeref = frame.backref
     if frame.escaped or got_exception:
         back = frame.backref()
         if back is not None:
             back.escaped = True
         frame_vref()
     jit.virtual_ref_finish(frame_vref, frame)
开发者ID:gnprice,项目名称:rupypy,代码行数:9,代码来源:executioncontext.py


示例5: fn

 def fn(n):
     res = False
     while n > 0:
         myjitdriver.can_enter_jit(n=n)
         myjitdriver.jit_merge_point(n=n)
         xy = XY()
         xy.n = n
         vref = virtual_ref(xy)
         virtual_ref_finish(vref, xy)
         vref() # raises InvalidVirtualRef when jitted
         n -= 1
     return res
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:12,代码来源:test_virtualref.py


示例6: f

 def f(n):
     while n > 0:
         myjitdriver.can_enter_jit(n=n)
         myjitdriver.jit_merge_point(n=n)
         xy = XY()
         xy.n = n
         exctx.topframeref = virtual_ref(xy)
         exctx.later = exctx.topframeref
         n -= 1
         exctx.topframeref = vref_None
         virtual_ref_finish(xy)
     return g()
开发者ID:alkorzt,项目名称:pypy,代码行数:12,代码来源:test_virtualref.py


示例7: leave

    def leave(self, frame, w_exitvalue, got_exception):
        try:
            if self.profilefunc:
                self._trace(frame, 'leaveframe', w_exitvalue)
        finally:
            frame_vref = self.topframeref
            self.topframeref = frame.f_backref
            if frame.escaped or got_exception:
                # if this frame escaped to applevel, we must ensure that also
                # f_back does
                f_back = frame.f_backref()
                if f_back:
                    f_back.mark_as_escaped()
                # force the frame (from the JIT point of view), so that it can
                # be accessed also later
                frame_vref()
            jit.virtual_ref_finish(frame_vref, frame)

        if self.w_tracefunc is not None and not frame.hide():
            self.space.frame_trace_action.fire()
开发者ID:gorakhargosh,项目名称:pypy,代码行数:20,代码来源:executioncontext.py


示例8: leave

 def leave():
     vref = exctx.topframeref
     exctx.topframeref = vref_None
     virtual_ref_finish(vref, exctx._frame)
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:4,代码来源:test_virtualref.py


示例9: test_direct_2

def test_direct_2():
    x1 = X()
    vref = virtual_ref(x1)
    virtual_ref_finish(x1)
    assert vref() is x1
开发者ID:alkorzt,项目名称:pypy,代码行数:5,代码来源:test__jit_vref.py


示例10: f

 def f():
     x1 = X()
     vref = virtual_ref(x1)
     x2 = vref()
     virtual_ref_finish(vref, x1)
     return x2
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:6,代码来源:test__jit_vref.py


示例11: f

 def f(n, x, x0, x1, x2, x3, x4, x5, x6, x7, l, s):
     a = A()
     glob.v = vref = virtual_ref(a)
     virtual_ref_finish(vref, a)
     n -= 1
     return n, x, x0, x1, x2, x3, x4, x5, x6, x7, l, s
开发者ID:gorakhargosh,项目名称:pypy,代码行数:6,代码来源:test_zrpy_gc.py


示例12: leave

 def leave():
     exctx.topframeref = vref_None
     virtual_ref_finish(exctx._frame)
开发者ID:alkorzt,项目名称:pypy,代码行数:3,代码来源:test_virtualref.py



注:本文中的pypy.rlib.jit.virtual_ref_finish函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python jit.we_are_jitted函数代码示例发布时间:2022-05-27
下一篇:
Python jit.virtual_ref函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap