本文整理匯總了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
示例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)