Author: chromatic
Date: Mon Mar 31 22:00:21 2008
New Revision: 26684

Added:
   trunk/src/jit/ppc/exec_dep.c   (contents, props changed)
Modified:
   trunk/MANIFEST
   trunk/src/jit/ppc/exec_dep.h

Log:
[JIT] Fixed the JIT build on PPC accidentally broken in r26636.  This also
finishes more of what RT #47289 tried to accomplish.

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST      (original)
+++ trunk/MANIFEST      Mon Mar 31 22:00:21 2008
@@ -2744,6 +2744,7 @@
 src/jit/ppc/asm.s                                           []
 src/jit/ppc/core.jit                                        []
 src/jit/ppc/exec_dep.h                                      []
+src/jit/ppc/exec_dep.c                                      []
 src/jit/ppc/jit_emit.h                                      []
 src/jit/ppc/ppc-linux.s                                     []
 src/jit/skeleton/jit_emit.h                                 []

Added: trunk/src/jit/ppc/exec_dep.c
==============================================================================
--- (empty file)
+++ trunk/src/jit/ppc/exec_dep.c        Mon Mar 31 22:00:21 2008
@@ -0,0 +1,78 @@
+/* Copyright (C) 2003-2008, The Perl Foundation.  */
+
+/*
+ * exec_dep.c
+ *
+ * SVN Info
+ *    $Id$
+ * Overview:
+ *    PPC dependent functions to emit an executable.
+ * History:
+ *      Initial version by Daniel Grunblatt on 2003.6.9
+ * Notes:
+ * References:
+ */
+
+#include "exec_dep.h"
+
+#ifdef JIT_CGP
+
+void
+Parrot_exec_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
+{
+}
+
+#else /* JIT_CGP */
+
+void
+Parrot_exec_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
+{
+    add_disp(jit_info->native_ptr, r3,
+        ((long)jit_info->cur_op - (long)interp->code->base.data));
+    jit_emit_mov_rr(jit_info->native_ptr, r4, r13);
+
+    Parrot_exec_add_text_rellocation(jit_info->objfile,
+        jit_info->native_ptr, RTYPE_FUNC,
+            interp->op_info_table[*jit_info->cur_op].func_name, 0);
+    _emit_bx(jit_info->native_ptr, 1, 0);
+}
+
+#endif /* JIT_CGP */
+
+void
+Parrot_exec_cpcf_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
+{
+    Parrot_exec_normal_op(jit_info, interp);
+    jit_emit_sub_rrr(jit_info->native_ptr, r3, r3, r15);
+    jit_emit_add_rrr(jit_info->native_ptr, r3, r14, r3);
+    jit_emit_lwz(jit_info->native_ptr, r3, 0, r3);
+    jit_emit_mtlr(jit_info->native_ptr, r3);
+    jit_emit_blr(jit_info->native_ptr);
+}
+
+void
+Parrot_exec_restart_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
+{
+}
+
+/* Assign the offset of the program_code */
+static void
+offset_fixup(Parrot_exec_objfile_t *obj)
+{
+    int i, j;
+
+    for (i = 0; i < obj->data_count; i++) {
+#ifdef EXEC_MACH_O
+        obj->symbol_table[i].value = obj->text.size;
+#endif
+        for (j = 0; j < i; j++)
+            obj->symbol_table[i].value += obj->data_size[j];
+    }
+}
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: trunk/src/jit/ppc/exec_dep.h
==============================================================================
--- trunk/src/jit/ppc/exec_dep.h        (original)
+++ trunk/src/jit/ppc/exec_dep.h        Mon Mar 31 22:00:21 2008
@@ -1,6 +1,4 @@
-/*
- * Copyright (C) 2003-2007, The Perl Foundation.
- */
+/* Copyright (C) 2003-2008, The Perl Foundation.  */
 
 /*
  * exec_dep.h
@@ -21,66 +19,26 @@
 #ifdef JIT_CGP
 
 void
-Parrot_exec_normal_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-}
+Parrot_exec_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
 
 #else /* JIT_CGP */
 
 void
-Parrot_exec_normal_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    add_disp(jit_info->native_ptr, r3,
-        ((long)jit_info->cur_op - (long)interp->code->base.data));
-    jit_emit_mov_rr(jit_info->native_ptr, r4, r13);
-
-    Parrot_exec_add_text_rellocation(jit_info->objfile,
-        jit_info->native_ptr, RTYPE_FUNC,
-            interp->op_info_table[*jit_info->cur_op].func_name, 0);
-    _emit_bx(jit_info->native_ptr, 1, 0);
-}
+Parrot_exec_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
 
 #endif /* JIT_CGP */
 
 void
-Parrot_exec_cpcf_op(Parrot_jit_info_t *jit_info,
-                   PARROT_INTERP)
-{
-    Parrot_exec_normal_op(jit_info, interp);
-    jit_emit_sub_rrr(jit_info->native_ptr, r3, r3, r15);
-    jit_emit_add_rrr(jit_info->native_ptr, r3, r14, r3);
-    jit_emit_lwz(jit_info->native_ptr, r3, 0, r3);
-    jit_emit_mtlr(jit_info->native_ptr, r3);
-    jit_emit_blr(jit_info->native_ptr);
-}
+Parrot_exec_cpcf_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
 
 void
-Parrot_exec_restart_op(Parrot_jit_info_t *jit_info,
-                       PARROT_INTERP)
-{
-}
+Parrot_exec_restart_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
 
-
-/* Assign the offset of the progra_code */
 static void
-offset_fixup(Parrot_exec_objfile_t *obj)
-{
-    int i, j;
-
-    for (i = 0; i < obj->data_count; i++) {
-#ifdef EXEC_MACH_O
-        obj->symbol_table[i].value = obj->text.size;
-#endif
-        for (j = 0; j < i; j++)
-            obj->symbol_table[i].value += obj->data_size[j];
-    }
-}
+offset_fixup(Parrot_exec_objfile_t *obj);
 
 #endif /* PARROT_PPC_EXEC_DEP_H_GUARD */
 
-
 /*
  * Local variables:
  *   c-file-style: "parrot"

Reply via email to