[pypy-commit] pypy s390x-backend: copy copy copy. insertion of dummy methods to get the test environment going

plan_rich noreply at buildbot.pypy.org
Wed Oct 14 03:56:01 EDT 2015


Author: Richard Plangger <planrichi at gmail.com>
Branch: s390x-backend
Changeset: r80194:1c30732c9462
Date: 2015-10-14 09:56 +0200
http://bitbucket.org/pypy/pypy/changeset/1c30732c9462/

Log:	copy copy copy. insertion of dummy methods to get the test
	environment going

diff --git a/rpython/jit/backend/zarch/assembler.py b/rpython/jit/backend/zarch/assembler.py
--- a/rpython/jit/backend/zarch/assembler.py
+++ b/rpython/jit/backend/zarch/assembler.py
@@ -1,6 +1,52 @@
 from rpython.jit.backend.llsupport.assembler import GuardToken, BaseAssembler
+from rpython.jit.metainterp.resoperation import rop
 
 class AssemblerZARCH(BaseAssembler):
+
+    def _build_failure_recovery(self, exc, withfloats=False):
+        pass # TODO
+
+    def _build_wb_slowpath(self, withcards, withfloats=False, for_frame=False):
+        pass # TODO
+
+    def build_frame_realloc_slowpath(self):
+        # this code should do the following steps
+        # a) store all registers in the jitframe
+        # b) fish for the arguments passed by the caller
+        # c) store the gcmap in the jitframe
+        # d) call realloc_frame
+        # e) set the fp to point to the new jitframe
+        # f) store the address of the new jitframe in the shadowstack
+        # c) set the gcmap field to 0 in the new jitframe
+        # g) restore registers and return
+        pass # TODO
+
+    def _build_propagate_exception_path(self):
+        pass # TODO
+
+    def _build_cond_call_slowpath(self, supports_floats, callee_only):
+        """ This builds a general call slowpath, for whatever call happens to
+        come.
+        """
+        pass # TODO
+
+    def _build_stack_check_slowpath(self):
+        pass # TODO
+    # ________________________________________
+    # ASSEMBLER EMISSION
+
     def emit_op_int_add(self, op):
         pass
 
+def notimplemented_op(self, op, arglocs, regalloc, fcond):
+    print "[ZARCH/asm] %s not implemented" % op.getopname()
+    raise NotImplementedError(op)
+
+asm_operations = [notimplemented_op] * (rop._LAST + 1)
+asm_extra_operations = {}
+
+for name, value in AssemblerZARCH.__dict__.iteritems():
+    if name.startswith('emit_op_'):
+        opname = name[len('emit_op_'):]
+        num = getattr(rop, opname.upper())
+        asm_operations[num] = value
diff --git a/rpython/jit/backend/zarch/runner.py b/rpython/jit/backend/zarch/runner.py
--- a/rpython/jit/backend/zarch/runner.py
+++ b/rpython/jit/backend/zarch/runner.py
@@ -1,7 +1,17 @@
 from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU
+from rpython.rtyper.lltypesystem import lltype, llmemory
 
 class AbstractZARCHCPU(AbstractLLCPU):
-    pass
+    def __init__(self, rtyper, stats, opts=None, translate_support_code=False,
+                 gcdescr=None):
+        AbstractLLCPU.__init__(self, rtyper, stats, opts,
+                               translate_support_code, gcdescr)
+
+    def cast_ptr_to_int(x):
+        adr = llmemory.cast_ptr_to_adr(x)
+        return adr
+    cast_ptr_to_int._annspecialcase_ = 'specialize:arglltype(0)'
+    cast_ptr_to_int = staticmethod(cast_ptr_to_int)
 
 class CPU_S390_64(AbstractZARCHCPU):
     pass


More information about the pypy-commit mailing list