當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。