* src/threads/lock-common.h (lock_get_initial_lock_word): Removed prototype.
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Sat, 13 Oct 2007 14:24:44 +0000 (16:24 +0200)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Sat, 13 Oct 2007 14:24:44 +0000 (16:24 +0200)
* src/threads/native/lock.c (lock_get_initial_lock_word): Removed.

* src/vm/jit/codegen-common.c (codegen_add_patch_ref): Removed.
* src/vm/jit/codegen-common.h (patchref) Removed structure.
(codegendata): Removed patchrefs.
(codegen_add_patch_ref): Removed prototype.

* src/vm/jit/emit-common.h (emit_patcher_stubs): Removed prototype.

* src/vm/jit/patcher-common.h: Removed ifdefs around patcher function macros.

* src/vm/jit/patcher.h: Removed file.

src/threads/lock-common.h
src/threads/native/lock.c
src/vm/jit/codegen-common.c
src/vm/jit/codegen-common.h
src/vm/jit/emit-common.h
src/vm/jit/patcher-common.h
src/vm/jit/patcher.h [deleted file]

index b9cff55a590b15b59518538bdce1e8b95d8a90eb..8d7edb6772aa8b136baba098df537668d13ef4de 100644 (file)
@@ -49,7 +49,6 @@
 void lock_init(void);
 
 void lock_init_object_lock(java_object_t *);
-lock_record_t *lock_get_initial_lock_word(void);
 
 ptrint lock_pre_compute_thinlock(s4 index);
 
index e99e587056356b466b7a70f94b22a772122e0e3b..8d239135c199cfd803c524391aeed31d342e83a4 100644 (file)
@@ -696,21 +696,6 @@ void lock_init_object_lock(java_object_t *o)
 }
 
 
-/* lock_get_initial_lock_word **************************************************
-
-   Returns the initial (unlocked) lock word. The pointer is
-   required in the code generator to set up a virtual
-   java_objectheader for code patch locking.
-
-*******************************************************************************/
-
-lock_record_t *lock_get_initial_lock_word(void)
-{
-       return (lock_record_t *) THIN_UNLOCKED;
-}
-
-
-
 /*============================================================================*/
 /* LOCKING ALGORITHM                                                          */
 /*============================================================================*/
index 043043be68b775c93cc222da6519104f727551e6..49eef1716e8f3f3340e965ffbf259f5259683c72 100644 (file)
 
 #include "vm/types.h"
 
-#if defined(ENABLE_JIT)
-/* this is required PATCHER_CALL_SIZE */
-# include "codegen.h"
-#endif
-
+#include "codegen.h"
 #include "md-abi.h"
 
 #include "mm/memory.h"
@@ -212,8 +208,6 @@ void codegen_setup(jitdata *jd)
        cd->datareferences = NULL;
 #endif
 
-/*     cd->patchrefs      = list_create_dump(OFFSET(patchref, linkage)); */
-       cd->patchrefs      = NULL;
        cd->brancheslabel  = list_create_dump(OFFSET(branch_label_ref_t, linkage));
        cd->listcritical   = list_create_dump(OFFSET(critical_section_ref_t, linkage));
 
@@ -260,8 +254,6 @@ static void codegen_reset(jitdata *jd)
        cd->datareferences  = NULL;
 #endif
 
-/*     cd->patchrefs       = list_create_dump(OFFSET(patchref, linkage)); */
-       cd->patchrefs       = NULL;
        cd->brancheslabel   = list_create_dump(OFFSET(branch_label_ref_t, linkage));
        cd->listcritical    = list_create_dump(OFFSET(critical_section_ref_t, linkage));
 
@@ -535,51 +527,6 @@ void codegen_branch_label_add(codegendata *cd, s4 label, s4 condition, s4 reg, u
 }
 
 
-/* codegen_add_patch_ref *******************************************************
-
-   Appends a new patcher reference to the list of patching positions.
-
-*******************************************************************************/
-
-void codegen_add_patch_ref(codegendata *cd, functionptr patcher, voidptr ref,
-                                                  s4 disp)
-{
-       patchref *pr;
-       s4        branchmpc;
-
-       branchmpc = cd->mcodeptr - cd->mcodebase;
-
-       pr = DNEW(patchref);
-
-       pr->branchpos = branchmpc;
-       pr->disp      = disp;
-       pr->patcher   = patcher;
-       pr->ref       = ref;
-
-/*     list_add_first(cd->patchrefs, pr); */
-       pr->next      = cd->patchrefs;
-       cd->patchrefs = pr;
-
-       /* Generate NOPs for opt_shownops. */
-
-       if (opt_shownops)
-               PATCHER_NOPS;
-
-#if defined(ENABLE_JIT) && (defined(__I386__) || defined(__M68K__) || defined(__MIPS__) \
- || defined(__SPARC_64__) || defined(__X86_64__))
-
-       /* On some architectures the patcher stub call instruction might
-          be longer than the actual instruction generated.  On this
-          architectures we store the last patcher call position and after
-          the basic block code generation is completed, we check the
-          range and maybe generate some nop's. */
-       /* The nops are generated in codegen_emit in each codegen */
-
-       cd->lastmcodeptr = cd->mcodeptr + PATCHER_CALL_SIZE;
-#endif
-}
-
-
 /* codegen_critical_section_new ************************************************
 
    Allocates a new critical-section reference and adds it to the
index 24365494bac7546334aa089c3e0d8e1ff82b0e9f..c6a37a08cc71817473713af6cf27bb9b4342492d 100644 (file)
@@ -37,7 +37,6 @@ typedef struct critical_section_ref_t critical_section_ref_t;
 typedef struct jumpref                jumpref;
 typedef struct dataref                dataref;
 typedef struct exceptionref           exceptionref;
-typedef struct patchref               patchref;
 typedef struct linenumberref          linenumberref;
 
 
@@ -133,8 +132,6 @@ struct codegendata {
        dataref        *datareferences; /* list of data segment references        */
 #endif
 
-/*     list_t         *patchrefs; */
-       patchref       *patchrefs;
        list_t         *brancheslabel;
        list_t         *listcritical;   /* list of critical sections              */
 
@@ -216,18 +213,6 @@ struct dataref {
 };
 
 
-/* patchref *******************************************************************/
-
-struct patchref {
-       s4           branchpos;     /* relative offset to method entrypoint       */
-       s4           disp;          /* displacement of ref in the data segment    */
-       functionptr  patcher;       /* patcher function to call                   */
-       voidptr      ref;           /* reference passed                           */
-/*     listnode     linkage; */
-       patchref    *next;
-};
-
-
 /* linenumberref **************************************************************/
 
 struct linenumberref {
@@ -281,12 +266,6 @@ void codegen_resolve_branchrefs(codegendata *cd, basicblock *bptr);
 
 void codegen_branch_label_add(codegendata *cd, s4 label, s4 condition, s4 reg, u4 options);
 
-
-void codegen_add_patch_ref(codegendata *cd, functionptr patcher, voidptr ref,
-                                                  s4 disp);
-/* XXX REMOVE ME: don't-break-trunk macro */
-#define codegen_addpatchref codegen_add_patch_ref
-
 void codegen_insertmethod(u1 *startpc, u1 *endpc);
 u1 *codegen_get_pv_from_pc(u1 *pc);
 u1 *codegen_get_pv_from_pc_nocheck(u1 *pc);
index 11ba8f33038dbf1694fe302b9fafc0bc85fbda0b..34fa5ada147f7abe820421a611c2390f2e544e8d 100644 (file)
@@ -180,7 +180,6 @@ void emit_exception_check(codegendata *cd, instruction *iptr);
 void emit_trap_compiler(codegendata *cd);
 uint32_t emit_trap(codegendata *cd);
 
-void emit_patcher_stubs(jitdata *jd);
 void emit_patcher_traps(jitdata *jd);
 
 void emit_verbosecall_enter(jitdata *jd);
index ff37940cf6e089525ba60d96b70d87dcd923cce7..f5004a207dc8e158b693dafc588dd94db918c97f 100644 (file)
@@ -81,8 +81,6 @@ void patcher_patch_code(patchref_t *pr);
 
 /* patcher prototypes and macros **********************************************/
 
-#if defined(__ALPHA__) || defined(__ARM__) || defined(__I386__) || defined(__MIPS__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined (__S390__) || defined(__X86_64__) || defined(__M68K__)
-
 /* new patcher functions */
 
 bool patcher_resolve_class(patchref_t *pr);
@@ -182,9 +180,6 @@ bool patcher_instanceof_class(patchref_t *pr);
 #endif /* defined(__I386__) */
 
 
-#endif /* architecture list */
-
-
 #endif /* _PATCHER_COMMON_H */
 
 
diff --git a/src/vm/jit/patcher.h b/src/vm/jit/patcher.h
deleted file mode 100644 (file)
index 3bcab74..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-/* src/vm/jit/patcher.h - code patching functions
-
-   Copyright (C) 1996-2005, 2006, 2007 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.
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   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., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA.
-
-*/
-
-
-#ifndef _PATCHER_H
-#define _PATCHER_H
-
-#include "config.h"
-
-#include <assert.h>
-
-#include "vm/types.h"
-
-#include "threads/lock-common.h"
-
-#include "vm/global.h"
-
-
-#if defined(__ALPHA__) || defined(__ARM__) || defined(__I386__) || defined(__MIPS__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined(__S390__)
-# error "you should no longer include this file"
-#else
-
-
-/* patcher macros *************************************************************/
-
-#define PATCHER_FLAG_PATCHED    (vftbl_t *) 0xdeadbeef
-
-
-#if defined(ENABLE_THREADS)
-
-#define PATCHER_MONITORENTER \
-       /* enter a monitor on the patching position */       \
-                                                            \
-       lock_monitor_enter(o);                               \
-                                                            \
-       /* check if the position has already been patched */ \
-                                                            \
-       if (o->vftbl != NULL) {                              \
-        assert(o->vftbl == PATCHER_FLAG_PATCHED);        \
-                                                         \
-               lock_monitor_exit(o);                            \
-                                                            \
-               return NULL;                                     \
-       }                                                    \
-
-
-#define PATCHER_MONITOREXIT \
-       /* leave the monitor on the patching position */     \
-                                                            \
-       lock_monitor_exit(o);
-
-
-#define PATCHER_MARK_PATCHED_MONITOREXIT \
-       /* mark position as patched */                       \
-                                                            \
-       o->vftbl = PATCHER_FLAG_PATCHED;                     \
-                                                            \
-       PATCHER_MONITOREXIT
-
-#else
-
-#define PATCHER_MONITORENTER                 /* nop */
-#define PATCHER_MONITOREXIT                  /* nop */
-#define PATCHER_MARK_PATCHED_MONITOREXIT     /* nop */
-
-#endif /* defined(ENABLE_THREADS) */
-
-
-/* function prototypes ********************************************************/
-
-java_object_t *patcher_wrapper(u1 *sp, u1 *pv, u1 *ra);
-#define PATCHER_wrapper (functionptr) patcher_wrapper
-
-bool patcher_resolve_class(u1 *sp);
-#define PATCHER_resolve_class (functionptr) patcher_resolve_class
-
-bool patcher_initialize_class(u1 *sp);
-#define PATCHER_initialize_class (functionptr) patcher_initialize_class
-
-bool patcher_resolve_classref_to_classinfo(u1 *sp);
-#define PATCHER_resolve_classref_to_classinfo (functionptr) patcher_resolve_classref_to_classinfo
-
-bool patcher_resolve_classref_to_vftbl(u1 *sp);
-#define PATCHER_resolve_classref_to_vftbl (functionptr) patcher_resolve_classref_to_vftbl
-
-bool patcher_resolve_classref_to_flags(u1 *sp);
-#define PATCHER_resolve_classref_to_flags (functionptr) patcher_resolve_classref_to_flags
-
-bool patcher_resolve_native_function(u1 *sp);
-#define PATCHER_resolve_native_function (functionptr) patcher_resolve_native_function
-
-
-bool patcher_get_putstatic(u1 *sp);
-#define PATCHER_get_putstatic (functionptr) patcher_get_putstatic
-
-#if defined(__I386__)
-
-bool patcher_getfield(u1 *sp);
-#define PATCHER_getfield (functionptr) patcher_getfield
-
-bool patcher_putfield(u1 *sp);
-#define PATCHER_putfield (functionptr) patcher_putfield
-
-#else
-
-bool patcher_get_putfield(u1 *sp);
-#define PATCHER_get_putfield (functionptr) patcher_get_putfield
-
-#endif /* defined(__I386__) */
-
-#if defined(__I386__) || defined(__X86_64__)
-
-bool patcher_putfieldconst(u1 *sp);
-#define PATCHER_putfieldconst (functionptr) patcher_putfieldconst
-
-#endif /* defined(__I386__) || defined(__X86_64__) */
-
-bool patcher_aconst(u1 *sp);
-#define PATCHER_aconst (functionptr) patcher_aconst
-
-bool patcher_builtin_multianewarray(u1 *sp);
-#define PATCHER_builtin_multianewarray (functionptr) patcher_builtin_multianewarray
-
-bool patcher_builtin_arraycheckcast(u1 *sp);
-#define PATCHER_builtin_arraycheckcast (functionptr) patcher_builtin_arraycheckcast
-
-bool patcher_invokestatic_special(u1 *sp);
-#define PATCHER_invokestatic_special (functionptr) patcher_invokestatic_special
-
-bool patcher_invokevirtual(u1 *sp);
-#define PATCHER_invokevirtual (functionptr) patcher_invokevirtual
-
-bool patcher_invokeinterface(u1 *sp);
-#define PATCHER_invokeinterface (functionptr) patcher_invokeinterface
-
-
-/* only for interpreter */
-bool patcher_checkcast_instanceof(u1 *sp);
-#define PATCHER_checkcast_instanceof (functionptr) patcher_checkcast_instanceof
-
-
-bool patcher_checkcast_instanceof_flags(u1 *sp);
-#define PATCHER_checkcast_instanceof_flags (functionptr) patcher_checkcast_instanceof_flags
-
-bool patcher_checkcast_instanceof_interface(u1 *sp);
-#define PATCHER_checkcast_instanceof_interface (functionptr) patcher_checkcast_instanceof_interface
-
-bool patcher_checkcast_interface(u1 *sp);
-#define PATCHER_checkcast_interface (functionptr) patcher_checkcast_interface
-
-bool patcher_instanceof_interface(u1 *sp);
-#define PATCHER_instanceof_interface (functionptr) patcher_instanceof_interface
-
-#if defined(__I386__) || defined(__X86_64__) || defined(__POWERPC__) || defined(__POWERPC64__)
-
-bool patcher_checkcast_class(u1 *sp);
-#define PATCHER_checkcast_class (functionptr) patcher_checkcast_class
-
-bool patcher_instanceof_class(u1 *sp);
-#define PATCHER_instanceof_class (functionptr) patcher_instanceof_class
-
-#else /* defined(__I386__) || defined(__X86_64__) || defined(__POWERPC__) || defined(__POWERPC64__)*/
-
-bool patcher_checkcast_instanceof_class(u1 *sp);
-#define PATCHER_checkcast_instanceof_class (functionptr) patcher_checkcast_instanceof_class
-
-#endif /* defined(__I386__) || defined(__X86_64__) || defined(__POWERPC__) || defined(__POWERPC64__)*/
-
-bool patcher_clinit(u1 *sp);
-#define PATCHER_clinit (functionptr) patcher_clinit
-
-bool patcher_athrow_areturn(u1 *sp);
-#define PATCHER_athrow_areturn (functionptr) patcher_athrow_areturn
-
-bool patcher_resolve_native(u1 *sp);
-#define PATCHER_resolve_native (functionptr) patcher_resolve_native
-
-
-/* stuff for the interpreter **************************************************/
-
-#if defined(ENABLE_INTRP)
-bool intrp_patcher_get_putstatic(u1 *sp);
-bool intrp_patcher_get_putstatic_clinit(u1 *sp);
-bool intrp_patcher_get_putfield(u1 *sp);
-bool intrp_patcher_aconst(u1 *sp);
-bool intrp_patcher_builtin_multianewarray(u1 *sp);
-bool intrp_patcher_builtin_arraycheckcast(u1 *sp);
-bool intrp_patcher_invokestatic_special(u1 *sp);
-bool intrp_patcher_invokevirtual(u1 *sp);
-bool intrp_patcher_invokeinterface(u1 *sp);
-bool intrp_patcher_checkcast_instanceof(u1 *sp);
-bool intrp_patcher_resolve_native(u1 *sp);
-#endif /* defined(ENABLE_INTRP) */
-
-#endif /* architecture list */
-
-#endif /* _PATCHER_H */
-
-
-/*
- * 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
- * Emacs will automagically detect them.
- * ---------------------------------------------------------------------
- * Local variables:
- * mode: c
- * indent-tabs-mode: t
- * c-basic-offset: 4
- * tab-width: 4
- * End:
- * vim:noexpandtab:sw=4:ts=4:
- */
-