#ifdef.
* src/vm/class.h: Likewise.
* src/vm/loader.c: Java ME changes.
* src/vm/finalizer.c (finalizer_start_thread): Set flags.
* src/vm/jit/optimizing/recompile.c (recompile_start_thread):
Likewise.
* src/vm/jit/stacktrace.c [ENABLE_JAVASE] (stacktrace_getStack): Added
#ifdef.
* src/vm/jit/codegen-common.c (codegen_start_native_call)
[ENABLE_JAVASE]: #ifdef'ed the local references table stuff (maybe we
need to change that for cacao-gc).
(codegen_finish_native_call): Likewise.
* src/vm/exceptions.c (exceptions_asm_new_abstractmethoderror)
[!ENABLE_JAVASE]: In the meantime we throw a VirtualMachineError.
* src/vm/exceptions.h: Likewise.
* src/vm/linker.c: Java ME changes.
* src/native/native.c: Likewise.
* src/native/native.h: Likewise.
* src/threads/native/threads.h (THREAD_FLAG_DAEMON): Added.
(threadobject): Changed flags to u4.
* src/threads/native/threads.c: A lot of Java ME changes.
Andreas Krall
Christian Thalinger
- $Id: native.c 6213 2006-12-18 17:36:06Z twisti $
+ $Id: native.c 6251 2006-12-27 23:15:56Z twisti $
*/
/* include table of native functions ******************************************/
-#include "native/include/java_lang_Cloneable.h"
-#include "native/include/java_util_Properties.h"
+#if defined(ENABLE_JAVASE)
+
#include "native/include/java_io_InputStream.h"
#include "native/include/java_io_PrintStream.h"
+#include "native/include/java_lang_Cloneable.h"
+#include "native/include/java_util_Properties.h"
+
+#include "native/include/java_lang_Object.h"
+
#include "native/include/gnu_classpath_VMStackWalker.h"
#include "native/include/gnu_classpath_VMSystemProperties.h"
#include "native/include/gnu_java_lang_management_VMClassLoadingMXBeanImpl.h"
#include "native/include/gnu_java_lang_management_VMMemoryMXBeanImpl.h"
#include "native/include/gnu_java_lang_management_VMRuntimeMXBeanImpl.h"
-#include "native/include/java_lang_Class.h"
-#include "native/include/java_lang_Object.h"
#include "native/include/java_lang_VMClass.h"
#include "native/include/java_lang_VMClassLoader.h"
#include "native/include/java_lang_VMObject.h"
#include "native/include/gnu_classpath_jdwp_VMMethod.h"
#endif
+#elif defined(ENABLE_JAVAME_CLDC1_1)
+
+#include "native/include/com_sun_cldchi_io_ConsoleOutputStream.h"
+#include "native/include/java_lang_Class.h"
+#include "native/include/java_lang_Double.h"
+#include "native/include/java_lang_Float.h"
+#include "native/include/java_lang_Math.h"
+#include "native/include/java_lang_Runtime.h"
+#include "native/include/java_lang_System.h"
+#include "native/include/java_lang_Thread.h"
+
+#endif
+
#if defined(WITH_STATIC_CLASSPATH)
/* these are required to prevent compiler warnings */
*******************************************************************************/
functionptr dummynativetable[] = {
+#if defined(ENABLE_JAVASE)
(functionptr) Java_gnu_classpath_VMStackWalker_getClassContext,
(functionptr) Java_gnu_classpath_VMStackWalker_getCallingClass,
(functionptr) Java_gnu_classpath_VMStackWalker_getCallingClassLoader,
(functionptr) Java_gnu_classpath_jdwp_VMMethod_getVariableTable
#endif
+#elif defined(ENABLE_JAVAME_CLDC1_1)
+ (functionptr) Java_com_sun_cldchi_io_ConsoleOutputStream_write,
+
+ (functionptr) Java_java_lang_Class_forName,
+ (functionptr) Java_java_lang_Class_newInstance,
+ (functionptr) Java_java_lang_Class_getName,
+
+ (functionptr) Java_java_lang_Double_doubleToLongBits,
+
+ (functionptr) Java_java_lang_Float_floatToIntBits,
+
+ (functionptr) Java_java_lang_Math_ceil,
+ (functionptr) Java_java_lang_Math_cos,
+ (functionptr) Java_java_lang_Math_floor,
+ (functionptr) Java_java_lang_Math_sin,
+ (functionptr) Java_java_lang_Math_sqrt,
+ (functionptr) Java_java_lang_Math_tan,
+
+ (functionptr) Java_java_lang_Runtime_exitInternal,
+
+ (functionptr) Java_java_lang_System_getProperty0,
+
+ (functionptr) Java_java_lang_Thread_currentThread,
+ (functionptr) Java_java_lang_Thread_setPriority0,
+ (functionptr) Java_java_lang_Thread_start0,
+ (functionptr) Java_java_lang_Thread_yield,
+
+ (functionptr) Java_java_lang_Throwable_printStackTrace,
+ (functionptr) Java_java_lang_Throwable_fillInStackTrace
+#endif
};
#endif /* defined(ENABLE_LIBJVM) */
return n->func;
}
-
/* no function was found, throw exception */
*exceptionptr =
if (opt_verbosejni)
printf("failed ]\n");
+#if defined(ENABLE_JAVASE)
*exceptionptr =
new_exception_utfmessage(string_java_lang_UnsatisfiedLinkError,
m->name);
+#elif defined(ENABLE_JAVAME_CLDC1_1)
+ *exceptionptr =
+ new_exception_utfmessage(string_java_lang_VirtualMachineError,
+ m->name);
+#else
+#error IMPLEMENT ME!
+#endif
}
/* release memory */
*******************************************************************************/
+#if defined(ENABLE_JAVASE)
java_objectarray *native_class_getdeclaredannotations(classinfo *c)
{
java_objectarray *oa;
return oa;
}
+#endif
/* native_get_parametertypes ***************************************************
Contact: cacao@cacaojvm.org
Authors: Reinhard Grafl
+ Christian Thalinger
- Changes: Christian Thalinger
-
- $Id: native.h 6213 2006-12-18 17:36:06Z twisti $
+ $Id: native.h 6251 2006-12-27 23:15:56Z twisti $
*/
# include <ltdl.h>
#endif
+#include "native/jni.h"
+#include "native/include/java_lang_String.h"
+#include "native/include/java_lang_Throwable.h"
#include "vm/class.h"
#include "vm/global.h"
#include "vm/method.h"
#include "vm/utf8.h"
-#include "native/jni.h"
-#include "native/include/java_lang_String.h"
-#include "native/include/java_lang_ClassLoader.h"
-#include "native/include/java_lang_Throwable.h"
/* table for locating native methods */
Christian Thalinger
Edwin Steiner
- $Id: threads.c 6228 2006-12-26 19:56:58Z twisti $
+ $Id: threads.c 6251 2006-12-27 23:15:56Z twisti $
*/
#include "native/include/java_lang_Object.h"
#include "native/include/java_lang_Throwable.h"
#include "native/include/java_lang_Thread.h"
-#include "native/include/java_lang_ThreadGroup.h"
-#include "native/include/java_lang_VMThread.h"
+
+#if defined(ENABLE_JAVASE)
+# include "native/include/java_lang_ThreadGroup.h"
+#endif
+
+#if defined(WITH_CLASSPATH_GNU)
+# include "native/include/java_lang_VMThread.h"
+#endif
+
#include "threads/native/threads.h"
#include "toolbox/avl.h"
#include "toolbox/logging.h"
bool threads_init(void)
{
java_lang_String *threadname;
- java_lang_VMThread *vmt;
- java_lang_ThreadGroup *threadgroup;
threadobject *tempthread;
- methodinfo *m;
java_objectheader *o;
+
+#if defined(ENABLE_JAVSE)
+ java_lang_ThreadGroup *threadgroup;
+ methodinfo *m;
java_lang_Thread *t;
+#endif
+
+#if defined(WITH_CLASSPATH_GNU)
+ java_lang_VMThread *vmt;
+#endif
tempthread = mainthreadobj;
/* get methods we need in this file */
+#if defined(WITH_CLASSPATH_GNU)
method_thread_init =
class_resolveclassmethod(class_java_lang_Thread,
utf_init,
utf_new_char("(Ljava/lang/VMThread;Ljava/lang/String;IZ)V"),
class_java_lang_Thread,
true);
+#else
+ method_thread_init =
+ class_resolveclassmethod(class_java_lang_Thread,
+ utf_init,
+ utf_new_char("(Ljava/lang/String;)V"),
+ class_java_lang_Thread,
+ true);
+#endif
if (method_thread_init == NULL)
return false;
threadname = javastring_new(utf_new_char("main"));
+#if defined(ENABLE_JAVSE)
/* allocate and init ThreadGroup */
threadgroup = (java_lang_ThreadGroup *)
if (threadgroup == NULL)
throw_exception_exit();
+#endif
#if defined(WITH_CLASSPATH_GNU)
/* create a java.lang.VMThread for the main thread */
(void) vm_call_method(method_thread_init, o, vmt, threadname, NORM_PRIORITY,
false);
-#else
-#error IMPLEMENT ME!
+#elif defined(WITH_CLASSPATH_CLDC1_1)
+ /* call public Thread(String name) */
+
+ o = (java_objectheader *) mainthreadobj;
+
+ (void) vm_call_method(method_thread_init, o, threadname);
#endif
if (*exceptionptr)
return false;
+#if defined(ENABLE_JAVASE)
mainthreadobj->o.group = threadgroup;
/* add main thread to java.lang.ThreadGroup */
if (*exceptionptr)
return false;
+#endif
+
threads_set_thread_priority(pthread_self(), NORM_PRIORITY);
/* initialize the thread attribute object */
struct sched_param schedp;
int policy;
+#if defined(ENABLE_JAVAME_CLDC1_1)
+ /* The thread id is zero when a thread is created in Java. The
+ priority is set later during startup. */
+
+ if (tid == NULL)
+ return;
+#endif
+
pthread_getschedparam(tid, &policy, &schedp);
schedp.sched_priority = priority;
pthread_setschedparam(tid, policy, &schedp);
bool threads_attach_current_thread(JavaVMAttachArgs *vm_aargs, bool isdaemon)
{
threadobject *thread;
- java_lang_VMThread *vmt;
utf *u;
java_lang_String *s;
- java_lang_ThreadGroup *group;
methodinfo *m;
java_objectheader *o;
java_lang_Thread *t;
+#if defined(ENABLE_JAVASE)
+ java_lang_ThreadGroup *group;
+#endif
+
+#if defined(WITH_CLASSPATH_GNU)
+ java_lang_VMThread *vmt;
+#endif
+
/* create a java.lang.Thread object */
thread = (threadobject *) builtin_new(class_java_lang_Thread);
pthread_mutex_unlock(&threadlistlock);
- /* mark main thread as Java thread */
+ /* mark thread as Java thread */
thread->flags = THREAD_FLAG_JAVA;
+ if (isdaemon)
+ thread->flags |= THREAD_FLAG_DAEMON;
+
#if defined(ENABLE_INTRP)
/* create interpreter stack */
if (vm_aargs != NULL) {
u = utf_new_char(vm_aargs->name);
+#if defined(ENABLE_JAVASE)
group = (java_lang_ThreadGroup *) vm_aargs->group;
+#endif
}
else {
u = utf_null;
+#if defined(ENABLE_JAVASE)
group = mainthreadobj->o.group;
+#endif
}
s = javastring_new(u);
#if defined(WITH_CLASSPATH_GNU)
(void) vm_call_method(method_thread_init, o, vmt, s, NORM_PRIORITY,
isdaemon);
-#else
+#elif defined(WITH_CLASSPATH_CLDC1_1)
+ (void) vm_call_method(method_thread_init, o, s);
#endif
if (*exceptionptr)
return false;
+#if defined(ENABLE_JAVASE)
/* store the thread group in the object */
thread->o.group = group;
if (*exceptionptr)
return false;
+#endif
return true;
}
bool threads_detach_thread(threadobject *thread)
{
- java_lang_ThreadGroup *group;
methodinfo *m;
java_objectheader *o;
java_lang_Thread *t;
+#if defined(ENABLE_JAVASE)
+ java_lang_ThreadGroup *group;
+#endif
+
/* Allow lock record pools to be used by other threads. They
cannot be deleted so we'd better not waste them. */
/* XXX implement uncaught exception stuff (like JamVM does) */
+#if defined(ENABLE_JAVASE)
/* remove thread from the thread group */
group = thread->o.group;
if (*exceptionptr)
return false;
}
+#endif
/* remove thread from thread list and threads table, do this
inside a lock */
static threadobject *threads_find_non_daemon_thread(threadobject *thread)
{
while (thread != mainthreadobj) {
- if (!thread->o.daemon)
+ if (thread->flags & THREAD_FLAG_DAEMON)
return thread;
thread = thread->prev;
if (t != NULL) {
/* get thread name */
+#if defined(ENABLE_JAVASE)
name = javastring_toutf(t->name, false);
+#elif defined(ENABLE_JAVAME_CLDC1_1)
+ name = t->name;
+#endif
printf("\n\"");
utf_display_printable_ascii(name);
printf("\" ");
- if (t->daemon)
+ if (thread->flags & THREAD_FLAG_DAEMON)
printf("daemon ");
#if SIZEOF_VOID_P == 8
Edwin Steiner
Christian Thalinger
- $Id: threads.h 6228 2006-12-26 19:56:58Z twisti $
+ $Id: threads.h 6251 2006-12-27 23:15:56Z twisti $
*/
#define THREAD_FLAG_JAVA 0x01 /* a normal Java thread */
#define THREAD_FLAG_INTERNAL 0x02 /* CACAO internal thread */
+#define THREAD_FLAG_DAEMON 0x04 /* daemon thread */
struct threadobject {
ptrint thinlock; /* pre-computed thin lock value */
s4 index; /* thread index, starting with 1 */
- u1 flags; /* flag field */
+ u4 flags; /* flag field */
pthread_t tid; /* pthread id */
Christian Thalinger
Edwin Steiner
- $Id: class.c 6244 2006-12-27 15:15:31Z twisti $
+ $Id: class.c 6251 2006-12-27 23:15:56Z twisti $
*/
classinfo *class_java_lang_reflect_Method;
classinfo *class_java_security_PrivilegedAction;
classinfo *class_java_util_Vector;
-#endif
classinfo *arrayclass_java_lang_Object;
+#endif
/* pseudo classes for the typechecker */
Authors: Christian Thalinger
- $Id: class.h 6244 2006-12-27 15:15:31Z twisti $
+ $Id: class.h 6251 2006-12-27 23:15:56Z twisti $
*/
extern classinfo *class_java_lang_reflect_Method;
extern classinfo *class_java_security_PrivilegedAction;
extern classinfo *class_java_util_Vector;
-#endif
extern classinfo *arrayclass_java_lang_Object;
+#endif
/* pseudo classes for the type checker ****************************************/
Authors: Christian Thalinger
Edwin Steiner
- $Id: exceptions.c 6244 2006-12-27 15:15:31Z twisti $
+ $Id: exceptions.c 6251 2006-12-27 23:15:56Z twisti $
*/
#endif
+/* exceptions_throw_abstractmethoderror ****************************************
+
+ Generates a java.lang.AbstractMethodError for the VM and throws it.
+
+*******************************************************************************/
+
+#if defined(ENABLE_JAVASE)
+void exceptions_throw_abstractmethoderror(void)
+{
+ *exceptionptr = exceptions_new_abstractmethoderror();
+}
+#endif
+
+
/* exceptions_asm_new_abstractmethoderror **************************************
Generates a java.lang.AbstractMethodError for
*******************************************************************************/
-#if defined(ENABLE_JAVASE)
java_objectheader *exceptions_asm_new_abstractmethoderror(u1 *sp, u1 *ra)
{
stackframeinfo sfi;
/* create the exception */
+#if defined(ENABLE_JAVASE)
e = exceptions_new_abstractmethoderror();
+#else
+ /* in the meantime we do this */
+
+ e = exceptions_new_virtualmachineerror();
+#endif
/* remove the stackframeinfo */
return e;
}
-#endif
-
-
-/* exceptions_throw_abstractmethoderror ****************************************
-
- Generates a java.lang.AbstractMethodError for the VM and throws it.
-
-*******************************************************************************/
-
-#if defined(ENABLE_JAVASE)
-void exceptions_throw_abstractmethoderror(void)
-{
- *exceptionptr = exceptions_new_abstractmethoderror();
-}
-#endif
/* new_classformaterror ********************************************************
Authors: Christian Thalinger
Edwin Steiner
- $Id: exceptions.h 6244 2006-12-27 15:15:31Z twisti $
+ $Id: exceptions.h 6251 2006-12-27 23:15:56Z twisti $
*/
#if defined(ENABLE_JAVASE)
java_objectheader *exceptions_new_abstractmethoderror(void);
-java_objectheader *exceptions_asm_new_abstractmethoderror(u1 *sp, u1 *ra);
-void exceptions_throw_abstractmethoderror(void);
+void exceptions_throw_abstractmethoderror(void);
#endif
+java_objectheader *exceptions_asm_new_abstractmethoderror(u1 *sp, u1 *ra);
+
java_objectheader *new_classformaterror(classinfo *c, const char *message, ...);
void exceptions_throw_classformaterror(classinfo *c, const char *message, ...);
Authors: Christian Thalinger
- $Id: finalizer.c 6228 2006-12-26 19:56:58Z twisti $
+ $Id: finalizer.c 6251 2006-12-27 23:15:56Z twisti $
*/
#include "mm/memory.h"
#include "native/jni.h"
#include "native/include/java_lang_Thread.h"
-#include "native/include/java_lang_VMThread.h"
+
+#if defined(WITH_CLASSPATH_GNU)
+# include "native/include/java_lang_VMThread.h"
+#endif
#if defined(ENABLE_THREADS)
# include "threads/native/lock.h"
thread_finalizer->o.vmThread = vmt;
#endif
+ thread_finalizer->flags = THREAD_FLAG_DAEMON;
+
thread_finalizer->o.name = javastring_new_from_ascii("Finalizer");
+#if defined(ENABLE_JAVASE)
thread_finalizer->o.daemon = true;
+#endif
thread_finalizer->o.priority = 5;
/* actually start the finalizer thread */
memory. All functions writing values into the data area return the offset
relative the begin of the code area (start of procedure).
- $Id: codegen-common.c 6143 2006-12-07 23:13:25Z edwin $
+ $Id: codegen-common.c 6251 2006-12-27 23:15:56Z twisti $
*/
stacktrace_create_native_stackframeinfo(sfi, pv, sp, ra);
+#if defined(ENABLE_JAVASE)
/* add current JNI local references table to this thread */
lrt->capacity = LOCALREFTABLE_CAPACITY;
MSET(lrt->refs, 0, java_objectheader*, LOCALREFTABLE_CAPACITY);
LOCALREFTABLE = lrt;
+#endif
}
*psfi = sfi->prev;
+#if defined(ENABLE_JAVASE)
/* release JNI local references tables for this thread */
lrt = LOCALREFTABLE;
/* now store the previous local frames in the thread structure */
LOCALREFTABLE = lrt;
+#endif
/* get the exception and return it */
#include "mm/memory.h"
#include "native/jni.h"
#include "native/include/java_lang_Thread.h"
-#include "native/include/java_lang_VMThread.h"
+
+#if defined(WITH_CLASSPATH_GNU)
+# include "native/include/java_lang_VMThread.h"
+#endif
#if defined(ENABLE_THREADS)
# include "threads/native/lock.h"
thread_recompile->o.vmThread = vmt;
#endif
+ thread_recompile->flags = THREAD_FLAG_DAEMON;
+
thread_recompile->o.name = javastring_new_from_ascii("Recompiler");
+#if defined(ENABLE_JAVASE)
thread_recompile->o.daemon = true;
+#endif
thread_recompile->o.priority = 5;
/* actually start the recompilation thread */
Christian Thalinger
Edwin Steiner
- $Id: stacktrace.c 6248 2006-12-27 22:39:39Z twisti $
+ $Id: stacktrace.c 6251 2006-12-27 23:15:56Z twisti $
*/
*******************************************************************************/
+#if defined(ENABLE_JAVASE)
java_objectarray *stacktrace_getStack(void)
{
stacktracebuffer *stb;
/* create a stacktrace for the current thread */
stb = stacktrace_create(THREADOBJECT);
- if (!stb)
+
+ if (stb == NULL)
goto return_NULL;
/* get the first stacktrace entry */
oa = builtin_anewarray(2, arrayclass_java_lang_Object);
- if (!oa)
+ if (oa == NULL)
goto return_NULL;
classes = builtin_anewarray(stb->used, class_java_lang_Class);
- if (!classes)
+ if (classes == NULL)
goto return_NULL;
methodnames = builtin_anewarray(stb->used, class_java_lang_String);
- if (!methodnames)
+ if (methodnames == NULL)
goto return_NULL;
/* set up the 2-dimensional array */
classes->data[i] = (java_objectheader *) c;
str = javastring_new(ste->method->name);
- if (!str)
+ if (str == NULL)
goto return_NULL;
methodnames->data[i] = (java_objectheader *) str;
return NULL;
}
+#endif /* ENABLE_JAVASE */
/* stacktrace_print_trace_from_buffer ******************************************
Edwin Steiner
Christian Thalinger
- $Id: linker.c 5975 2006-11-12 15:33:16Z edwin $
+ $Id: linker.c 6251 2006-12-27 23:15:56Z twisti $
*/
{ NULL, NULL, "java/lang/Short", 'S', "short" , "[S", NULL, NULL },
{ NULL, NULL, "java/lang/Boolean", 'Z', "boolean" , "[Z", NULL, NULL },
{ NULL, NULL, NULL, 0 , NULL , NULL, NULL, NULL },
- { NULL, NULL, "java/lang/Void", 'V', "void" , NULL, NULL, NULL }
+#if defined(ENABLE_JAVASE)
+ { NULL, NULL, "java/lang/Void", 'V', "void" , NULL, NULL, NULL }
+#else
+ { NULL, NULL, NULL, 0 , NULL , NULL, NULL, NULL },
+#endif
};
if (!link_class(class_java_lang_String))
return false;
+#if defined(ENABLE_JAVASE)
if (!link_class(class_java_lang_Cloneable))
return false;
if (!link_class(class_java_io_Serializable))
return false;
+#endif
/* link classes for wrapping primitive types */
+#if defined(ENABLE_JAVASE)
if (!link_class(class_java_lang_Void))
return false;
+#endif
if (!link_class(class_java_lang_Boolean))
return false;
/* load some other important classes */
+#if defined(ENABLE_JAVASE)
if (!link_class(class_java_lang_ClassLoader))
return false;
if (!link_class(class_java_lang_SecurityManager))
return false;
+#endif
if (!link_class(class_java_lang_System))
return false;
if (!link_class(class_java_lang_Thread))
return false;
+#if defined(ENABLE_JAVASE)
if (!link_class(class_java_lang_ThreadGroup))
return false;
+#endif
+#if defined(WITH_CLASSPATH_GNU)
if (!link_class(class_java_lang_VMSystem))
return false;
if (!link_class(class_java_lang_VMThread))
return false;
+#endif
/* some classes which may be used more often */
+#if defined(ENABLE_JAVASE)
if (!link_class(class_java_lang_StackTraceElement))
return false;
if (!link_class(arrayclass_java_lang_Object))
return false;
+#endif
/* create pseudo classes used by the typechecker */
/* pseudo class for Arraystubs (extends java.lang.Object) */
-
+
pseudo_class_Arraystub =
class_create_classinfo(utf_new_char("$ARRAYSTUB$"));
- pseudo_class_Arraystub->state |= CLASS_LOADED;
- pseudo_class_Arraystub->super.cls = class_java_lang_Object;
- pseudo_class_Arraystub->interfacescount = 2;
- pseudo_class_Arraystub->interfaces = MNEW(classref_or_classinfo, 2);
+ pseudo_class_Arraystub->state |= CLASS_LOADED;
+ pseudo_class_Arraystub->super.cls = class_java_lang_Object;
+
+#if defined(ENABLE_JAVASE)
+ pseudo_class_Arraystub->interfacescount = 2;
+ pseudo_class_Arraystub->interfaces = MNEW(classref_or_classinfo, 2);
pseudo_class_Arraystub->interfaces[0].cls = class_java_lang_Cloneable;
pseudo_class_Arraystub->interfaces[1].cls = class_java_io_Serializable;
+#elif defined(ENABLE_JAVAME_CLDC1_1)
+ pseudo_class_Arraystub->interfacescount = 0;
+ pseudo_class_Arraystub->interfaces = NULL;
+#endif
if (!classcache_store_unique(pseudo_class_Arraystub)) {
log_text("could not cache pseudo_class_Arraystub");
Edwin Steiner
Christian Thalinger
- $Id: loader.c 6216 2006-12-18 18:21:37Z twisti $
+ $Id: loader.c 6251 2006-12-27 23:15:56Z twisti $
*/
if (!(class_java_lang_String = load_class_bootstrap(utf_java_lang_String)))
return false;
+#if defined(ENABLE_JAVASE)
if (!(class_java_lang_Cloneable =
load_class_bootstrap(utf_java_lang_Cloneable)))
return false;
if (!(class_java_io_Serializable =
load_class_bootstrap(utf_java_io_Serializable)))
return false;
-
+#endif
/* load classes for wrapping primitive types */
+#if defined(ENABLE_JAVASE)
if (!(class_java_lang_Void = load_class_bootstrap(utf_java_lang_Void)))
return false;
+#endif
if (!(class_java_lang_Boolean =
load_class_bootstrap(utf_java_lang_Boolean)))
if (!(class_java_lang_Class = load_class_bootstrap(utf_java_lang_Class)))
return false;
+#if defined(ENABLE_JAVASE)
if (!(class_java_lang_ClassLoader =
load_class_bootstrap(utf_java_lang_ClassLoader)))
return false;
if (!(class_java_lang_SecurityManager =
load_class_bootstrap(utf_java_lang_SecurityManager)))
return false;
+#endif
if (!(class_java_lang_System = load_class_bootstrap(utf_java_lang_System)))
return false;
load_class_bootstrap(utf_new_char("java/lang/Thread"))))
return false;
+#if defined(ENABLE_JAVASE)
if (!(class_java_lang_ThreadGroup =
load_class_bootstrap(utf_java_lang_ThreadGroup)))
return false;
+#endif
+#if defined(WITH_CLASSPATH_GNU)
if (!(class_java_lang_VMSystem =
load_class_bootstrap(utf_new_char("java/lang/VMSystem"))))
+
return false;
if (!(class_java_lang_VMThread =
load_class_bootstrap(utf_new_char("java/lang/VMThread"))))
return false;
+#endif
/* some classes which may be used more often */
+#if defined(ENABLE_JAVASE)
if (!(class_java_lang_StackTraceElement =
load_class_bootstrap(utf_java_lang_StackTraceElement)))
return false;
if (!(arrayclass_java_lang_Object =
load_class_bootstrap(utf_new_char("[Ljava/lang/Object;"))))
return false;
+#endif
return true;
}
m->linenumbers[l].line_number = suck_u2(cb);
}
}
+#if defined(ENABLE_JAVASE)
else if (code_attribute_name == utf_StackMapTable) {
/* StackTableMap */
if (!stackmap_load_attribute_stackmaptable(cb, m))
return false;
}
+#endif
else {
/* unknown code attribute */
}
assert(class_java_lang_Object);
+#if defined(ENABLE_JAVASE)
assert(class_java_lang_Cloneable);
assert(class_java_io_Serializable);
+#endif
/* setup the array class */
c->super.cls = class_java_lang_Object;
- c->interfacescount = 2;
+ c->interfacescount = 0;
+ c->interfaces = NULL;
+
+#if defined(ENABLE_JAVASE)
c->interfaces = MNEW(classref_or_classinfo, 2);
if (opt_eager) {
assert(tc->state & CLASS_LOADED);
list_add_first(&unlinkedclasses, tc);
c->interfaces[1].cls = tc;
-
- } else {
+ }
+ else {
c->interfaces[0].cls = class_java_lang_Cloneable;
c->interfaces[1].cls = class_java_io_Serializable;
}
+#endif
c->methodscount = 1;
c->methods = MNEW(methodinfo, c->methodscount);