[pypy-svn] r62466 - pypy/branch/pyjitpl5/pypy/jit/backend/x86

fijal at codespeak.net fijal at codespeak.net
Tue Mar 3 13:55:29 CET 2009


Author: fijal
Date: Tue Mar  3 13:55:29 2009
New Revision: 62466

Added:
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/executor.py   (contents, props changed)
Log:
oops, missing file


Added: pypy/branch/pyjitpl5/pypy/jit/backend/x86/executor.py
==============================================================================
--- (empty file)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/executor.py	Tue Mar  3 13:55:29 2009
@@ -0,0 +1,27 @@
+
+""" This is a simple class for executing operations directly, without
+trying too hard to have execute_operation run
+"""
+
+from pypy.rlib.rarithmetic import ovfcheck
+from pypy.jit.metainterp.history import BoxInt
+from pypy.jit.metainterp.resoperation import rop
+
+class Executor(object):
+    @staticmethod
+    def int_add_ovf(args):
+        return BoxInt(ovfcheck(args[0].getint() + args[1].getint()))
+
+    @staticmethod
+    def int_sub_ovf(args):
+        return BoxInt(ovfcheck(args[0].getint() - args[1].getint()))
+
+    @staticmethod
+    def int_mul_ovf(args):
+        return BoxInt(ovfcheck(args[0].getint() * args[1].getint()))
+
+execute = [None] * rop._LAST
+
+for key in Executor.__dict__:
+    if not key.startswith('_'):
+        execute[getattr(rop, key.upper())] = getattr(Executor, key)



More information about the Pypy-commit mailing list