Armin Rigo avatar Armin Rigo committed 7928fad

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

Comments (0)

Files changed (2)

pypy/jit/backend/llsupport/jitframe.py

 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',
     # 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)

pypy/jit/backend/x86/assembler.py

         #
         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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.