* src/threads/critical.c: Removed.
authorChristian Thalinger <twisti@complang.tuwien.ac.at>
Wed, 25 Jun 2008 10:45:46 +0000 (12:45 +0200)
committerChristian Thalinger <twisti@complang.tuwien.ac.at>
Wed, 25 Jun 2008 10:45:46 +0000 (12:45 +0200)
* src/threads/critical.h: Likewise.
* src/mm/boehm-gc/include/gc.h (GC_signum1, GC_signum2): Removed.
* src/mm/boehm-gc/pthread_stop_world.c (lock_stopworld)
(unlock_stopworld): Likewise.
(GC_signum1, GC_signum2): Likewise.
* src/threads/Makefile.am (libthreads_la_SOURCES): Removed
critical.[ch].
* src/threads/posix/thread-posix.c (STOPWORLD_FROM_GC)
(STOPWORLD_FROM_CLASS_NUMBERING): Removed.
(stopworldwhere): Likewise.
[__IRIX__] (suspend_ack_lock, suspend_cond): Likewise.
(lock_stopworld, unlock_stopworld, threads_cast_sendsignals)
(threads_cast_darwinstop, threads_cast_darwinresume)
(threads_cast_irixresume, threads_sigsuspend_handler): Likewise.
[ENABLE_GC_CACAO] (threads_stopworld, threads_startworld): Added
#ifdef, replaced {lock,unlock}_stopworld with mutex_{lock,unlock}.
[ENABLE_GC_CACAO] (threads_suspend_ack, threads_resume_thread): Added
#ifdef.
* src/threads/thread.c (threads/critical.h): Removed.
* src/vm/jit/asmpart.h [ENABLE_THREADS] (threads/critical.h):
Likewise.
* src/vm/jit/codegen-common.c (codegen_setup): Removed listcritical.
(codegen_reset): Likewise.
[ENABLE_THREADS] (codegen_critical_section_new)
(codegen_critical_section_start, codegen_critical_section_end)
(codegen_critical_section_finish): Removed.
(codegen_finish) [ENABLE_THREADS]: Removed
codegen_critical_section_finish.
* src/vm/jit/codegen-common.h (critical_section_ref_t): Removed.
(codegendata): Removed listcritical.
[ENABLE_THREADS] (codegen_critical_section_new)
(codegen_critical_section_start, codegen_critical_section_end)
(codegen_critical_section_finish, CODEGEN_CRITICAL_SECTION_NEW)
(CODEGEN_CRITICAL_SECTION_START, CODEGEN_CRITICAL_SECTION_END):
Removed.
* src/vm/vm.c (vm_create): Removed critical_init.
* src/vmcore/linker.c (linker_compute_subclasses): Removed obsolete
threads_{stop,start}world.
* src/vm/jit/alpha/codegen.c,
src/vm/jit/arm/codegen.c,
src/vm/jit/i386/codegen.c,
src/vm/jit/m68k/codegen.c,
src/vm/jit/mips/codegen.c,
src/vm/jit/powerpc/codegen.c,
src/vm/jit/powerpc64/codegen.c,
src/vm/jit/s390/codegen.c (codegen_emit): Removed
CODEGEN_CRITICAL_SECTION_NEW, CODEGEN_CRITICAL_SECTION_START,
CODEGEN_CRITICAL_SECTION_END.
* src/vm/jit/alpha/freebsd/md-os.c,
src/vm/jit/alpha/linux/md-os.c,
src/vm/jit/arm/linux/md-os.c,
src/vm/jit/sparc64/codegen.c,
src/vm/jit/x86_64/codegen.c,
src/vm/jit/i386/cygwin/md-os.c,
src/vm/jit/i386/darwin/md-os.c,
src/vm/jit/i386/freebsd/md-os.c,
src/vm/jit/i386/linux/md-os.c,
src/vm/jit/mips/irix/md-os.c,
src/vm/jit/mips/linux/md-os.c,
src/vm/jit/mips/uclinux/md-os.c,
src/vm/jit/powerpc/darwin/md-os.c,
src/vm/jit/powerpc/linux/md-os.c,
src/vm/jit/powerpc/netbsd/md-os.c,
src/vm/jit/powerpc64/linux/md-os.c,
src/vm/jit/s390/md.c,
src/vm/jit/sparc64/linux/md-os.c,
src/vm/jit/sparc64/solaris/md-os.c,
src/vm/jit/x86_64/freebsd/md-os.c,
src/vm/jit/x86_64/linux/md-os.c (md_critical_section_restart):
Removed.

41 files changed:
src/mm/boehm-gc/include/gc.h
src/mm/boehm-gc/pthread_stop_world.c
src/threads/Makefile.am
src/threads/critical.c [deleted file]
src/threads/critical.h [deleted file]
src/threads/posix/thread-posix.c
src/threads/thread.c
src/vm/jit/alpha/codegen.c
src/vm/jit/alpha/freebsd/md-os.c
src/vm/jit/alpha/linux/md-os.c
src/vm/jit/arm/codegen.c
src/vm/jit/arm/linux/md-os.c
src/vm/jit/asmpart.h
src/vm/jit/codegen-common.c
src/vm/jit/codegen-common.h
src/vm/jit/i386/codegen.c
src/vm/jit/i386/cygwin/md-os.c
src/vm/jit/i386/darwin/md-os.c
src/vm/jit/i386/freebsd/md-os.c
src/vm/jit/i386/linux/md-os.c
src/vm/jit/m68k/codegen.c
src/vm/jit/mips/codegen.c
src/vm/jit/mips/irix/md-os.c
src/vm/jit/mips/linux/md-os.c
src/vm/jit/mips/uclinux/md-os.c
src/vm/jit/powerpc/codegen.c
src/vm/jit/powerpc/darwin/md-os.c
src/vm/jit/powerpc/linux/md-os.c
src/vm/jit/powerpc/netbsd/md-os.c
src/vm/jit/powerpc64/codegen.c
src/vm/jit/powerpc64/linux/md-os.c
src/vm/jit/s390/codegen.c
src/vm/jit/s390/md.c
src/vm/jit/sparc64/codegen.c
src/vm/jit/sparc64/linux/md-os.c
src/vm/jit/sparc64/solaris/md-os.c
src/vm/jit/x86_64/codegen.c
src/vm/jit/x86_64/freebsd/md-os.c
src/vm/jit/x86_64/linux/md-os.c
src/vm/vm.c
src/vmcore/linker.c

index 1dab4c214cc789b75b4e80ade73ef2f56750f505..19a6571058bb76ca49207b366a4c324b2a3d4b9e 100644 (file)
@@ -242,11 +242,6 @@ GC_API unsigned long GC_time_limit;
  */
 GC_API void GC_init(void);
 
-/* Added for cacao */
-int GC_signum1();   
-int GC_signum2();   
-/* cacao END */
-
 /*
  * general purpose allocation routines, with roughly malloc calling conv.
  * The atomic versions promise that no relevant pointers are contained
index 85fa531cb193f6b1f53d2bc0fa6a60792641d5d8..30ad9bef53ca8bad92d49fac06f3d7a965ef74aa 100644 (file)
@@ -372,9 +372,6 @@ int GC_suspend_all()
     return n_live_threads;
 }
 
-void lock_stopworld(int);
-void unlock_stopworld();
-
 void GC_stop_world()
 {
     int i;
@@ -561,16 +558,4 @@ void GC_stop_init() {
       }
 }
 
-/* Added for cacao */
-int GC_signum1()
-{
-    return SIG_SUSPEND;
-}
-
-int GC_signum2()
-{
-    return SIG_THR_RESTART;
-}
-/* cacao END */
-
 #endif
index b6cf86dd5bdfc94439964c1c0c7c11cd74faf3aa..1aa9df94ff18e0e7ef59ebd9ca06be049a2a8ba3 100644 (file)
@@ -49,8 +49,6 @@ noinst_LTLIBRARIES = \
 
 if ENABLE_THREADS
 libthreads_la_SOURCES = \
-       critical.c \
-       critical.h \
        lock-common.h \
        mutex.h \
        threadlist.c \
diff --git a/src/threads/critical.c b/src/threads/critical.c
deleted file mode 100644 (file)
index 51c3317..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-/* src/threads/critical.c - restartable critical sections
-
-   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.
-
-*/
-
-
-#include "config.h"
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "vm/types.h"
-
-#include "threads/critical.h"
-
-#include "toolbox/avl.h"
-
-
-/* the AVL tree containing the critical sections */
-
-static avl_tree_t *criticaltree;
-
-
-/* prototypes *****************************************************************/
-
-static int critical_comparator(const void *treenode, const void *node);
-
-
-/* critical_init ***************************************************************
-
-   Init global data structures.
-
-*******************************************************************************/
-
-void critical_init(void)
-{
-    criticaltree = avl_create(&critical_comparator);
-}
-
-
-/* critical_comparator *********************************************************
-
-   Comparison function for AVL tree of critical section.
-
-   IN:
-       treenode....node in the tree
-          node........node to compare with tree-node
-
-   RETURN VALUE:
-       -1, 0, +1 for (pa <, ==, > pb)
-
-*******************************************************************************/
-
-static int critical_comparator(const void *treenode, const void *node)
-{
-       const critical_section_node_t *treecsn;
-       const critical_section_node_t *csn;
-
-       treecsn = treenode;
-       csn     = node;
-
-#ifdef __S390__
-#      define ADDR_MASK(x) ((u1 *)((s4)(x) & 0x7FFFFFFF))
-#else
-#      define ADDR_MASK(x) (x)
-#endif
-
-       /* compare for avl_find if we have found an entry */
-
-       if (
-               (ADDR_MASK(treecsn->start) <= ADDR_MASK(csn->start)) && 
-               (ADDR_MASK(csn->start) < ADDR_MASK(treecsn->end))
-       )
-               return 0;
-
-       /* these are for walking the tree */
-
-       if (ADDR_MASK(treecsn->start) < ADDR_MASK(csn->start))
-               return -1;
-       else
-               return 1;
-
-#undef ADDR_MASK
-}
-
-
-/* critical_section_register ***************************************************
-   Register a critical section.
-
-   IN:
-       csn....node for the critical section
-
-*******************************************************************************/
-
-void critical_section_register(critical_section_node_t *csn)
-{
-       (void) avl_insert(criticaltree, csn);
-}
-
-
-/* critical_find_restart_point *************************************************
-
-   Find a restart point for the given PC, in case it is in a critical
-   section.
-
-   IN:
-       pc.........PC
-
-   OUT:
-       PC of the restart point, or
-          NULL if the given mcodeptr is not in a critical section
-
-*******************************************************************************/
-
-u1 *critical_find_restart_point(u1 *pc)
-{
-       critical_section_node_t        csnpc;
-       const critical_section_node_t *csn;
-
-       /* fill the temporary node for comparison */
-
-       csnpc.start = pc;
-
-       /* see if there's an entry for that PC */
-
-       csn = avl_find(criticaltree, &csnpc);
-
-       if (csn == NULL)
-               return NULL;
-
-       return csn->restart;
-}
-
-
-/*
- * 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:
- */
diff --git a/src/threads/critical.h b/src/threads/critical.h
deleted file mode 100644 (file)
index 7bb2917..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/* src/threads/native/critical.h - restartable critical sections
-
-   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.
-
-   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.
-
-   Contact: cacao@cacaojvm.org
-
-   Authors: Stefan Ring
-                       Edwin Steiner
-
-   Changes: Christian Thalinger
-
-*/
-
-
-#ifndef _CRITICAL_H
-#define _CRITICAL_H
-
-#include "config.h"
-
-#include <signal.h>   /* required on some older Darwin systems for ucontext.h */
-#include <ucontext.h>
-
-
-/* forward typedefs ***********************************************************/
-
-typedef struct critical_section_node_t critical_section_node_t;
-
-
-/* critical_section_node_t *****************************************************
-
-   A node representing a restartable critical section.
-
-*******************************************************************************/
-
-struct critical_section_node_t {
-       u1 *start;
-       u1 *end;
-       u1 *restart;
-};
-
-
-/* functions ******************************************************************/
-
-void  critical_init(void);
-void  critical_section_register(critical_section_node_t *);
-u1   *critical_find_restart_point(u1*);
-
-/* this is a machine dependent function (see src/vm/jit/$(ARCH_DIR)/md.c) */
-void  md_critical_section_restart(ucontext_t *_uc);
-
-#endif /* _CRITICAL_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:
- */
index d64e18d5eec19b7284b3814a897fea6cbe815601..8a19e1e7c5362c07f4dfd9e26a4600849e71baf0 100644 (file)
@@ -185,13 +185,6 @@ static int sem_destroy(sem_t *sem)
 #endif /* defined(__DARWIN__) */
 
 
-/* internally used constants **************************************************/
-
-/* CAUTION: Do not change these values. Boehm GC code depends on them.        */
-#define STOPWORLD_FROM_GC               1
-#define STOPWORLD_FROM_CLASS_NUMBERING  2
-
-
 /* startupinfo *****************************************************************
 
    Struct used to pass info from threads_start_thread to 
@@ -238,21 +231,11 @@ static mutex_t mutex_gc;
 static mutex_t mutex_join;
 static pthread_cond_t  cond_join;
 
-/* this is one of the STOPWORLD_FROM_ constants, telling why the world is     */
-/* being stopped                                                              */
-static volatile int stopworldwhere;
-
 #if defined(ENABLE_GC_CACAO)
-
 /* semaphore used for acknowleding thread suspension                          */
 static sem_t suspend_ack;
-#if defined(__IRIX__)
-static mutex_t suspend_ack_lock = MUTEX_INITIALIZER;
-static pthread_cond_t suspend_cond = PTHREAD_COND_INITIALIZER;
 #endif
 
-#endif /* ENABLE_GC_CACAO */
-
 /* mutexes used by the fake atomic instructions                               */
 #if defined(USE_FAKE_ATOMIC_INSTRUCTIONS)
 mutex_t _cas_lock = MUTEX_INITIALIZER;
@@ -340,187 +323,6 @@ void threads_sem_post(sem_t *sem)
 }
 
 
-/* lock_stopworld **************************************************************
-
-   Enter the stopworld lock, specifying why the world shall be stopped.
-
-   IN:
-      where........ STOPWORLD_FROM_GC              (1) from within GC
-                    STOPWORLD_FROM_CLASS_NUMBERING (2) class numbering
-
-******************************************************************************/
-
-void lock_stopworld(int where)
-{
-       mutex_lock(&stopworldlock);
-/*     stopworldwhere = where; */
-}
-
-
-/* unlock_stopworld ************************************************************
-
-   Release the stopworld lock.
-
-******************************************************************************/
-
-void unlock_stopworld(void)
-{
-/*     stopworldwhere = 0; */
-       mutex_unlock(&stopworldlock);
-}
-
-/* XXX We disable that whole bunch of code until we have the exact-GC
-   running. Some of it may only be needed by the old Boehm-based
-   suspension handling. */
-
-#if 0
-
-#if !defined(__DARWIN__)
-/* Caller must hold threadlistlock */
-static s4 threads_cast_sendsignals(s4 sig)
-{
-       threadobject *t;
-       threadobject *self;
-       s4            count;
-
-       self = THREADOBJECT;
-
-       /* iterate over all started threads */
-
-       count = 0;
-
-       for (t = threadlist_first(); t != NULL; t = threadlist_next(t)) {
-               /* don't send the signal to ourself */
-
-               if (t == self)
-                       continue;
-
-               /* don't send the signal to NEW threads (because they are not
-                  completely initialized) */
-
-               if (t->state == THREAD_STATE_NEW)
-                       continue;
-
-               /* send the signal */
-
-               pthread_kill(t->tid, sig);
-
-               /* increase threads count */
-
-               count++;
-       }
-
-       return count;
-}
-
-#else
-
-static void threads_cast_darwinstop(void)
-{
-       threadobject *tobj = mainthreadobj;
-       threadobject *self = THREADOBJECT;
-
-       do {
-               if (tobj != self)
-               {
-                       thread_state_flavor_t flavor = MACHINE_THREAD_STATE;
-                       mach_msg_type_number_t thread_state_count = MACHINE_THREAD_STATE_COUNT;
-#if defined(__I386__)
-                       i386_thread_state_t thread_state;
-#else
-                       ppc_thread_state_t thread_state;
-#endif
-                       mach_port_t thread = tobj->mach_thread;
-                       kern_return_t r;
-
-                       r = thread_suspend(thread);
-
-                       if (r != KERN_SUCCESS)
-                               vm_abort("thread_suspend failed");
-
-                       r = thread_get_state(thread, flavor, (natural_t *) &thread_state,
-                                                                &thread_state_count);
-
-                       if (r != KERN_SUCCESS)
-                               vm_abort("thread_get_state failed");
-
-                       md_critical_section_restart((ucontext_t *) &thread_state);
-
-                       r = thread_set_state(thread, flavor, (natural_t *) &thread_state,
-                                                                thread_state_count);
-
-                       if (r != KERN_SUCCESS)
-                               vm_abort("thread_set_state failed");
-               }
-
-               tobj = tobj->next;
-       } while (tobj != mainthreadobj);
-}
-
-static void threads_cast_darwinresume(void)
-{
-       threadobject *tobj = mainthreadobj;
-       threadobject *self = THREADOBJECT;
-
-       do {
-               if (tobj != self)
-               {
-                       mach_port_t thread = tobj->mach_thread;
-                       kern_return_t r;
-
-                       r = thread_resume(thread);
-
-                       if (r != KERN_SUCCESS)
-                               vm_abort("thread_resume failed");
-               }
-
-               tobj = tobj->next;
-       } while (tobj != mainthreadobj);
-}
-
-#endif
-
-#if defined(__IRIX__)
-static void threads_cast_irixresume(void)
-{
-       mutex_lock(&suspend_ack_lock);
-       pthread_cond_broadcast(&suspend_cond);
-       mutex_unlock(&suspend_ack_lock);
-}
-#endif
-
-#if defined(ENABLE_GC_BOEHM) && !defined(__DARWIN__)
-static void threads_sigsuspend_handler(ucontext_t *_uc)
-{
-       int sig;
-       sigset_t sigs;
-
-       /* XXX TWISTI: this is just a quick hack */
-#if defined(ENABLE_JIT)
-       md_critical_section_restart(_uc);
-#endif
-
-       /* Do as Boehm does. On IRIX a condition variable is used for wake-up
-          (not POSIX async-safe). */
-#if defined(__IRIX__)
-       mutex_lock(&suspend_ack_lock);
-       threads_sem_post(&suspend_ack);
-       pthread_cond_wait(&suspend_cond, &suspend_ack_lock);
-       mutex_unlock(&suspend_ack_lock);
-#elif defined(__CYGWIN__)
-       /* TODO */
-       assert(0);
-#else
-
-       sig = GC_signum2();
-       sigfillset(&sigs);
-       sigdelset(&sigs, sig);
-       sigsuspend(&sigs);
-#endif
-}
-#endif
-
-
 /* threads_stopworld ***********************************************************
 
    Stops the world from turning. All threads except the calling one
@@ -529,6 +331,7 @@ static void threads_sigsuspend_handler(ucontext_t *_uc)
 
 *******************************************************************************/
 
+#if defined(ENABLE_GC_CACAO)
 void threads_stopworld(void)
 {
 #if !defined(__DARWIN__) && !defined(__CYGWIN__)
@@ -538,7 +341,7 @@ void threads_stopworld(void)
        s4 count, i;
 #endif
 
-       lock_stopworld(STOPWORLD_FROM_CLASS_NUMBERING);
+       mutex_lock(&stopworldlock);
 
        /* lock the threads lists */
 
@@ -589,6 +392,7 @@ void threads_stopworld(void)
           non-signaled NEW threads can't change their state and execute
           code. */
 }
+#endif
 
 
 /* threads_startworld **********************************************************
@@ -597,6 +401,7 @@ void threads_stopworld(void)
 
 *******************************************************************************/
 
+#if defined(ENABLE_GC_CACAO)
 void threads_startworld(void)
 {
 #if !defined(__DARWIN__) && !defined(__CYGWIN__)
@@ -654,9 +459,8 @@ void threads_startworld(void)
 
        threadlist_unlock();
 
-       unlock_stopworld();
+       mutex_unlock(&stopworldlock);
 }
-
 #endif
 
 
@@ -1409,8 +1213,6 @@ bool thread_detach_current_thread(void)
 }
 
 
-#if defined(ENABLE_GC_CACAO)
-
 /* threads_suspend_thread ******************************************************
 
    Suspend the passed thread. Execution stops until the thread
@@ -1457,6 +1259,7 @@ bool threads_suspend_thread(threadobject *thread, s4 reason)
 
 *******************************************************************************/
 
+#if defined(ENABLE_GC_CACAO)
 void threads_suspend_ack(u1* pc, u1* sp)
 {
        threadobject *thread;
@@ -1506,6 +1309,7 @@ void threads_suspend_ack(u1* pc, u1* sp)
        /* release the suspendmutex */
        mutex_unlock(&(thread->suspendmutex));
 }
+#endif
 
 
 /* threads_resume_thread *******************************************************
@@ -1514,6 +1318,7 @@ void threads_suspend_ack(u1* pc, u1* sp)
 
 *******************************************************************************/
 
+#if defined(ENABLE_GC_CACAO)
 bool threads_resume_thread(threadobject *thread)
 {
        /* acquire the suspendmutex */
@@ -1535,9 +1340,9 @@ bool threads_resume_thread(threadobject *thread)
 
        return true;
 }
-
 #endif
 
+
 /* threads_join_all_threads ****************************************************
 
    Join all non-daemon threads.
index 0bd495dda76fca6e704bfb49b7d2b611f05bb47b..307562094284b253b0e59536b9fa2513690d0a87 100644 (file)
@@ -55,7 +55,6 @@
 # include "native/include/java_lang_VMThread.h"
 #endif
 
-#include "threads/critical.h"
 #include "threads/lock-common.h"
 #include "threads/threadlist.h"
 #include "threads/thread.h"
index e30d7d601b5702a0ebdfc0c2eb1ca79ce97a1331..aa899028330e1475bdf04ad1a8b48368977af8e1 100644 (file)
@@ -2709,9 +2709,6 @@ gen_method:
                                        superindex = super->index;
                                }
 
-                               if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                                       CODEGEN_CRITICAL_SECTION_NEW;
-
                                s1 = emit_load_s1(jd, iptr, REG_ITMP1);
 
                                /* if class is not resolved, check which code to call */
@@ -2783,8 +2780,6 @@ gen_method:
                                        M_ALD(REG_ITMP2, s1, OFFSET(java_object_t, vftbl));
                                        M_ALD(REG_ITMP3, REG_PV, disp);
 
-                                       CODEGEN_CRITICAL_SECTION_START;
-
                                        M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                        /*                              if (s1 != REG_ITMP1) { */
                                        /*                                      M_ILD(REG_ITMP1, REG_ITMP3, OFFSET(vftbl_t, baseval)); */
@@ -2800,8 +2795,6 @@ gen_method:
                                        M_ALD(REG_ITMP3, REG_PV, disp);
                                        M_ILD(REG_ITMP3, REG_ITMP3, OFFSET(vftbl_t, diffval));
 
-                                       CODEGEN_CRITICAL_SECTION_END;
-
                                        /*                              } */
                                        M_CMPULE(REG_ITMP2, REG_ITMP3, REG_ITMP3);
                                        emit_classcast_check(cd, iptr, BRANCH_EQ, REG_ITMP3, s1);
@@ -2869,9 +2862,6 @@ gen_method:
                                supervftbl = super->vftbl;
                        }
 
-                       if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                               CODEGEN_CRITICAL_SECTION_NEW;
-
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP2);
 
@@ -2954,14 +2944,10 @@ gen_method:
                                M_ALD(REG_ITMP1, s1, OFFSET(java_object_t, vftbl));
                                M_ALD(REG_ITMP2, REG_PV, disp);
 
-                               CODEGEN_CRITICAL_SECTION_START;
-
                                M_ILD(REG_ITMP1, REG_ITMP1, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
 
-                               CODEGEN_CRITICAL_SECTION_END;
-
                                M_ISUB(REG_ITMP1, REG_ITMP3, REG_ITMP1);
                                M_CMPULE(REG_ITMP1, REG_ITMP2, d);
 
index 10deba916971329c656e275b2405e1054bcedd78..8aa259a9a8fed8d20c045c03599376ae7ce847e0 100644 (file)
@@ -1,9 +1,7 @@
-/* src/vm/jit/alpha/freebsd/md.c - machine dependent Alpha FreeBSD functions
+/* src/vm/jit/alpha/freebsd/md-os.c - machine dependent Alpha FreeBSD functions
 
-   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
+   Copyright (C) 1996-2005, 2006, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Contact: cacao@cacaojvm.org
-
-   Authors: Christian Thalinger
-
-   Changes:
-
 */
 
 
@@ -95,22 +87,6 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
 }
 
 
-#if defined(ENABLE_THREADS)
-void thread_restartcriticalsection(ucontext_t *_uc)
-{
-       mcontext_t *_mc;
-       void       *critical;
-
-       _mc = &_uc->uc_mcontext;
-
-       critical = critical_find_restart_point((void *) _mc->mc_regs[R_PC]);
-
-       if (critical)
-               _mc->mc_regs[R_PC] = (ptrint) critical;
-}
-#endif
-
-
 /*
  * 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
index afe391d11b2b86b0abc946d0a0ff509ff7ff80e1..daad38ff3b8dea6e1c63f92628b2344c99322060 100644 (file)
@@ -275,32 +275,6 @@ void md_executionstate_write(executionstate_t *es, void *context)
 }
 
 
-/* md_critical_section_restart *************************************************
-
-   Search the critical sections tree for a matching section and set
-   the PC to the restart point, if necessary.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void md_critical_section_restart(ucontext_t *_uc)
-{
-       mcontext_t *_mc;
-       u1         *pc;
-       u1         *npc;
-
-       _mc = &_uc->uc_mcontext;
-
-       pc = (u1 *) _mc->sc_pc;
-
-       npc = critical_find_restart_point(pc);
-
-       if (npc != NULL)
-               _mc->sc_pc = (ptrint) npc;
-}
-#endif
-
-
 /*
  * 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
index 00a37a24206fb919ebe14e382dd6f2a6148977ae..387822a685811141e507b66cd7882461e3e109d6 100644 (file)
@@ -2402,9 +2402,6 @@ bool codegen_emit(jitdata *jd)
                                superindex = super->index;
                        }
 
-                               if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                                       CODEGEN_CRITICAL_SECTION_NEW;
-
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
 
                        /* if class is not resolved, check which code to call */
@@ -2508,16 +2505,12 @@ bool codegen_emit(jitdata *jd)
                                M_LDR_INTERN(REG_ITMP2, s1, OFFSET(java_object_t, vftbl));
                                M_DSEG_LOAD(REG_ITMP3, disp);
 
-                               CODEGEN_CRITICAL_SECTION_START;
-
                                M_LDR_INTERN(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                M_LDR_INTERN(REG_ITMP3, REG_ITMP3, OFFSET(vftbl_t, baseval));
                                M_SUB(REG_ITMP2, REG_ITMP2, REG_ITMP3);
                                M_DSEG_LOAD(REG_ITMP3, disp);
                                M_LDR_INTERN(REG_ITMP3, REG_ITMP3, OFFSET(vftbl_t, diffval));
 
-                               CODEGEN_CRITICAL_SECTION_END;
-
                                M_CMP(REG_ITMP2, REG_ITMP3);
                                emit_classcast_check(cd, iptr, BRANCH_UGT, 0, s1);
 
@@ -2582,9 +2575,6 @@ bool codegen_emit(jitdata *jd)
                                superindex = super->index;
                        }
 
-                       if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                               CODEGEN_CRITICAL_SECTION_NEW;
-
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP2);
 
@@ -2707,14 +2697,10 @@ bool codegen_emit(jitdata *jd)
                                M_LDR_INTERN(REG_ITMP1, s1, OFFSET(java_object_t, vftbl));
                                M_DSEG_LOAD(REG_ITMP2, disp);
 
-                               CODEGEN_CRITICAL_SECTION_START;
-
                                M_LDR_INTERN(REG_ITMP1, REG_ITMP1, OFFSET(vftbl_t, baseval));
                                M_LDR_INTERN(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                M_LDR_INTERN(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
 
-                               CODEGEN_CRITICAL_SECTION_END;
-
                                M_SUB(REG_ITMP1, REG_ITMP1, REG_ITMP3);
                                M_CMP(REG_ITMP1, REG_ITMP2);
                                /* If d == REG_ITMP2, then it's destroyed */
index 37aaabcdc46f8a151b9b4a7624faf3e6873825fd..a9e3e9a9cf67ac723c9421667c577c349d49e294 100644 (file)
@@ -309,32 +309,6 @@ void md_executionstate_write(executionstate_t *es, void *context)
 }
 
 
-/* md_critical_section_restart *************************************************
-
-   Search the critical sections tree for a matching section and set
-   the PC to the restart point, if necessary.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void md_critical_section_restart(ucontext_t *_uc)
-{
-       scontext_t *_sc;
-       u1         *pc;
-       u1         *npc;
-
-       _sc = &_uc->uc_mcontext;
-
-       pc = (u1 *) _sc->arm_pc;
-
-       npc = critical_find_restart_point(pc);
-
-       if (npc != NULL)
-               _sc->arm_pc = (ptrint) npc;
-}
-#endif
-
-
 /*
  * 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
index 8dea3aacc2030445d82d8c60fa3ee7e9cf8b4ec9..ba688b10f7c90b0d0d4262e995ec6d0e36a474b5 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/asmpart.h - prototypes for machine specfic 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
+   Copyright (C) 1996-2005, 2006, 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
 
 #include "vm/types.h"
 
-#if defined(ENABLE_THREADS)
-# include "threads/critical.h"
-#endif
-
 #include "vm/global.h"
 #include "vm/vm.h"
 
index 045a44c86123ca17d057f1fd734cfc1e887ac31a..5c2f9480cda2a95c4e7e3b36d9fd87952e5939bf 100644 (file)
@@ -187,7 +187,6 @@ void codegen_setup(jitdata *jd)
 #endif
 
        cd->brancheslabel  = list_create_dump(OFFSET(branch_label_ref_t, linkage));
-       cd->listcritical   = list_create_dump(OFFSET(critical_section_ref_t, linkage));
        cd->linenumbers    = list_create_dump(OFFSET(linenumbertable_list_entry_t, linkage));
 }
 
@@ -229,7 +228,6 @@ static void codegen_reset(jitdata *jd)
 #endif
 
        cd->brancheslabel   = list_create_dump(OFFSET(branch_label_ref_t, linkage));
-       cd->listcritical    = list_create_dump(OFFSET(critical_section_ref_t, linkage));
        cd->linenumbers     = list_create_dump(OFFSET(linenumbertable_list_entry_t, linkage));
        
        /* We need to clear the mpc and the branch references from all
@@ -497,164 +495,6 @@ void codegen_branch_label_add(codegendata *cd, s4 label, s4 condition, s4 reg, u
 }
 
 
-/* codegen_critical_section_new ************************************************
-
-   Allocates a new critical-section reference and adds it to the
-   critical-section list.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void codegen_critical_section_new(codegendata *cd)
-{
-       list_t                 *l;
-       critical_section_ref_t *csr;
-       s4                      mpc;
-
-       /* Get the critical section list. */
-
-       l = cd->listcritical;
-       
-       /* calculate the current mpc */
-
-       mpc = cd->mcodeptr - cd->mcodebase;
-
-       csr = DNEW(critical_section_ref_t);
-
-       /* We only can set restart right now, as start and end are set by
-          the following, corresponding functions. */
-
-       csr->start   = -1;
-       csr->end     = -1;
-       csr->restart = mpc;
-
-       /* Add the branch to the list. */
-
-       list_add_last(l, csr);
-}
-#endif
-
-
-/* codegen_critical_section_start **********************************************
-
-   Set the start-point of the current critical section (which is the
-   last element of the list).
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void codegen_critical_section_start(codegendata *cd)
-{
-       list_t                 *l;
-       critical_section_ref_t *csr;
-       s4                      mpc;
-
-       /* Get the critical section list. */
-
-       l = cd->listcritical;
-       
-       /* calculate the current mpc */
-
-       mpc = cd->mcodeptr - cd->mcodebase;
-
-       /* Get the current critical section. */
-
-       csr = list_last(l);
-
-       /* set the start point */
-
-       assert(csr->start == -1);
-
-       csr->start = mpc;
-}
-#endif
-
-
-/* codegen_critical_section_end ************************************************
-
-   Set the end-point of the current critical section (which is the
-   last element of the list).
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void codegen_critical_section_end(codegendata *cd)
-{
-       list_t                 *l;
-       critical_section_ref_t *csr;
-       s4                      mpc;
-
-       /* Get the critical section list. */
-
-       l = cd->listcritical;
-       
-       /* calculate the current mpc */
-
-       mpc = cd->mcodeptr - cd->mcodebase;
-
-       /* Get the current critical section. */
-
-       csr = list_last(l);
-
-       /* set the end point */
-
-       assert(csr->end == -1);
-
-       csr->end = mpc;
-}
-#endif
-
-
-/* codegen_critical_section_finish *********************************************
-
-   Finish the critical sections, create the critical section nodes for
-   the AVL tree and insert them into the tree.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-static void codegen_critical_section_finish(jitdata *jd)
-{
-       codeinfo    *code;
-       codegendata *cd;
-       list_t                  *l;
-       critical_section_ref_t  *csr;
-       critical_section_node_t *csn;
-
-       /* get required compiler data */
-
-       code = jd->code;
-       cd   = jd->cd;
-
-       /* Get the critical section list. */
-
-       l = cd->listcritical;
-
-       /* iterate over all critical sections */
-
-       for (csr = list_first(l); csr != NULL; csr = list_next(l, csr)) {
-               /* check if all points are set */
-
-               assert(csr->start   != -1);
-               assert(csr->end     != -1);
-               assert(csr->restart != -1);
-
-               /* allocate tree node */
-
-               csn = NEW(critical_section_node_t);
-
-               csn->start   = code->entrypoint + csr->start;
-               csn->end     = code->entrypoint + csr->end;
-               csn->restart = code->entrypoint + csr->restart;
-
-               /* insert into the tree */
-
-               critical_section_register(csn);
-       }
-}
-#endif
-
-
 /* codegen_set_replacement_point_notrap ****************************************
 
    Record the position of a non-trappable replacement point.
@@ -861,12 +701,6 @@ void codegen_finish(jitdata *jd)
        dseg_resolve_datareferences(jd);
 #endif
 
-#if defined(ENABLE_THREADS)
-       /* create cirtical sections */
-
-       codegen_critical_section_finish(jd);
-#endif
-
        /* flush the instruction and data caches */
 
        md_cacheflush(code->mcode, code->mcodelength);
index cf1ad7d771a3f807472fb32185c86a5223dc175d..c85c8d537de5849372c33613fc81ae07dffd5ffb 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/codegen-common.h - architecture independent code generator stuff
 
-   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
+   Copyright (C) 1996-2005, 2006, 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
@@ -33,7 +31,6 @@
 typedef struct codegendata            codegendata;
 typedef struct branchref              branchref;
 typedef struct branch_label_ref_t     branch_label_ref_t;
-typedef struct critical_section_ref_t critical_section_ref_t;
 typedef struct jumpref                jumpref;
 typedef struct dataref                dataref;
 typedef struct exceptionref           exceptionref;
@@ -133,7 +130,6 @@ struct codegendata {
 #endif
 
        list_t         *brancheslabel;
-       list_t         *listcritical;   /* list of critical sections              */
        list_t         *linenumbers;    /* list of line numbers                   */
 
        methodinfo     *method;
@@ -180,16 +176,6 @@ struct branch_label_ref_t {
 };
 
 
-/* critical_section_ref_t *****************************************************/
-
-struct critical_section_ref_t {
-       s4         start;           /* relative offset to method entry-point      */
-       s4         end;
-       s4         restart;
-       listnode_t linkage;
-};
-
-
 /* jumpref ********************************************************************/
 
 struct jumpref {
@@ -291,20 +277,6 @@ java_object_t *codegen_finish_native_call(u1 *currentsp, u1 *pv);
 s4 codegen_reg_of_var(u2 opcode, varinfo *v, s4 tempregnum);
 s4 codegen_reg_of_dst(jitdata *jd, instruction *iptr, s4 tempregnum);
 
-#if defined(ENABLE_THREADS)
-void codegen_critical_section_new(codegendata *cd);
-void codegen_critical_section_start(codegendata *cd);
-void codegen_critical_section_end(codegendata *cd);
-
-# define CODEGEN_CRITICAL_SECTION_NEW      codegen_critical_section_new(cd)
-# define CODEGEN_CRITICAL_SECTION_START    codegen_critical_section_start(cd)
-# define CODEGEN_CRITICAL_SECTION_END      codegen_critical_section_end(cd)
-#else
-# define CODEGEN_CRITICAL_SECTION_NEW      /* no-op */
-# define CODEGEN_CRITICAL_SECTION_START    /* no-op */
-# define CODEGEN_CRITICAL_SECTION_END      /* no-op */
-#endif
-
 #if defined(ENABLE_SSA)
 void codegen_emit_phi_moves(jitdata *jd, basicblock *bptr);
 #endif
index 5123b4b230140158ad270b3b14e9ebf5b36493d2..9b49b4fe67516891b59ff571226c7af7f8d9a586 100644 (file)
@@ -3104,9 +3104,6 @@ gen_method:
                                        supervftbl = super->vftbl;
                                }
                        
-                               if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                                       CODEGEN_CRITICAL_SECTION_NEW;
-
                                s1 = emit_load_s1(jd, iptr, REG_ITMP1);
 
                                /* if class is not resolved, check which code to call */
@@ -3179,8 +3176,6 @@ gen_method:
 
                                        M_MOV_IMM(supervftbl, REG_ITMP3);
 
-                                       CODEGEN_CRITICAL_SECTION_START;
-
                                        M_ILD32(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, baseval));
 
                                        /*                              if (s1 != REG_ITMP1) { */
@@ -3197,8 +3192,6 @@ gen_method:
                                        M_MOV_IMM(supervftbl, REG_ITMP3);
                                        M_ILD(REG_ITMP3, REG_ITMP3, OFFSET(vftbl_t, diffval));
 
-                                       CODEGEN_CRITICAL_SECTION_END;
-
                                        /*                              } */
 
                                        M_CMP(REG_ITMP3, REG_ITMP2);
@@ -3259,9 +3252,6 @@ gen_method:
                                supervftbl = super->vftbl;
                        }
                        
-                       if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                               CODEGEN_CRITICAL_SECTION_NEW;
-
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP2);
 
@@ -3345,14 +3335,10 @@ gen_method:
 
                                M_MOV_IMM(supervftbl, REG_ITMP2);
 
-                               CODEGEN_CRITICAL_SECTION_START;
-
                                M_ILD(REG_ITMP1, REG_ITMP1, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, diffval));
                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, baseval));
 
-                               CODEGEN_CRITICAL_SECTION_END;
-
                                M_ISUB(REG_ITMP2, REG_ITMP1);
                                M_CLR(d);                                 /* may be REG_ITMP2 */
                                M_CMP(REG_ITMP3, REG_ITMP1);
index bd96c8bdd83663a5a93a466901af407ef86cd8f1..d629147551ee05cb1bcebce44fba1949456447c1 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/i386/cygwin/md-os.c - machine dependent i386 Windows functions
 
-   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
+   Copyright (C) 1996-2005, 2006, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Contact: cacao@cacaojvm.org
-
-   Authors: Michael Starzinger
-
-   Changes:
-
 */
 
 
@@ -73,14 +65,6 @@ void md_signal_handler_sigfpe(int sig, siginfo_t *siginfo, void *_p)
 }
 
 
-#if defined(ENABLE_THREADS)
-void thread_restartcriticalsection(ucontext_t *uc)
-{
-       assert(0);
-}
-#endif
-
-
 /*
  * 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
index 344c582052b0be3a0ab01598c742328453285632..26e86b21deb8a55a31a3328bd87a31f3a270235f 100644 (file)
@@ -353,34 +353,6 @@ void md_executionstate_write(executionstate_t *es, void *context)
 }
 
 
-/* md_critical_section_restart *************************************************
-
-   Search the critical sections tree for a matching section and set
-   the PC to the restart point, if necessary.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void thread_restartcriticalsection(ucontext_t *_uc)
-{
-       mcontext_t           _mc;
-       i386_thread_state_t *_ss;
-       u1                  *pc;
-       void                *rpc;
-
-       _mc = _uc->uc_mcontext;
-       _ss = &_mc->__ss;
-
-       pc = (u1 *) _ss->__eip;
-
-       rpc = critical_find_restart_point(pc);
-
-       if (rpc != NULL)
-               _ss->__eip = (ptrint) rpc;
-}
-#endif
-
-
 /*
  * 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
index 4eebf69877da4a0e589657b06a81982089c15989..e9886e392146d53347e66bb08ff0ec7f99857102 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/i386/freebsd/md-os.c - machine dependent i386 FreeBSD functions
 
-   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
+   Copyright (C) 1996-2005, 2006, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Contact: cacao@cacaojvm.org
-
-   Authors: Christian Thalinger
-
-   Changes:
-
 */
 
 
@@ -103,19 +95,6 @@ void md_signal_handler_sigfpe(int sig, siginfo_t *siginfo, void *_p)
 }
 
 
-#if defined(ENABLE_THREADS)
-void thread_restartcriticalsection(ucontext_t *uc)
-{
-       void *critical;
-
-       critical = critical_find_restart_point((void *) uc->uc_mcontext.mc_eip);
-
-       if (critical)
-               uc->uc_mcontext.mc_eip = (ptrint) critical;
-}
-#endif
-
-
 /*
  * 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
index 17630b05143dd0f437031b94877eb7efdf9e2c9b..d445e4798ab28104bddb46508060f89caafbfb55 100644 (file)
@@ -354,32 +354,6 @@ void md_executionstate_write(executionstate_t *es, void *context)
 }
 
 
-/* md_critical_section_restart *************************************************
-
-   Search the critical sections tree for a matching section and set
-   the PC to the restart point, if necessary.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void md_critical_section_restart(ucontext_t *_uc)
-{
-       mcontext_t *_mc;
-       u1         *pc;
-       u1         *npc;
-
-       _mc = &_uc->uc_mcontext;
-
-       pc = (u1 *) _mc->gregs[REG_EIP];
-
-       npc = critical_find_restart_point(pc);
-
-       if (npc != NULL)
-               _mc->gregs[REG_EIP] = (ptrint) npc;
-}
-#endif
-
-
 /*
  * 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
index 41bd7c7f7f83e459c527546e81fe368a01bbdf8b..f62c9b734661bffb671cf80ed38e188bc847718c 100644 (file)
@@ -1994,9 +1994,6 @@ nowperformreturn:
                                superindex = super->index;
                        }
                        
-                       if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                               CODEGEN_CRITICAL_SECTION_NEW;
-
                        s1 = emit_load_s1(jd, iptr, REG_ATMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP2);
 
@@ -2060,14 +2057,10 @@ nowperformreturn:
 
                                M_ALD(REG_ATMP1, s1, OFFSET(java_object_t, vftbl));
 
-                               CODEGEN_CRITICAL_SECTION_START;
-
                                M_ILD(REG_ITMP1, REG_ATMP1, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP3, REG_ATMP2, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP2, REG_ATMP2, OFFSET(vftbl_t, diffval));
 
-                               CODEGEN_CRITICAL_SECTION_END;
-
                                M_ISUB(REG_ITMP3, REG_ITMP1);
                                M_ICMP(REG_ITMP2, REG_ITMP1);
                                M_BHI(4);
@@ -2119,9 +2112,6 @@ nowperformreturn:
                                        superindex = super->index;
                                }
 
-                               if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                                       CODEGEN_CRITICAL_SECTION_NEW;
-
                                s1 = emit_load_s1(jd, iptr, REG_ATMP1);
                                assert(VAROP(iptr->s1)->type == TYPE_ADR);
 
@@ -2181,14 +2171,10 @@ nowperformreturn:
 
                                        M_ALD(REG_ATMP2, s1, OFFSET(java_object_t, vftbl));
 
-                                       CODEGEN_CRITICAL_SECTION_START;
-
                                        M_ILD(REG_ITMP3, REG_ATMP2, OFFSET(vftbl_t, baseval));  /* REG_ITMP3 == sub->vftbl->baseval */
                                        M_ILD(REG_ITMP1, REG_ATMP3, OFFSET(vftbl_t, baseval));
                                        M_ILD(REG_ITMP2, REG_ATMP3, OFFSET(vftbl_t, diffval));
 
-                                       CODEGEN_CRITICAL_SECTION_END;
-
                                        M_ISUB(REG_ITMP1, REG_ITMP3);
                                        M_ICMP(REG_ITMP2, REG_ITMP3);   /* XXX was CMPU */
 
index cbb334513e2a6c18c17280cd72c742d045bc5a9b..b51b8d675124741a4287d75efb51c051860c57cc 100644 (file)
@@ -3236,9 +3236,6 @@ gen_method:
                                        superindex = super->index;
                                }
                        
-                               if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                                       CODEGEN_CRITICAL_SECTION_NEW;
-
                                s1 = emit_load_s1(jd, iptr, REG_ITMP1);
 
                                /* if class is not resolved, check which code to call */
@@ -3309,8 +3306,6 @@ gen_method:
                                        M_ALD(REG_ITMP2, s1, OFFSET(java_object_t, vftbl));
                                        M_ALD(REG_ITMP3, REG_PV, disp);
 
-                                       CODEGEN_CRITICAL_SECTION_START;
-
                                        M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                        /*                              if (s1 != REG_ITMP1) { */
                                        /*                                      M_ILD(REG_ITMP1, REG_ITMP3, OFFSET(vftbl_t, baseval)); */
@@ -3325,8 +3320,6 @@ gen_method:
                                        M_ALD(REG_ITMP3, REG_PV, disp);
                                        M_ILD(REG_ITMP3, REG_ITMP3, OFFSET(vftbl_t, diffval));
 
-                                       CODEGEN_CRITICAL_SECTION_END;
-
                                        /*                              } */
                                        M_CMPULT(REG_ITMP3, REG_ITMP2, REG_ITMP3);
                                        emit_classcast_check(cd, iptr, ICMD_IFNE, REG_ITMP3, s1);
@@ -3391,9 +3384,6 @@ gen_method:
                                superindex = super->index;
                        }
                        
-                       if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                               CODEGEN_CRITICAL_SECTION_NEW;
-
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP2);
 
@@ -3471,14 +3461,10 @@ gen_method:
                                M_ALD(REG_ITMP1, s1, OFFSET(java_object_t, vftbl));
                                M_ALD(REG_ITMP2, REG_PV, disp);
 
-                               CODEGEN_CRITICAL_SECTION_START;
-
                                M_ILD(REG_ITMP1, REG_ITMP1, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
 
-                               CODEGEN_CRITICAL_SECTION_END;
-
                                M_ISUB(REG_ITMP1, REG_ITMP3, REG_ITMP1); 
                                M_CMPULT(REG_ITMP2, REG_ITMP1, d);
                                M_XOR_IMM(d, 1, d);
index d14fb611e8f98bcd8f8dfd66b2b7c1327cf1f2f3..f2bea4b9bafc49bdc22bc5144b9b693edd4208ca 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/mips/irix/md-os.c - machine dependent MIPS IRIX 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
+   Copyright (C) 1996-2005, 2006, 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
@@ -145,34 +143,6 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
 }
 
 
-/* md_critical_section_restart *************************************************
-
-   Search the critical sections tree for a matching section and set
-   the PC to the restart point, if necessary.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void md_critical_section_restart(ucontext_t *_uc)
-{
-       mcontext_t *_mc;
-       u1         *pc;
-       u1         *npc;
-
-       _mc = &_uc->uc_mcontext;
-
-       pc = (u1 *) _mc->gregs[CTX_EPC];
-
-       npc = critical_find_restart_point(pc);
-
-       if (npc != NULL) {
-               log_println("md_critical_section_restart: pc=%p, npc=%p", pc, npc);
-               _mc->gregs[CTX_EPC] = (ptrint) npc;
-       }
-}
-#endif
-
-
 /*
  * 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
index aebc1666aba9a0d16f8d1db30cecc62d0b8d3feb..ff49c55deb62d5b26d2d7794a3fbce83e60d1144 100644 (file)
@@ -354,41 +354,6 @@ void md_executionstate_write(executionstate_t* es, void* context)
 }
 
 
-/* md_critical_section_restart *************************************************
-
-   Search the critical sections tree for a matching section and set
-   the PC to the restart point, if necessary.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void md_critical_section_restart(ucontext_t *_uc)
-{
-       mcontext_t *_mc;
-       u1         *pc;
-       u1         *npc;
-
-       _mc = &_uc->uc_mcontext;
-
-#if defined(__UCLIBC__)
-       pc = (u1 *) (ptrint) _mc->gpregs[CTX_EPC];
-#else
-       pc = (u1 *) (ptrint) _mc->pc;
-#endif
-
-       npc = critical_find_restart_point(pc);
-
-       if (npc != NULL) {
-#if defined(__UCLIBC__)
-               _mc->gpregs[CTX_EPC] = (ptrint) npc;
-#else
-               _mc->pc              = (ptrint) npc;
-#endif
-       }
-}
-#endif
-
-
 /*
  * 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
index a28d2d1bcd6ef71f644f8e0020b63d177c461240..c5f89b3a12d47bc247e0d20fa8f509fad97c0907 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/mips/uclinux/md-os.c - machine dependent MIPS uClinux functions
 
-   Copyright (C) 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
+   Copyright (C) 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
@@ -71,21 +69,6 @@ void md_signal_handler_sigusr2(int sig, siginfo_t *siginfo, void *_p)
 }
 
 
-/* md_critical_section_restart *************************************************
-
-   Search the critical sections tree for a matching section and set
-   the PC to the restart point, if necessary.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void md_critical_section_restart(ucontext_t *_uc)
-{
-       vm_abort("md_critical_section_restart: IMPLEMENT ME!");
-}
-#endif
-
-
 /*
  * 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
index 378a7279e180dbdd2ebf1dcc2dcb4894680a22dc..7adbc03b55e8484fbae6d4cecf80d1f15f497116 100644 (file)
@@ -2439,9 +2439,6 @@ gen_method:
                                        superindex = super->index;
                                }
 
-                               if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                                       CODEGEN_CRITICAL_SECTION_NEW;
-
                                s1 = emit_load_s1(jd, iptr, REG_ITMP1);
 
                                /* if class is not resolved, check which code to call */
@@ -2514,16 +2511,12 @@ gen_method:
 
                                        M_ALD(REG_ITMP2, s1, OFFSET(java_object_t, vftbl));
 
-                                       CODEGEN_CRITICAL_SECTION_START;
-
                                        M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                        M_ALD(REG_ITMP2, REG_PV, disp);
                                        if (s1 != REG_ITMP1) {
                                                M_ILD(REG_ITMP1, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
 
-                                               CODEGEN_CRITICAL_SECTION_END;
-
                                                M_ISUB(REG_ITMP3, REG_ITMP1, REG_ITMP3);
                                        }
                                        else {
@@ -2531,8 +2524,6 @@ gen_method:
                                                M_ISUB(REG_ITMP3, REG_ITMP2, REG_ITMP3);
                                                M_ALD(REG_ITMP2, REG_PV, disp);
                                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
-
-                                               CODEGEN_CRITICAL_SECTION_END;
                                        }
                                        M_CMPU(REG_ITMP3, REG_ITMP2);
                                        emit_classcast_check(cd, iptr, BRANCH_GT, REG_ITMP3, s1);
@@ -2594,9 +2585,6 @@ gen_method:
                                superindex = super->index;
                        }
                        
-                       if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                               CODEGEN_CRITICAL_SECTION_NEW;
-
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
 
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP2);
@@ -2675,14 +2663,10 @@ gen_method:
                                M_ALD(REG_ITMP1, s1, OFFSET(java_object_t, vftbl));
                                M_ALD(REG_ITMP2, REG_PV, disp);
 
-                               CODEGEN_CRITICAL_SECTION_START;
-
                                M_ILD(REG_ITMP1, REG_ITMP1, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
 
-                               CODEGEN_CRITICAL_SECTION_END;
-
                                M_ISUB(REG_ITMP1, REG_ITMP3, REG_ITMP1);
                                M_CMPU(REG_ITMP1, REG_ITMP2);
                                M_CLR(d);
index 44b0f73d81afcd986dd97a9e6ec9ba96ae051287..b5fd3498a90697d3aa2e802539ebe407fe862549 100644 (file)
@@ -251,34 +251,6 @@ void md_signal_handler_sigusr2(int sig, siginfo_t *siginfo, void *_p)
 }
 
 
-/* md_critical_section_restart *************************************************
-
-   Search the critical sections tree for a matching section and set
-   the PC to the restart point, if necessary.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void md_critical_section_restart(ucontext_t *_uc)
-{
-       mcontext_t          _mc;
-       ppc_thread_state_t *_ss;
-       u1                 *pc;
-       u1                 *npc;
-
-       _mc = _uc->uc_mcontext;
-       _ss = &_mc->ss;
-
-       pc = (u1 *) _ss->srr0;
-
-       npc = critical_find_restart_point(pc);
-
-       if (npc != NULL)
-               _ss->srr0 = (ptrint) npc;
-}
-#endif
-
-
 /*
  * 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
index beab97d872476f00447b035adfc4ce09943965b7..d56123600db2948fe3902ca1974c3ef0688c7b46 100644 (file)
@@ -380,39 +380,6 @@ void md_executionstate_write(executionstate_t *es, void *context)
 }
 
 
-/* md_critical_section_restart *************************************************
-
-   Search the critical sections tree for a matching section and set
-   the PC to the restart point, if necessary.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void md_critical_section_restart(ucontext_t *_uc)
-{
-       mcontext_t    *_mc;
-       unsigned long *_gregs;
-       u1            *pc;
-       u1            *npc;
-
-#if defined(__UCLIBC__)
-       _mc    = &(_uc->uc_mcontext);
-       _gregs = _mc->regs->gpr;
-#else
-       _mc    = _uc->uc_mcontext.uc_regs;
-       _gregs = _mc->gregs;
-#endif
-
-       pc = (u1 *) _gregs[PT_NIP];
-
-       npc = critical_find_restart_point(pc);
-
-       if (npc != NULL)
-               _gregs[PT_NIP] = (ptrint) npc;
-}
-#endif
-
-
 /*
  * 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
index 6955088303b909764671e2cf0d4c18881b7d6c73..e28f9a3f96f3a3f17ef2d2e5ba48297ff4c4f752 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/powerpc/netbsd/md-os.c - machine dependent PowerPC NetBSD functions
 
-   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
+   Copyright (C) 1996-2005, 2006, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Contact: cacao@cacaojvm.org
-
-   Authors: Christian Thalinger
-
-   Changes:
-
 */
 
 
@@ -92,14 +84,6 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
 }
 
 
-#if defined(ENABLE_THREADS)
-void thread_restartcriticalsection(ucontext_t *uc)
-{
-       /* XXX set pc to restart address */
-}
-#endif
-
-
 /*
  * 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
index f9cd0fbe63068332dbdb078ed0be244ac6659532..be082d70c49bf502eccad0ffd882e6ebecb2483a 100644 (file)
@@ -2204,10 +2204,6 @@ gen_method:
                                        superindex = super->index;
                                }
                
-                               if ((super == NULL) || !(super->flags & ACC_INTERFACE)) {
-                                       CODEGEN_CRITICAL_SECTION_NEW;
-                               }
-
                                s1 = emit_load_s1(jd, iptr, REG_ITMP1);
 
                                /* if class is not resolved, check which code to call */
@@ -2276,16 +2272,12 @@ gen_method:
 
                                        M_ALD(REG_ITMP2, s1, OFFSET(java_object_t, vftbl));
 
-                                       CODEGEN_CRITICAL_SECTION_START;
-
                                        M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                        M_ALD(REG_ITMP2, REG_PV, disp);
                                        if (s1 != REG_ITMP1) {
                                                M_ILD(REG_ITMP1, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
 
-                                               CODEGEN_CRITICAL_SECTION_END;
-
                                                M_SUB(REG_ITMP3, REG_ITMP1, REG_ITMP3);
                                                M_EXTSW(REG_ITMP3, REG_ITMP3);
                                        } else {
@@ -2294,9 +2286,6 @@ gen_method:
                                                M_EXTSW(REG_ITMP3, REG_ITMP3);
                                                M_ALD(REG_ITMP2, REG_PV, disp);
                                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
-
-                                               CODEGEN_CRITICAL_SECTION_END;
-
                                        }
                                        M_CMPU(REG_ITMP3, REG_ITMP2);
                                        emit_classcast_check(cd, iptr, BRANCH_GT, REG_ITMP3, s1);
@@ -2373,10 +2362,6 @@ gen_method:
                                superindex = super->index;
                        }
                        
-                       if ((super == NULL) || !(super->flags & ACC_INTERFACE)) {
-                               CODEGEN_CRITICAL_SECTION_NEW;
-                       }
-
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP2);
                        if (s1 == d) {
@@ -2453,14 +2438,10 @@ gen_method:
                                M_ALD(REG_ITMP1, s1, OFFSET(java_object_t, vftbl));
                                M_ALD(REG_ITMP2, REG_PV, disp);
 
-                               CODEGEN_CRITICAL_SECTION_START;
-
                                M_ILD(REG_ITMP1, REG_ITMP1, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
 
-                               CODEGEN_CRITICAL_SECTION_END;
-
                                M_SUB(REG_ITMP1, REG_ITMP3, REG_ITMP1);
                                M_EXTSW(REG_ITMP1, REG_ITMP1);
                                M_CMPU(REG_ITMP1, REG_ITMP2);
index 8b292f1adb037876f59c8f3757c23618a66f88c6..d978a70e4d45224e01d61056321422e89e31749c 100644 (file)
@@ -179,32 +179,6 @@ void md_signal_handler_sigusr2(int sig, siginfo_t *siginfo, void *_p)
 #endif
 
 
-/* md_critical_section_restart *************************************************
-
-   Search the critical sections tree for a matching section and set
-   the PC to the restart point, if necessary.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void md_critical_section_restart(ucontext_t *_uc)
-{
-       mcontext_t *_mc;
-       u1         *pc;
-       u1         *npc;
-
-       _mc = &(_uc->uc_mcontext);
-
-       pc = (u1 *) _mc->gp_regs[PT_NIP];
-
-       npc = critical_find_restart_point(pc);
-
-       if (npc != NULL)
-               _mc->gp_regs[PT_NIP] = (ptrint) npc;
-}
-#endif
-
-
 /*
  * 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
index 37de069008202e107531539eb15bcc3f068cf0a7..4392759b995082d91e35db80c35d18d2c37cebda 100644 (file)
@@ -3003,9 +3003,6 @@ gen_method:
                                        supervftbl = super->vftbl;
                                }
 
-                               if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                                       CODEGEN_CRITICAL_SECTION_NEW;
-
                                s1 = emit_load_s1(jd, iptr, REG_ITMP1);
 
                                /* if class is not resolved, check which code to call */
@@ -3083,8 +3080,6 @@ gen_method:
                                        }
 
 #if 1
-                                       CODEGEN_CRITICAL_SECTION_START;
-
                                        /* REG_ITMP3 := baseval(s1) */
                                        M_ALD(REG_ITMP2, s1, OFFSET(java_object_t, vftbl));
                                        M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, baseval));
@@ -3100,8 +3095,6 @@ gen_method:
                                        M_ALD_DSEG(REG_ITMP2, disp);
                                        M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
 
-                                       CODEGEN_CRITICAL_SECTION_END;
-
                                        M_CMPU(REG_ITMP3, REG_ITMP2); /* Unsigned compare */
 
                                        /* M_CMPULE(REG_ITMP2, REG_ITMP3, REG_ITMP3); itmp3 = (itmp2 <= itmp3) */
@@ -3111,16 +3104,12 @@ gen_method:
                                        M_ALD(REG_ITMP2, s1, OFFSET(java_object_t, vftbl));
                                        M_ALD_DSEG(REG_ITMP3, disp);
 
-                                       CODEGEN_CRITICAL_SECTION_START;
-
                                        M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                        M_ILD(REG_ITMP3, REG_ITMP3, OFFSET(vftbl_t, baseval));
                                        M_ISUB(REG_ITMP3, REG_ITMP2);
                                        M_ALD_DSEG(REG_ITMP3, disp);
                                        M_ILD(REG_ITMP3, REG_ITMP3, OFFSET(vftbl_t, diffval));
 
-                                       CODEGEN_CRITICAL_SECTION_END;
-                                       
                                        M_CMPU(REG_ITMP2, REG_ITMP3); /* Unsigned compare */
                                        /* M_CMPULE(REG_ITMP2, REG_ITMP3, REG_ITMP3); itmp3 = (itmp2 <= itmp3) */
                                        /* M_BEQZ(REG_ITMP3, 0); branch if (! itmp) -> branch if > */
@@ -3223,9 +3212,6 @@ gen_method:
 #                      define LABEL_EXIT_INTERFACE_DONE BRANCH_LABEL_5
 #                      define LABEL_EXIT_CLASS_NULL BRANCH_LABEL_6
 
-                       if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                               CODEGEN_CRITICAL_SECTION_NEW;
-
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP2);
                        if (s1 == d) {
@@ -3327,14 +3313,10 @@ gen_method:
                                M_ALD(REG_ITMP1, s1, OFFSET(java_object_t, vftbl));
                                M_ALD_DSEG(REG_ITMP2, disp);
 
-                               CODEGEN_CRITICAL_SECTION_START;
-
                                M_ILD(REG_ITMP1, REG_ITMP1, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
 
-                               CODEGEN_CRITICAL_SECTION_END;
-
                                M_ISUB(REG_ITMP3, REG_ITMP1); /* itmp1 :=  itmp1 (sub.baseval) - itmp3 (super.baseval) */
 
                                M_CMPU(REG_ITMP1, REG_ITMP2); /* d := (uint)REG_ITMP1 <= (uint)REG_ITMP2 */
index 3959f0a91b87a2398462fc32b7da77c4c8187516..b21bbb87190bebee9e8eeb6eb98d1f99a09e7f3d 100644 (file)
@@ -412,27 +412,6 @@ void md_executionstate_write(executionstate_t* es, void* context)
 }
 
 
-#if defined(ENABLE_THREADS)
-void md_critical_section_restart(ucontext_t *_uc)
-{
-       mcontext_t *_mc;
-       u1         *pc;
-       void       *npc;
-
-       _mc = &_uc->uc_mcontext;
-
-       pc = (u1 *)_mc->psw.addr;
-
-       npc = critical_find_restart_point(pc);
-
-       if (npc != NULL) {
-               log_println("%s: pc=%p, npc=%p", __FUNCTION__, pc, npc);
-               _mc->psw.addr = (ptrint) npc;
-       }
-}
-#endif
-
-
 /* md_jit_method_patch_address *************************************************
 
    Gets the patch address of the currently compiled method. The offset
index d13339a8a8dc63c5d024de7e0d27b71d2f0ffc24..f753e04bddb1b296948ac8cf7daf13f07b25ca76 100644 (file)
@@ -2671,9 +2671,6 @@ gen_method:
                                        superindex = super->index;
                                }
 
-                               if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                                       CODEGEN_CRITICAL_SECTION_NEW;
-
                                s1 = emit_load_s1(jd, iptr, REG_ITMP1);
 
                                /* if class is not resolved, check which code to call */
@@ -2744,16 +2741,12 @@ gen_method:
                                        M_ALD(REG_ITMP2, s1, OFFSET(java_object_t, vftbl));
                                        M_ALD(REG_ITMP3, REG_PV, disp);
                                        
-                                       CODEGEN_CRITICAL_SECTION_START;
-
                                        M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                        M_ILD(REG_ITMP3, REG_ITMP3, OFFSET(vftbl_t, baseval));
                                        M_SUB(REG_ITMP2, REG_ITMP3, REG_ITMP2);
                                        M_ALD(REG_ITMP3, REG_PV, disp);
                                        M_ILD(REG_ITMP3, REG_ITMP3, OFFSET(vftbl_t, diffval));
 
-                                       CODEGEN_CRITICAL_SECTION_END;
-
                                        /*                              } */
                                        M_CMP(REG_ITMP3, REG_ITMP2);
                                        emit_classcast_check(cd, iptr, BRANCH_ULT, REG_ITMP3, s1);
@@ -2836,9 +2829,6 @@ gen_method:
                                supervftbl = super->vftbl;
                        }
 
-                       if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                               CODEGEN_CRITICAL_SECTION_NEW;
-
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP2);
                        if (s1 == d) {
@@ -2914,14 +2904,10 @@ gen_method:
                                M_ALD(REG_ITMP1, s1, OFFSET(java_object_t, vftbl));
                                M_ALD(REG_ITMP2, REG_PV, disp);
 
-                               CODEGEN_CRITICAL_SECTION_START;
-
                                M_ILD(REG_ITMP1, REG_ITMP1, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
 
-                               CODEGEN_CRITICAL_SECTION_END;
-
                                M_SUB(REG_ITMP1, REG_ITMP3, REG_ITMP1);
                                M_CMP(REG_ITMP1, REG_ITMP2);
                                M_XCMOVULE_IMM(1, d);
index 1144594771951d8f44736215ff77135dd490bdd8..815308bd6b2acaf24bcb22208ac8613dd77a1201 100644 (file)
@@ -176,40 +176,6 @@ void md_icacheflush(u1 *addr, s4 nbytes)
        }
 }
 
-#if defined(ENABLE_THREADS)
-/* md_critical_section_restart ************************************************
-   Search the critical sections tree for a matching section and set
-   the NPC to the restart point, if necessary.
-
-   Reads PC and modifies NPC.
-
-******************************************************************************/
-
-void md_critical_section_restart(ucontext_t *_uc)
-{
-       /* mcontext_t *_mc; */
-       sigcontext *ctx;
-       u1         *pc;
-       u1         *npc;
-
-       printf("ignoring md_critical_section_restart\n");
-       return;
-
-       /* again, we are getting sigcontext instead of ucontext */
-       ctx = (sigcontext *) _uc;
-       
-       pc = (u1 *) ctx->sigc_regs.tpc;
-
-       npc = critical_find_restart_point(pc);
-
-       if (npc != NULL) {
-               log_println("md_critical_section_restart: pc=%p, npc=%p", pc, npc);
-               ctx->sigc_regs.tnpc = (ptrint) npc;
-       }
-
-}
-#endif
        
 /*
  * These are local overrides for various environment variables in Emacs.
index 81f191896fcc537fab491f57d8dae8609c441f93..af39da6e8d215c48e3eae776388345e0f5d8dfd4 100644 (file)
@@ -151,22 +151,6 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
 }
 
 
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
-void thread_restartcriticalsection(ucontext_t *_uc)
-{
-       mcontext_t *_mc;
-       void       *critical;
-
-       _mc = &_uc->uc_mcontext;
-
-       critical = thread_checkcritical((void *) _mc->sc_pc);
-
-       if (critical)
-               _mc->sc_pc = (ptrint) critical;
-}
-#endif
-
-
 /* md_icacheflush **************************************************************
 
    Calls the system's function to flush the instruction cache.
index 88e55caa6759c33c5826b707e482e52eda9a17df..e1d6c162a4e654fd8c7c96dbe08a87cb1019285c 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/x86_64/codegen.c - machine code generator for x86_64
 
-   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
+   Copyright (C) 1996-2005, 2006, 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
@@ -2499,9 +2497,6 @@ gen_method:
                                        superindex = super->index;
                                }
 
-                               if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                                       CODEGEN_CRITICAL_SECTION_NEW;
-
                                s1 = emit_load_s1(jd, iptr, REG_ITMP1);
 
                                /* if class is not resolved, check which code to call */
@@ -2574,8 +2569,6 @@ gen_method:
                                        M_ALD(REG_ITMP2, s1, OFFSET(java_object_t, vftbl));
                                        M_ALD(REG_ITMP3, RIP, disp);
 
-                                       CODEGEN_CRITICAL_SECTION_START;
-
                                        M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, baseval));
 
                                        /*                                      if (s1 != REG_ITMP1) { */
@@ -2598,8 +2591,6 @@ gen_method:
                                        M_ILD(REG_ITMP3, REG_ITMP3, OFFSET(vftbl_t, diffval));
                                        /*                                      } */
 
-                                       CODEGEN_CRITICAL_SECTION_END;
-
                                        M_ICMP(REG_ITMP3, REG_ITMP2);
                                        emit_classcast_check(cd, iptr, BRANCH_UGT, REG_ITMP3, s1);
 
@@ -2663,9 +2654,6 @@ gen_method:
                                superindex = super->index;
                        }
 
-                       if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                               CODEGEN_CRITICAL_SECTION_NEW;
-
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP2);
 
@@ -2747,14 +2735,10 @@ gen_method:
                                M_ALD(REG_ITMP1, s1, OFFSET(java_object_t, vftbl));
                                M_ALD(REG_ITMP2, RIP, disp);
 
-                               CODEGEN_CRITICAL_SECTION_START;
-
                                M_ILD(REG_ITMP1, REG_ITMP1, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, diffval));
                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, baseval));
 
-                               CODEGEN_CRITICAL_SECTION_END;
-
                                M_ISUB(REG_ITMP2, REG_ITMP1);
                                M_CLR(d); /* may be REG_ITMP2 */
                                M_ICMP(REG_ITMP3, REG_ITMP1);
index 6e4a2b227853841547c3ab343db497ff64399165..593956e69df858f051a464a147d0f14db0a13704 100644 (file)
@@ -129,25 +129,6 @@ void md_signal_handler_sigusr2(int sig, siginfo_t *siginfo, void *_p)
 #endif
 
 
-#if defined(ENABLE_THREADS)
-void thread_restartcriticalsection(ucontext_t *_uc)
-{
-       mcontext_t *_mc;
-       u1         *pc;
-       void       *critical;
-
-       _mc = &_uc->uc_mcontext;
-
-       pc = (u1 *) _mc->mc_rip;
-
-       critical = critical_find_restart_point(pc);
-
-       if (critical != NULL)
-               _mc->mc_rip = (ptrint) critical;
-}
-#endif
-
-
 /*
  * 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
index 8b8bf32d51f1a44dc0e920b70370ba58d2dd31b5..fa5d6755b0f21cc78c42b06abf231ea12a2ff439 100644 (file)
@@ -498,35 +498,6 @@ void md_executionstate_write(executionstate_t *es, void *context)
 }
 
 
-/* md_critical_section_restart *************************************************
-
-   Search the critical sections tree for a matching section and set
-   the PC to the restart point, if necessary.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS)
-void md_critical_section_restart(ucontext_t *_uc)
-{
-       mcontext_t *_mc;
-       u1         *pc;
-       u1         *npc;
-
-       _mc = &_uc->uc_mcontext;
-
-       /* ATTENTION: Don't use CACAO's internal REG_* defines as they are
-          different to the ones in <ucontext.h>. */
-
-       pc = (u1 *) _mc->gregs[REG_RIP];
-
-       npc = critical_find_restart_point(pc);
-
-       if (npc != NULL)
-               _mc->gregs[REG_RIP] = (ptrint) npc;
-}
-#endif
-
-
 /*
  * 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
index 5fa1f57a1db303de45b7fe3d55459255e5654268..1dabfee6fe10516bc7fdbc71ab0d8bb45a4f28a3 100644 (file)
@@ -1392,7 +1392,6 @@ bool vm_create(JavaVMInitArgs *vm_args)
 
        threads_preinit();
        lock_init();
-       critical_init();
 #endif
 
        /* install architecture dependent signal handlers */
index cee3866ee312c30c30532673bb8c05ce7f379e57..abf018cc8f35289ae98f9544f458150ccc884329 100644 (file)
@@ -1176,10 +1176,6 @@ static void linker_compute_subclasses(classinfo *c)
 {
        LOCK_MONITOR_ENTER(linker_classrenumber_lock);
 
-#if 0 && defined(ENABLE_THREADS) && !defined(DISABLE_GC)
-       threads_stopworld();
-#endif
-
        if (!(c->flags & ACC_INTERFACE)) {
                c->nextsub = NULL;
                c->sub     = NULL;
@@ -1197,10 +1193,6 @@ static void linker_compute_subclasses(classinfo *c)
        linker_compute_class_values(class_java_lang_Object);
 
        LOCK_MONITOR_EXIT(linker_classrenumber_lock);
-
-#if 0 && defined(ENABLE_THREADS) && !defined(DISABLE_GC)
-       threads_startworld();
-#endif
 }