Author: fijal
Branch: jit-leaner-frontend
Changeset: r83074:b62416027897
Date: 2016-03-15 15:43 +0200
http://bitbucket.org/pypy/pypy/changeset/b62416027897/

Log:    try to get rid of values too

diff --git a/rpython/jit/metainterp/logger.py b/rpython/jit/metainterp/logger.py
--- a/rpython/jit/metainterp/logger.py
+++ b/rpython/jit/metainterp/logger.py
@@ -187,7 +187,10 @@
             s = s.replace(',', '.') # we use comma for argument splitting
             s2 = ''
             for box in args[1:]:
-                s2 += ', %d' % box.getint()
+                if isinstance(box, ConstInt):
+                    s2 += ', %d' % box.getint()
+                else:
+                    s2 += ', box'
             return "jit_debug('%s'%s)" % (s, s2)
         if ops_offset is None:
             offset = -1
diff --git a/rpython/jit/metainterp/resoperation.py 
b/rpython/jit/metainterp/resoperation.py
--- a/rpython/jit/metainterp/resoperation.py
+++ b/rpython/jit/metainterp/resoperation.py
@@ -329,10 +329,7 @@
             descr = self.getdescr()
         if descr is DONT_CHANGE:
             descr = None
-        newop = ResOperation(opnum, args, descr)
-        if self.type != 'v':
-            newop.copy_value_from(self)
-        return newop
+        return ResOperation(opnum, args, descr)
 
     def repr(self, memo, graytext=False):
         # RPython-friendly version
@@ -1720,14 +1717,6 @@
         baseclass = PlainResOp
 
     mixins = [arity2mixin.get(arity, N_aryOp)]
-    if result_type == 'i':
-        mixins.append(IntOp)
-    elif result_type == 'f':
-        mixins.append(FloatOp)
-    elif result_type == 'r':
-        mixins.append(RefOp)
-    else:
-        assert result_type == 'n'
     if name in _cast_ops:
         if "INT_SIGNEXT" in name:
             mixins.append(SignExtOp)
@@ -1736,7 +1725,11 @@
     cls_name = '%s_OP' % name
     bases = (get_base_class(tuple(mixins), baseclass),)
     dic = {'opnum': opnum}
-    return type(cls_name, bases, dic)
+    res = type(cls_name, bases, dic)
+    if result_type == 'n':
+        result_type = 'v' # why?
+    res.type = result_type
+    return res
 
 setup(__name__ == '__main__')   # print out the table when run directly
 del _oplist
diff --git a/rpython/jit/tool/oparser.py b/rpython/jit/tool/oparser.py
--- a/rpython/jit/tool/oparser.py
+++ b/rpython/jit/tool/oparser.py
@@ -252,7 +252,7 @@
         return opnum, args, descr, fail_args
 
     def create_op(self, opnum, args, res, descr, fail_args):
-        res = ResOperation(opnum, args, -1, descr)
+        res = ResOperation(opnum, args, descr)
         if fail_args is not None:
             res.setfailargs(fail_args)
         if self._postproces:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to