* Removed all Id tags.
[cacao.git] / src / vm / jit / intrp / md.c
index ef418249acf12dc6609154cd27136dc81f1bf45b..1ee5156101af1d42f225c0635214548856f1f8d3 100644 (file)
@@ -1,9 +1,9 @@
 /* src/vm/jit/intrp/md.c - machine dependent Interpreter functions
 
-   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
-   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
-   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
-   Institut f. Computersprachen - TU Wien
+   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
+   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
+   J. Wenninger, Institut f. Computersprachen - TU Wien
 
    This file is part of CACAO.
 
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
 
-   Contact: cacao@complang.tuwien.ac.at
+   Contact: cacao@cacaojvm.org
 
    Authors: Andreas Krall
             Reinhard Grafl
    Changes: Joseph Wenninger
             Christian Thalinger
 
-   $Id: md.c 3229 2005-09-19 14:04:57Z twisti $
 
 */
 
 
+#include "config.h"
+
 #include <assert.h>
 #include <stdlib.h>
 #include <signal.h>
 
-#include "config.h"
 #include "vm/types.h"
 
 #include "vm/jit/intrp/intrp.h"
 
 
 Inst *vm_prim = NULL; /* initialized by md_init() */
+FILE *vm_out = NULL;  /* debugging output for vmgenerated stuff */
 
 
 /* md_init *********************************************************************
@@ -54,24 +55,25 @@ Inst *vm_prim = NULL; /* initialized by md_init() */
 
 *******************************************************************************/
 
-void md_init(void)
+void intrp_md_init(void)
 {
-       vm_out = stdout;
+       vm_out = stderr;
+
+    if (setvbuf(stdout,NULL, _IOLBF,0) != 0) {
+               perror("setvbuf error");
+               exit(1);
+       }
+
        if ( vm_prim == NULL ) {
-               (void)engine(NULL, NULL, NULL);
+               vm_prim = (Inst *)engine(NULL, NULL, NULL);
        }
+
        if (peeptable == 0) {
                init_peeptable();
        }
-}
-
 
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
-void thread_restartcriticalsection(ucontext_t *uc)
-{
-       assert(false);
+       dynamic_super_init();
 }
-#endif
 
 
 /* md_stacktrace_get_returnaddress *********************************************
@@ -81,30 +83,19 @@ void thread_restartcriticalsection(ucontext_t *uc)
 
 *******************************************************************************/
 
-functionptr md_stacktrace_get_returnaddress(u1 *sp, u4 framesize)
+u1 *intrp_md_stacktrace_get_returnaddress(u1 *sp, u4 framesize)
 {
-       functionptr ra;
+       u1 *ra;
 
        /* ATTENTION: the passed sp is actually the fp! (see java.vmg for stack 
           layout) */
 
-       ra = (functionptr) (ptrint) *((u1 **) (sp - framesize - sizeof(void *)));
+       ra = *((u1 **) (sp - framesize - sizeof(void *)));
 
        return ra;
 }
 
 
-/* XXX remove me!!! */
-void md_param_alloc(methoddesc *md)
-{
-}
-
-void md_return_alloc(methodinfo *m, registerdata *rd, s4 return_type,
-                                        stackptr stackslot)
-{
-}
-
-
 /*
  * These are local overrides for various environment variables in Emacs.
  * Please do not remove this and leave it at the end of the file, where