Commits

Carl Friedrich Bolz committed 8cf2c45

similarly, make specifying a jitpolicy in the target optional: apart from PyPy,
almost all targets use the default policy.

Comments (0)

Files changed (6)

rpython/jit/tl/targettlc.py

 import py
 py.path.local(__file__)
 from rpython.jit.tl.tlc import interp, interp_nonjit, ConstantPool
-from rpython.jit.codewriter.policy import JitPolicy
 from rpython.jit.backend.hlinfo import highleveljitinfo
 
 
     return decode_program(f.readall())
 
 def target(driver, args):
-    return entry_point, None
+    return entry_point
 
 # ____________________________________________________________
 
-def jitpolicy(driver):
-    """Returns the JIT policy to use when translating."""
-    return JitPolicy()
-
 if __name__ == '__main__':
     import sys
     sys.exit(entry_point(sys.argv))

rpython/jit/tl/targettlr.py

     return bytecode
 
 def target(driver, args):
-    return entry_point, None
+    return entry_point
 
 # ____________________________________________________________
 
-from rpython.jit.codewriter.policy import JitPolicy
-
-def jitpolicy(driver):
-    return JitPolicy()
-
 if __name__ == '__main__':
     import sys
     sys.exit(entry_point(sys.argv))

rpython/jit/tl/tla/targettla.py

 def target(driver, args):
     return entry_point, None
 
-def jitpolicy(driver):
-    from rpython.jit.codewriter.policy import JitPolicy
-    return JitPolicy()
 # ____________________________________________________________
 
 

rpython/translator/driver.py

         """ Generate bytecodes for JIT and flow the JIT helper functions
         lltype version
         """
-        get_policy = self.extra['jitpolicy']
-        self.jitpolicy = get_policy(self)
+        from rpython.jit.codewriter.policy import JitPolicy
+        get_policy = self.extra.get('jitpolicy', None)
+        if get_policy is None:
+            self.jitpolicy = JitPolicy()
+        else:
+            self.jitpolicy = get_policy(self)
         #
         from rpython.jit.metainterp.warmspot import apply_jit
         apply_jit(self.translator, policy=self.jitpolicy,

rpython/translator/goal/targetjitstandalone.py

 """
 
 from rpython.rlib import jit
-from rpython.jit.codewriter.policy import JitPolicy
 
 driver = jit.JitDriver(greens = [], reds = 'auto')
 driver2 = jit.JitDriver(greens = [], reds = 'auto')
     return 0
 
 def target(*args):
-    return entry_point, None
-
-def jitpolicy(driver):
-    return JitPolicy()
+    return entry_point

rpython/translator/goal/translate.py

                                                        default_goal='compile')
         log_config(translateconfig, "translate.py configuration")
         if config.translation.jit:
-            if 'jitpolicy' not in targetspec_dic:
-                raise Exception('target has no jitpolicy defined.')
             if (translateconfig.goals != ['annotate'] and
                 translateconfig.goals != ['rtype']):
                 drv.set_extra_goals(['pyjitpl'])