calls instead of machine instructions, using the C calling
convention.
- $Id: builtin.c 890 2004-01-19 12:24:13Z edwin $
+ $Id: builtin.c 897 2004-01-21 00:49:42Z stefan $
*/
*/
void internal_lock_mutex_for_object(java_objectheader *object)
{
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
mutexHashEntry *entry;
int hashValue;
*/
void internal_unlock_mutex_for_object (java_objectheader *object)
{
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
int hashValue;
mutexHashEntry *entry;
void builtin_monitorenter(java_objectheader *o)
{
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
int hashValue;
assert(blockInts == 0);
void builtin_monitorexit (java_objectheader *o)
{
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
int hashValue;
assert(blockInts == 0);
Changes: Edwin Steiner
- $Id: jit.c 892 2004-01-19 12:32:29Z edwin $
+ $Id: jit.c 897 2004-01-21 00:49:42Z stefan $
*/
pthread_mutex_lock(&compiler_mutex);
#endif
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsDisable(); /* disable interrupts */
+#endif
regs_ok = false;
utf_sprint(logtext+strlen(logtext), m->name);
utf_sprint(logtext+strlen(logtext), m->descriptor);
log_text(logtext);
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsRestore(); /* enable interrupts again */
+#endif
return (methodptr) do_nothing_function; /* return empty method */
}
compilingtime += (stoptime - starttime);
}
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsRestore(); /* enable interrupts again */
+#endif
#if defined(USE_THREADS) && defined(NATIVE_THREADS)
pthread_mutex_unlock(&compiler_mutex);
Changes: Joseph Wenninger
- $Id: jni.c 862 2004-01-06 23:42:01Z stefan $
+ $Id: jni.c 897 2004-01-21 00:49:42Z stefan $
*/
u4 dummy;
char c;
char *cp;
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsDisable();
+#endif
if (utf_char==0) {
utf_char=utf_new_char("java/lang/Character");
utf_bool=utf_new_char("java/lang/Boolean");
utf_float=utf_new_char("java/lang/Float");
utf_double=utf_new_char("java/lang/Double");
}
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsRestore();
+#endif
/*
log_text("fill_callblock");
Mark Probst
Edwin Steiner
- $Id: loader.c 890 2004-01-19 12:24:13Z edwin $
+ $Id: loader.c 897 2004-01-21 00:49:42Z stefan $
*/
{
methodinfo *m;
s4 i;
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
int b;
#endif
log_text(logtext);
}
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
b = blockInts;
blockInts = 0;
#endif
/* now call the initializer */
asm_calljavafunction(m, NULL, NULL, NULL, NULL);
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
assert(blockInts == 0);
blockInts = b;
#endif
return;
}
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
b = blockInts;
blockInts = 0;
#endif
asm_calljavafunction(m, NULL, NULL, NULL, NULL);
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
assert(blockInts == 0);
blockInts = b;
#endif
loader_load_running++;
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsDisable();
+#endif
if (getloadingtime)
starttime = getcputime();
}
}
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsRestore();
+#endif
#if defined(USE_THREADS) && defined(NATIVE_THREADS)
pthread_mutex_unlock(&compiler_mutex);
/* correct vftbl-entries (retarded loading of class java/lang/String) */
stringtable_update();
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
if (stackbottom!=0)
initLocks();
#endif
{
classinfo *c;
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsDisable(); /* schani */
+#endif
c = list_first(&linkedclasses);
while (c) {
cast_unlock();
#endif
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsRestore(); /* schani */
+#endif
}
- Calling the class loader
- Running the main method
- $Id: main.c 895 2004-01-19 13:53:43Z edwin $
+ $Id: main.c 897 2004-01-21 00:49:42Z stefan $
*/
static classinfo *topclass;
-#ifndef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
void **stackbottom = 0;
#endif
if (showconstantpool) class_showconstantpool(topclass);
if (showutf) utf_show();
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
clear_thread_flags(); /* restores standard file descriptor
flags */
#endif
char *specificmethodname = NULL;
char *specificsignature = NULL;
-#ifndef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
stackbottom = &dummy;
#endif
/* initialize the garbage collector */
gc_init();
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
initThreads((u1*) &dummy);
#endif
printf("\n");
}
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
killThread(currentThread);
#endif
fprintf(stderr, "still here\n");
Authors: Stefan Ring
- $Id: boehm.c 862 2004-01-06 23:42:01Z stefan $
+ $Id: boehm.c 897 2004-01-21 00:49:42Z stefan $
*/
}
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
#define MAINTHREADCALL(r,m,pp,ll) \
if (currentThread == NULL || currentThread == mainThread) { \
r = m(pp, ll); \
Changes: Joseph Wenninger
- $Id: Thread.c 873 2004-01-11 20:59:29Z twisti $
+ $Id: Thread.c 897 2004-01-21 00:49:42Z stefan $
*/
if (runverbose)
log_text("java_lang_Thread_currentThread called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
t = (java_lang_Thread *) currentThread;
if (!t->group) {
if (runverbose)
log_text("java_lang_Thread_isAlive called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
return aliveThread((thread *) this);
#else
return 0;
if (runverbose)
log_text("java_lang_Thread_resume0 called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
resumeThread((thread *) this);
#endif
}
if (runverbose)
log_text("java_lang_Thread_setPriority0 called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
setPriorityThread((thread *) this, par1);
#endif
}
if (runverbose)
log_text("java_lang_Thread_sleep called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
sleepThread(millis);
#endif
}
if (runverbose)
log_text("java_lang_Thread_start called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
startThread((thread*)this);
#endif
}
log_text ("java_lang_Thread_stop0 called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
if (currentThread == (thread*)this) {
log_text("killing");
killThread(0);
if (runverbose)
log_text("java_lang_Thread_suspend0 called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
suspendThread((thread*)this);
#endif
}
if (runverbose)
log_text("java_lang_Thread_yield called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
yieldThread();
#endif
}
Changes: Joseph Wenninger
- $Id: VMObject.c 873 2004-01-11 20:59:29Z twisti $
+ $Id: VMObject.c 897 2004-01-21 00:49:42Z stefan $
*/
if (runverbose)
log_text("java_lang_Object_notify called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
signal_cond_for_object(&this->header);
#endif
}
if (runverbose)
log_text("java_lang_Object_notifyAll called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
broadcast_cond_for_object(&this->header);
#endif
}
if (runverbose)
log_text("java_lang_Object_wait called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
wait_cond_for_object(&this->header, time);
#endif
}
- Calling the class loader
- Running the main method
- $Id: cacao.c 895 2004-01-19 13:53:43Z edwin $
+ $Id: cacao.c 897 2004-01-21 00:49:42Z stefan $
*/
static classinfo *topclass;
-#ifndef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
void **stackbottom = 0;
#endif
if (showconstantpool) class_showconstantpool(topclass);
if (showutf) utf_show();
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
clear_thread_flags(); /* restores standard file descriptor
flags */
#endif
char *specificmethodname = NULL;
char *specificsignature = NULL;
-#ifndef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
stackbottom = &dummy;
#endif
/* initialize the garbage collector */
gc_init();
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
initThreads((u1*) &dummy);
#endif
printf("\n");
}
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
killThread(currentThread);
#endif
fprintf(stderr, "still here\n");
Authors: Stefan Ring
- $Id: boehm.c 862 2004-01-06 23:42:01Z stefan $
+ $Id: boehm.c 897 2004-01-21 00:49:42Z stefan $
*/
}
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
#define MAINTHREADCALL(r,m,pp,ll) \
if (currentThread == NULL || currentThread == mainThread) { \
r = m(pp, ll); \
Changes: Joseph Wenninger
- $Id: jni.c 862 2004-01-06 23:42:01Z stefan $
+ $Id: jni.c 897 2004-01-21 00:49:42Z stefan $
*/
u4 dummy;
char c;
char *cp;
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsDisable();
+#endif
if (utf_char==0) {
utf_char=utf_new_char("java/lang/Character");
utf_bool=utf_new_char("java/lang/Boolean");
utf_float=utf_new_char("java/lang/Float");
utf_double=utf_new_char("java/lang/Double");
}
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsRestore();
+#endif
/*
log_text("fill_callblock");
Changes: Joseph Wenninger
- $Id: VMObject.c 873 2004-01-11 20:59:29Z twisti $
+ $Id: VMObject.c 897 2004-01-21 00:49:42Z stefan $
*/
if (runverbose)
log_text("java_lang_Object_notify called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
signal_cond_for_object(&this->header);
#endif
}
if (runverbose)
log_text("java_lang_Object_notifyAll called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
broadcast_cond_for_object(&this->header);
#endif
}
if (runverbose)
log_text("java_lang_Object_wait called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
wait_cond_for_object(&this->header, time);
#endif
}
Changes: Joseph Wenninger
- $Id: VMThread.c 873 2004-01-11 20:59:29Z twisti $
+ $Id: VMThread.c 897 2004-01-21 00:49:42Z stefan $
*/
if (runverbose)
log_text("java_lang_Thread_currentThread called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
t = (java_lang_Thread *) currentThread;
if (!t->group) {
if (runverbose)
log_text("java_lang_Thread_isAlive called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
return aliveThread((thread *) this);
#else
return 0;
if (runverbose)
log_text("java_lang_Thread_resume0 called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
resumeThread((thread *) this);
#endif
}
if (runverbose)
log_text("java_lang_Thread_setPriority0 called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
setPriorityThread((thread *) this, par1);
#endif
}
if (runverbose)
log_text("java_lang_Thread_sleep called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
sleepThread(millis);
#endif
}
if (runverbose)
log_text("java_lang_Thread_start called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
startThread((thread*)this);
#endif
}
log_text ("java_lang_Thread_stop0 called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
if (currentThread == (thread*)this) {
log_text("killing");
killThread(0);
if (runverbose)
log_text("java_lang_Thread_suspend0 called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
suspendThread((thread*)this);
#endif
}
if (runverbose)
log_text("java_lang_Thread_yield called");
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
yieldThread();
#endif
}
#include "native.h"
#include "loader.h"
+#if !defined(NATIVE_THREADS)
+
static classinfo *class_java_lang_IllegalMonitorStateException;
extern thread* currentThread;
cv->cvWaiters = 0;
}
}
+
+#endif
#include "config.h"
#include "thread.h"
+#if !defined(NATIVE_THREADS)
#define TH_READ 0
#define TH_WRITE 1
}
}
}
+
+#endif
#ifndef HAVE___THREAD
pthread_key_t tkey_threadinfo;
#endif
-#endif
+
+void cast_lock()
+{
+}
+
+void cast_unlock()
+{
+}
+
+#else // !defined(NATIVE_THREADS)
static classinfo *class_java_lang_ThreadDeath;
}
}
-void cast_lock()
-{
-}
-
-void cast_unlock()
-{
-}
+#endif
#define SDBG(s) s
#endif
+#if !defined(NATIVE_THREADS)
+
struct _thread;
typedef struct _ctx
java_objectheader *_exceptionptr;
} nativethread;
-#if defined(NATIVE_THREADS)
+#else // defined(NATIVE_THREADS)
#if !defined(HAVE___THREAD)
extern pthread_key_t tkey_threadinfo;
calls instead of machine instructions, using the C calling
convention.
- $Id: builtin.c 890 2004-01-19 12:24:13Z edwin $
+ $Id: builtin.c 897 2004-01-21 00:49:42Z stefan $
*/
*/
void internal_lock_mutex_for_object(java_objectheader *object)
{
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
mutexHashEntry *entry;
int hashValue;
*/
void internal_unlock_mutex_for_object (java_objectheader *object)
{
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
int hashValue;
mutexHashEntry *entry;
void builtin_monitorenter(java_objectheader *o)
{
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
int hashValue;
assert(blockInts == 0);
void builtin_monitorexit (java_objectheader *o)
{
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
int hashValue;
assert(blockInts == 0);
Changes: Edwin Steiner
- $Id: jit.c 892 2004-01-19 12:32:29Z edwin $
+ $Id: jit.c 897 2004-01-21 00:49:42Z stefan $
*/
pthread_mutex_lock(&compiler_mutex);
#endif
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsDisable(); /* disable interrupts */
+#endif
regs_ok = false;
utf_sprint(logtext+strlen(logtext), m->name);
utf_sprint(logtext+strlen(logtext), m->descriptor);
log_text(logtext);
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsRestore(); /* enable interrupts again */
+#endif
return (methodptr) do_nothing_function; /* return empty method */
}
compilingtime += (stoptime - starttime);
}
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsRestore(); /* enable interrupts again */
+#endif
#if defined(USE_THREADS) && defined(NATIVE_THREADS)
pthread_mutex_unlock(&compiler_mutex);
Mark Probst
Edwin Steiner
- $Id: loader.c 890 2004-01-19 12:24:13Z edwin $
+ $Id: loader.c 897 2004-01-21 00:49:42Z stefan $
*/
{
methodinfo *m;
s4 i;
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
int b;
#endif
log_text(logtext);
}
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
b = blockInts;
blockInts = 0;
#endif
/* now call the initializer */
asm_calljavafunction(m, NULL, NULL, NULL, NULL);
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
assert(blockInts == 0);
blockInts = b;
#endif
return;
}
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
b = blockInts;
blockInts = 0;
#endif
asm_calljavafunction(m, NULL, NULL, NULL, NULL);
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
assert(blockInts == 0);
blockInts = b;
#endif
loader_load_running++;
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsDisable();
+#endif
if (getloadingtime)
starttime = getcputime();
}
}
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsRestore();
+#endif
#if defined(USE_THREADS) && defined(NATIVE_THREADS)
pthread_mutex_unlock(&compiler_mutex);
/* correct vftbl-entries (retarded loading of class java/lang/String) */
stringtable_update();
-#ifdef USE_THREADS
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
if (stackbottom!=0)
initLocks();
#endif
{
classinfo *c;
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsDisable(); /* schani */
+#endif
c = list_first(&linkedclasses);
while (c) {
cast_unlock();
#endif
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsRestore(); /* schani */
+#endif
}
#include "native.h"
#include "loader.h"
+#if !defined(NATIVE_THREADS)
+
static classinfo *class_java_lang_IllegalMonitorStateException;
extern thread* currentThread;
cv->cvWaiters = 0;
}
}
+
+#endif
#ifndef HAVE___THREAD
pthread_key_t tkey_threadinfo;
#endif
-#endif
+
+void cast_lock()
+{
+}
+
+void cast_unlock()
+{
+}
+
+#else // !defined(NATIVE_THREADS)
static classinfo *class_java_lang_ThreadDeath;
}
}
-void cast_lock()
-{
-}
-
-void cast_unlock()
-{
-}
+#endif
#define SDBG(s) s
#endif
+#if !defined(NATIVE_THREADS)
+
struct _thread;
typedef struct _ctx
java_objectheader *_exceptionptr;
} nativethread;
-#if defined(NATIVE_THREADS)
+#else // defined(NATIVE_THREADS)
#if !defined(HAVE___THREAD)
extern pthread_key_t tkey_threadinfo;
#include "config.h"
#include "thread.h"
+#if !defined(NATIVE_THREADS)
#define TH_READ 0
#define TH_WRITE 1
}
}
}
+
+#endif