Author: Armin Rigo <[email protected]>
Branch: remove-globals-in-jit
Changeset: r58935:7928fad1c2db
Date: 2012-11-15 21:59 +0100
http://bitbucket.org/pypy/pypy/changeset/7928fad1c2db/

Log:    Give up using a union for now, which simplifies things.

diff --git a/pypy/jit/backend/llsupport/jitframe.py 
b/pypy/jit/backend/llsupport/jitframe.py
--- a/pypy/jit/backend/llsupport/jitframe.py
+++ b/pypy/jit/backend/llsupport/jitframe.py
@@ -2,11 +2,11 @@
 from pypy.jit.codewriter import longlong
 
 
+# XXX not an actual union for now
 VALUEUNION = lltype.Struct('VALUEUNION',
                            ('int', lltype.Signed),
                            ('ref', llmemory.GCREF),
-                           ('float', longlong.FLOATSTORAGE),
-                           hints={'union': True})
+                           ('float', longlong.FLOATSTORAGE))
 
 DEADFRAME = lltype.GcStruct(
     'DEADFRAME',
@@ -26,8 +26,8 @@
     # exception is not stored there, but in jf_values[0].ref.)
     ('jf_guard_exc', llmemory.GCREF),
 
-    # All values are stored in the following array, for now not very
-    # compactly on 32-bit machines.
+    # All values are stored in the following array, for now not
+    # compactly at all
     ('jf_values', lltype.Array(VALUEUNION)))
 
 DEADFRAMEPTR = lltype.Ptr(DEADFRAME)
diff --git a/pypy/jit/backend/x86/assembler.py 
b/pypy/jit/backend/x86/assembler.py
--- a/pypy/jit/backend/x86/assembler.py
+++ b/pypy/jit/backend/x86/assembler.py
@@ -2434,17 +2434,19 @@
         #
         if op.result is not None:
             # load the return value from the dead frame's value index 0
-            # (use descrs.as_int here, which is valid too for descrs.as_ref)
-            t = unpack_interiorfielddescr(descrs.as_int)
-            load_from = (eax.value, t[0])
             kind = op.result.type
             if kind == FLOAT:
-                self.mc.MOVSD_xm(xmm0.value, load_from)
+                t = unpack_interiorfielddescr(descrs.as_float)
+                self.mc.MOVSD_xm(xmm0.value, (eax.value, t[0]))
                 if result_loc is not xmm0:
                     self.mc.MOVSD(result_loc, xmm0)
             else:
                 assert result_loc is eax
-                self.mc.MOV_rm(eax.value, load_from)
+                if kind == INT:
+                    t = unpack_interiorfielddescr(descrs.as_int)
+                else:
+                    t = unpack_interiorfielddescr(descrs.as_ref)
+                self.mc.MOV_rm(eax.value, (eax.value, t[0]))
         #
         # Here we join Path A and Path B again
         offset = self.mc.get_relative_pos() - jmp_location
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to