[pypy-svn] pypy jit-virtual_state: make sure we have the same class

hakanardo commits-noreply at bitbucket.org
Sun Feb 6 12:58:29 CET 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-virtual_state
Changeset: r41643:fdc5adf84129
Date: 2011-02-06 11:16 +0100
http://bitbucket.org/pypy/pypy/changeset/fdc5adf84129/

Log:	make sure we have the same class

diff --git a/pypy/jit/metainterp/optimizeopt/unroll.py b/pypy/jit/metainterp/optimizeopt/unroll.py
--- a/pypy/jit/metainterp/optimizeopt/unroll.py
+++ b/pypy/jit/metainterp/optimizeopt/unroll.py
@@ -607,16 +607,16 @@
                 for sh in short:                                        
                     if sh.virtual_state.generalization_of(virtual_state):
                         # FIXME: Do we still need the dry run
-                        if self.inline(sh.operations, sh.inputargs,
-                                       op.getarglist(), dryrun=True):
-                            try:
-                                self.inline(sh.operations, sh.inputargs,
-                                            op.getarglist())
-                            except InvalidLoop:
-                                debug_print("Inlining failed unexpectedly",
-                                            "jumping to preamble instead")
-                                self.emit_operation(op)
-                            return
+                        #if self.inline(sh.operations, sh.inputargs,
+                        #               op.getarglist(), dryrun=True):
+                        try:
+                            self.inline(sh.operations, sh.inputargs,
+                                        op.getarglist())
+                        except InvalidLoop:
+                            debug_print("Inlining failed unexpectedly",
+                                        "jumping to preamble instead")
+                            self.emit_operation(op)
+                        return
                 if not self.retraced:    
                     raise RetraceLoop
         self.emit_operation(op)

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
@@ -455,6 +455,9 @@
     def generalization_of(self, other):
         if not isinstance(other, AbstractVirtualStructInfo):
             return False
+        if not self.known_class.same_constant(other.known_class):
+            return False
+        
         assert len(self.fielddescrs) == len(self.fieldstate)
         assert len(other.fielddescrs) == len(other.fieldstate)
         if len(self.fielddescrs) != len(other.fielddescrs):


More information about the Pypy-commit mailing list