Author: hager <[email protected]>
Branch: ppc-jit-backend
Changeset: r46613:22995a8dec29
Date: 2011-08-18 18:34 +0200
http://bitbucket.org/pypy/pypy/changeset/22995a8dec29/

Log:    Added David's patch to the code.

diff --git a/pypy/jit/backend/ppc/ppcgen/asmfunc.py 
b/pypy/jit/backend/ppc/ppcgen/asmfunc.py
--- a/pypy/jit/backend/ppc/ppcgen/asmfunc.py
+++ b/pypy/jit/backend/ppc/ppcgen/asmfunc.py
@@ -1,8 +1,10 @@
 import py
 import mmap, struct
+
 from pypy.jit.backend.ppc.codebuf import MachineCodeBlockWrapper
 from pypy.jit.backend.llsupport.asmmemmgr import AsmMemoryManager
 from pypy.rpython.lltypesystem import lltype, rffi
+from pypy.jit.backend.ppc.ppcgen.arch import IS_PPC_32, IS_PPC_64, WORD
 
 _ppcgen = None
 
@@ -15,6 +17,14 @@
 class AsmCode(object):
     def __init__(self, size):
         self.code = MachineCodeBlockWrapper()
+        if IS_PPC_64:
+            # allocate function descriptor - 3 doublewords
+            self.emit(0)
+            self.emit(0)
+            self.emit(0)
+            self.emit(0)
+            self.emit(0)
+            self.emit(0)
 
     def emit(self, insn):
         bytes = struct.pack("i", insn)
@@ -23,5 +33,9 @@
 
     def get_function(self):
         i = self.code.materialize(AsmMemoryManager(), [])
+        if IS_PPC_64:
+            p = rffi.cast(rffi.CArrayPtr(lltype.Signed), i)
+            p[0] = i + 3*WORD
+            # p[1], p[2] = ??
         t = lltype.FuncType([], lltype.Signed)
         return rffi.cast(lltype.Ptr(t), i)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to