calls instead of machine instructions, using the C calling
convention.
- $Id: builtin.c 921 2004-02-16 04:00:59Z jowenn $
+ $Id: builtin.c 951 2004-03-11 17:30:03Z jowenn $
*/
#undef DEBUG /*define DEBUG 1*/
+THREADSPECIFIC methodinfo* _threadrootmethod = NULL;
+THREADSPECIFIC void *_thread_nativestackframeinfo=NULL;
+
/*****************************************************************************
TYPE CHECKS
*****************************************************************************/
java_objectheader *builtin_new(classinfo *c)
{
java_objectheader *o;
+/*DEBUGING - NOT THREAD SAFE*/
+/* static long depth=0;
+ depth++;
+ printf("Entering builtin_new:depth(%ld)",depth);*/
if (!c->initialized) {
if (initverbose) {
#else
o = heap_allocate(c->instancesize, true, c->finalizer);
#endif
- if (!o) return NULL;
+ if (!o) {
+ /*DEBUGING - NOT THREAD SAFE*/
+ /*printf("Leaving builtin_new: depth(%ld): NULL",depth);
+ depth--;*/
+ return NULL;
+ }
memset(o, 0, c->instancesize);
o->vftbl = c->vftbl;
+ /*DEBUGING - NOT THREAD SAFE*/
+ /* printf("Leaving builtin_new: depth(%ld): object",depth);
+ depth--;*/
return o;
}
}
+inline methodinfo *builtin_asm_get_threadrootmethod() {
+ return *threadrootmethod;
+}
+
+
+inline void*
+builtin_asm_get_stackframeinfo(){
+/*log_text("builtin_asm_get_stackframeinfo()");*/
+#if defined(USE_THREADS) && defined(NATIVE_THREADS)
+#ifdef HAVE___THREAD
+ return &_thread_nativestackframeinfo; /*support for __thread attribute*/
+#else
+ return &((nativethread*) pthread_getspecific(tkey_stackframeinfo))->_stackframeinfo /*copied from exception handling, is that really */
+ /*old pthread*/
+#endif
+#else
+#warning FIXME FOR OLD THREAD IMPL (jowenn)
+ return &_thread_nativestackframeinfo; /* no threading, at least no native*/
+#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