示例#1
0
import types
import inspect
import sys

__jited_count = 0
__jit_mode = 0
try:
    import _llvm
    if (_llvm.get_jit_control() == "whenhot"):
        __jited_count = -1
    __jit_mode = 1
    __jit_dict = {}
except:
    _llvm = None

try:
    if (__jit_mode == 0):
        import psyco
        __jit_mode = 2
except:
    psyco = None


def compile_llvm(func):
    """compile using unladen-swallow llvm"""
    if (_llvm != None) and \
       (hasattr(func, '__code__')) and \
       (func.__code__.__use_llvm__ == False):
        func.__code__.__use_llvm__ = True
        func.__code__.co_optimization = 2
        #
示例#2
0
 def setUp(self):
     # This test is sensitive to random pauses, so we disable the JIT if it
     # is present.
     if _llvm:
         self.orig_jit_control = _llvm.get_jit_control()
         _llvm.set_jit_control("never")
示例#3
0
 def setUp(self):
     # This test is sensitive to random pauses, so we disable the JIT if it
     # is present.
     if _llvm:
         self.orig_jit_control = _llvm.get_jit_control()
         _llvm.set_jit_control("never")
示例#4
0
 def setUp(self):
     # TODO(rnk): This test doesn't pass with the background thread under
     # -Xjit=always, so we disable the JIT for the duration of the tests.
     if _llvm:
         self.orig_jit_control = _llvm.get_jit_control()
         _llvm.set_jit_control("never")