コード例 #1
0
ファイル: interp_jit.py プロジェクト: TheDunn/flex-pypy
 def getcode(self):
     # if the self is a compile time constant and if its code
     # is a BuiltinCode => grab and return its code as a constant
     if _is_early_constant(self):
         from pypy.interpreter.gateway import BuiltinCode
         code = hint(self, deepfreeze=True).code
         if not isinstance(code, BuiltinCode): code = self.code
     else:
         code = self.code
     return code
コード例 #2
0
ファイル: interp_jit.py プロジェクト: griels/pypy-sc
 def getcode(self):
     # if the self is a compile time constant and if its code
     # is a BuiltinCode => grab and return its code as a constant
     if _is_early_constant(self):
         from pypy.interpreter.gateway import BuiltinCode
         code = hint(self, deepfreeze=True).code
         if not isinstance(code, BuiltinCode): code = self.code
     else:
         code = self.code
     return code
コード例 #3
0
ファイル: tiny2.py プロジェクト: chyyuu/pygirl
def myint(s, start=0):
    if _is_early_constant(s):
        s = hint(s, promote=True)
        start = hint(start, promote=True)
        n = myint_internal(s, start)
        if n < 0:
            raise ValueError
    else:
        n = myint_internal(s, start)
        if n < 0:
            raise ValueError
    return n
コード例 #4
0
ファイル: tiny2.py プロジェクト: TheDunn/flex-pypy
def myint(s, start=0):
    if _is_early_constant(s):
        s = hint(s, promote=True)
        start = hint(start, promote=True)
        n = myint_internal(s, start)
        if n < 0:
            raise ValueError
    else:
        n = myint_internal(s, start)
        if n < 0:
            raise ValueError
    return n
コード例 #5
0
 def f(x):
     if jit._is_early_constant(x):
         return 42
     return 0
コード例 #6
0
ファイル: test_frontend.py プロジェクト: chyyuu/pygirl
 def g(x):
     if _is_early_constant(x):
         return 42
     hint(x, concrete=True)
     return 0
コード例 #7
0
ファイル: test_frontend.py プロジェクト: TheDunn/flex-pypy
 def g(x):
     if _is_early_constant(x):
         return 42
     hint(x, concrete=True)
     return 0