Author: Antonio Cuni <[email protected]>
Branch: virtual-raw-mallocs
Changeset: r59686:a9496762e5d8
Date: 2013-01-03 18:26 +0100
http://bitbucket.org/pypy/pypy/changeset/a9496762e5d8/

Log:    fix the tests in test_optimizebasic, which failed because Whatever()
        compared == INT even when it should not

diff --git a/pypy/jit/metainterp/resume.py b/pypy/jit/metainterp/resume.py
--- a/pypy/jit/metainterp/resume.py
+++ b/pypy/jit/metainterp/resume.py
@@ -453,6 +453,8 @@
                 return self.liveboxes_from_env[box]
             return self.liveboxes[box]
 
+class WrongVirtualKind(Exception):
+    pass
 
 class AbstractVirtualInfo(object):
     kind = REF
@@ -467,6 +469,15 @@
     def debug_prints(self):
         raise NotImplementedError
 
+    # subclasses should override one and only one of these two methods,
+    # depending on the kind
+    def allocate(self, decoder, index):
+        raise WrongVirtualKind
+
+    def allocate_int(self, decoder, index):
+        raise WrongVirtualKind
+        
+
 class AbstractVirtualStructInfo(AbstractVirtualInfo):
     def __init__(self, fielddescrs):
         self.fielddescrs = fielddescrs
diff --git a/pypy/jit/metainterp/test/test_resume.py 
b/pypy/jit/metainterp/test/test_resume.py
--- a/pypy/jit/metainterp/test/test_resume.py
+++ b/pypy/jit/metainterp/test/test_resume.py
@@ -1005,7 +1005,12 @@
             @staticmethod
             def enumerate_vars(callback_i, callback_r, callback_f, _):
                 for index, tagged in enumerate(self.cur_numb.nums):
-                    box = self.decode_box(tagged, Whatever())
+                    _, tag = untag(tagged)
+                    if tag == TAGVIRTUAL:
+                        kind = REF
+                    else:
+                        kind = Whatever()
+                    box = self.decode_box(tagged, kind)
                     if box.type == INT:
                         callback_i(index, index)
                     elif box.type == REF:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to