当前位置: 首页>>代码示例>>Python>>正文


Python WarmEnterState.make_entry_point方法代码示例

本文整理汇总了Python中pypy.jit.metainterp.warmstate.WarmEnterState.make_entry_point方法的典型用法代码示例。如果您正苦于以下问题:Python WarmEnterState.make_entry_point方法的具体用法?Python WarmEnterState.make_entry_point怎么用?Python WarmEnterState.make_entry_point使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pypy.jit.metainterp.warmstate.WarmEnterState的用法示例。


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

示例1: make_enter_function

# 需要导入模块: from pypy.jit.metainterp.warmstate import WarmEnterState [as 别名]
# 或者: from pypy.jit.metainterp.warmstate.WarmEnterState import make_entry_point [as 别名]
    def make_enter_function(self):
        from pypy.jit.metainterp.warmstate import WarmEnterState
        state = WarmEnterState(self)
        maybe_compile_and_run = state.make_entry_point()
        self.state = state

        def crash_in_jit(e):
            if not we_are_translated():
                print "~~~ Crash in JIT!"
                print '~~~ %s: %s' % (e.__class__, e)
                if sys.stdout == sys.__stdout__:
                    import pdb; pdb.post_mortem(sys.exc_info()[2])
                raise
            fatalerror('~~~ Crash in JIT! %s' % (e,), traceback=True)
        crash_in_jit._dont_inline_ = True

        if self.translator.rtyper.type_system.name == 'lltypesystem':
            def maybe_enter_jit(*args):
                try:
                    maybe_compile_and_run(*args)
                except JitException:
                    raise     # go through
                except Exception, e:
                    crash_in_jit(e)
            maybe_enter_jit._always_inline_ = True
开发者ID:alkorzt,项目名称:pypy,代码行数:27,代码来源:warmspot.py

示例2: make_enter_function

# 需要导入模块: from pypy.jit.metainterp.warmstate import WarmEnterState [as 别名]
# 或者: from pypy.jit.metainterp.warmstate.WarmEnterState import make_entry_point [as 别名]
    def make_enter_function(self, jd):
        from pypy.jit.metainterp.warmstate import WarmEnterState
        state = WarmEnterState(self, jd)
        maybe_compile_and_run = state.make_entry_point()
        jd.warmstate = state

        def crash_in_jit(e):
            tb = not we_are_translated() and sys.exc_info()[2]
            try:
                raise e
            except JitException:
                raise     # go through
            except MemoryError:
                raise     # go through
            except StackOverflow:
                raise     # go through
            except Exception, e:
                if not we_are_translated():
                    print "~~~ Crash in JIT!"
                    print '~~~ %s: %s' % (e.__class__, e)
                    if sys.stdout == sys.__stdout__:
                        import pdb; pdb.post_mortem(tb)
                    raise e.__class__, e, tb
                fatalerror('~~~ Crash in JIT! %s' % (e,), traceback=True)
开发者ID:gorakhargosh,项目名称:pypy,代码行数:26,代码来源:warmspot.py


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