本文整理汇总了Python中pypy.translator.translator.TranslationContext._graphof方法的典型用法代码示例。如果您正苦于以下问题:Python TranslationContext._graphof方法的具体用法?Python TranslationContext._graphof怎么用?Python TranslationContext._graphof使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypy.translator.translator.TranslationContext
的用法示例。
在下文中一共展示了TranslationContext._graphof方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: rcompile
# 需要导入模块: from pypy.translator.translator import TranslationContext [as 别名]
# 或者: from pypy.translator.translator.TranslationContext import _graphof [as 别名]
def rcompile(rgenop, entrypoint, argtypes, random_seed=0, type_system='lltype'):
from pypy.translator.translator import TranslationContext
from pypy.annotation.policy import AnnotatorPolicy
from pypy import conftest
t = TranslationContext()
policy = AnnotatorPolicy()
policy.allow_someobjects = False
t.buildannotator(policy=policy).build_types(entrypoint, argtypes)
t.buildrtyper(type_system = type_system).specialize()
# note that backend optimizations will constant-fold simple operations,
# which is required by some backends that don't accept calls like
# genop1("add", constant, constant).
from pypy.translator.backendopt.all import backend_optimizations
backend_optimizations(t)
if conftest.option.view:
t.view()
entrygraph = t._graphof(entrypoint)
return compile_graph(rgenop, entrygraph, random_seed=random_seed)