* Merged in new trap code (twisti-branch).
authorChristian Thalinger <twisti@complang.tuwien.ac.at>
Mon, 28 Apr 2008 15:11:29 +0000 (17:11 +0200)
committerChristian Thalinger <twisti@complang.tuwien.ac.at>
Mon, 28 Apr 2008 15:11:29 +0000 (17:11 +0200)
73 files changed:
.hgignore
configure.ac
m4/jre-layout.m4
src/cacaoh/dummy.c
src/mm/boehm.c
src/mm/gc-common.h
src/native/vm/gnu/gnu_classpath_jdwp_VMFrame.c
src/native/vm/gnu/gnu_classpath_jdwp_VMMethod.c
src/native/vm/gnu/gnu_classpath_jdwp_VMVirtualMachine.c
src/native/vm/gnu/gnu_java_lang_management_VMMemoryMXBeanImpl.c
src/native/vm/gnu/java_lang_VMClass.c
src/native/vm/gnu/java_lang_VMClassLoader.c
src/native/vm/gnu/java_lang_VMSystem.c
src/native/vm/gnu/java_lang_reflect_VMMethod.c
src/threads/posix/lock.c
src/vm/jit/codegen-common.c
src/vm/jit/m68k/codegen.c
src/vm/jit/mips/linux/md-os.c
src/vm/jit/trace.c
src/vm/vm.c
src/vmcore/method.h
tests/Makefile.am
tests/regression/Makefile.am
tests/regression/bugzilla/Makefile.am
tests/regression/clinitexception.2output [deleted file]
tests/regression/clinitexception.java [deleted file]
tests/regression/codepatching/Makefile.am [deleted file]
tests/regression/codepatching/aastoreconstClass.java [deleted file]
tests/regression/codepatching/checkcastC.java [deleted file]
tests/regression/codepatching/checkcastI.java [deleted file]
tests/regression/codepatching/getfieldD.java [deleted file]
tests/regression/codepatching/getfieldF.java [deleted file]
tests/regression/codepatching/getfieldI.java [deleted file]
tests/regression/codepatching/getfieldJ.java [deleted file]
tests/regression/codepatching/getfieldL.java [deleted file]
tests/regression/codepatching/getstaticD.java [deleted file]
tests/regression/codepatching/getstaticF.java [deleted file]
tests/regression/codepatching/getstaticI.java [deleted file]
tests/regression/codepatching/getstaticJ.java [deleted file]
tests/regression/codepatching/getstaticL.java [deleted file]
tests/regression/codepatching/instanceofC.java [deleted file]
tests/regression/codepatching/instanceofI.java [deleted file]
tests/regression/codepatching/invokespecial.java [deleted file]
tests/regression/codepatching/invokestatic.java [deleted file]
tests/regression/codepatching/multianewarray.java [deleted file]
tests/regression/codepatching/newarray.java [deleted file]
tests/regression/codepatching/putfieldD.java [deleted file]
tests/regression/codepatching/putfieldF.java [deleted file]
tests/regression/codepatching/putfieldI.java [deleted file]
tests/regression/codepatching/putfieldJ.java [deleted file]
tests/regression/codepatching/putfieldL.java [deleted file]
tests/regression/codepatching/putfieldconstC.java [deleted file]
tests/regression/codepatching/putfieldconstD.java [deleted file]
tests/regression/codepatching/putfieldconstF.java [deleted file]
tests/regression/codepatching/putfieldconstI.java [deleted file]
tests/regression/codepatching/putfieldconstJ.java [deleted file]
tests/regression/codepatching/putfieldconstL.java [deleted file]
tests/regression/codepatching/putstaticD.java [deleted file]
tests/regression/codepatching/putstaticF.java [deleted file]
tests/regression/codepatching/putstaticI.java [deleted file]
tests/regression/codepatching/putstaticJ.java [deleted file]
tests/regression/codepatching/putstaticL.java [deleted file]
tests/regression/codepatching/putstaticconstC.java [deleted file]
tests/regression/codepatching/putstaticconstD.java [deleted file]
tests/regression/codepatching/putstaticconstF.java [deleted file]
tests/regression/codepatching/putstaticconstI.java [deleted file]
tests/regression/codepatching/putstaticconstJ.java [deleted file]
tests/regression/codepatching/putstaticconstL.java [deleted file]
tests/regression/codepatching/test.java [deleted file]
tests/regression/junit/All.java [new file with mode: 0644]
tests/regression/junit/Makefile.am [new file with mode: 0644]
tests/regression/junit/TestExceptionInStaticClassInitializer.java [new file with mode: 0644]
tests/regression/junit/TestPatcher.java [new file with mode: 0644]

index 751e5c858c8e804c4327135d019a2d30bb09425f..e891ef1d10c48faa5697ba8b3b7310efaa0a282f 100644 (file)
--- a/.hgignore
+++ b/.hgignore
@@ -44,8 +44,8 @@ tests/regression/*.class
 tests/regression/assertion/*.class
 tests/regression/assertion/packagetest/*.class
 tests/regression/bugzilla/*.class
-tests/regression/codepatching/*.class
 tests/regression/jasmin/*.class
+tests/regression/junit/*.class
 tests/regression/native/*.class
 tests/regression/native/*.h
 tests/regression/native/*.so
index 670e163d6a76cb28b87ad0d34c1f97243ff28358..55eae66b723f8f76f5b61c651d256536aac8a35b 100644 (file)
@@ -23,7 +23,7 @@ dnl 02110-1301, USA.
 dnl Process this file with autoconf to produce a configure script.
 
 
-AC_INIT(cacao, 0.98+svn, cacao@cacaojvm.org)
+AC_INIT(cacao, 0.99rc2, cacao@cacaojvm.org)
 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
 AC_CANONICAL_HOST
 AC_PREREQ(2.59)
@@ -919,9 +919,9 @@ AC_CONFIG_FILES([Makefile]
                [tests/Makefile]
                [tests/regression/Makefile]
                [tests/regression/bugzilla/Makefile]
-               [tests/regression/codepatching/Makefile]
                [tests/regression/assertion/Makefile]
                [tests/regression/jasmin/Makefile]
+               [tests/regression/junit/Makefile]
                [tests/regression/native/Makefile]
                [tests/regression/resolving/Makefile]
                [tests/regression/resolving/classes1/Makefile]
index 1f563e85630f2541f0dc329aeaa672a470df389a..25c08b5b70e0ed858507ec0075156e69ae73de9e 100644 (file)
@@ -1,9 +1,7 @@
 dnl m4/jre-layout.m4
 dnl
-dnl Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel,
-dnl C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
-dnl E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
-dnl J. Wenninger, Institut f. Computersprachen - TU Wien
+dnl Copyright (C) 2007, 2008
+dnl CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 dnl 
 dnl This file is part of CACAO.
 dnl 
@@ -29,7 +27,7 @@ AC_DEFUN([AC_CHECK_WITH_JRE_LAYOUT],[
 AC_MSG_CHECKING(if we compile for a JRE-style directory layout)
 AC_ARG_WITH([jre-layout],
             [AS_HELP_STRING(--with-jre-layout,compile for JRE-style directory layout [[default=no]])],
-            [case "${enableval}" in
+            [case "${withval}" in
                 yes)
                     WITH_JRE_LAYOUT=yes
                     AC_DEFINE([WITH_JRE_LAYOUT], 1, [with JRE layout])
index e33f64f3d790120dd0e089b7011199c11920b5f7..945f209568a2da024d3923988d595c8ccea572b7 100644 (file)
@@ -32,6 +32,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "mm/gc-common.h"
 #include "mm/memory.h"
 
 #include "native/llni.h"
@@ -461,7 +462,7 @@ int64_t gc_get_max_heap_size(void)
 
 /* heap ***********************************************************************/
 
-void *heap_alloc_uncollectable(uint32_t bytelength)
+void *heap_alloc_uncollectable(size_t bytelength)
 {
        return calloc(bytelength, 1);
 }
index 7d0ef6fd53a93563e2cb1d46320683e885cc3df3..ab0fc912e53e6779ad8414d17a80ac136e6d9761 100644 (file)
@@ -117,7 +117,7 @@ static void gc_ignore_warnings(char *msg, GC_word arg)
 }
 
 
-void *heap_alloc_uncollectable(u4 size)
+void *heap_alloc_uncollectable(size_t size)
 {
        void *p;
 
index f3b6ff9259c19f10a28a78952173e691d8b97987..7bdf5cb57bfd70d6faebdce7adda481f3e1f3b42 100644 (file)
@@ -1,9 +1,7 @@
 /* src/mm/gc-common.h - gc independant interface for heap managment
 
-   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.
 
@@ -56,7 +54,7 @@ enum {
 
 void  gc_init(u4 heapmaxsize, u4 heapstartsize);
 
-void *heap_alloc_uncollectable(u4 size);
+void *heap_alloc_uncollectable(size_t size);
 void *heap_alloc(u4 size, u4 references, methodinfo *finalizer, bool collect);
 void  heap_free(void *p);
 
index 7d428de8e69238938a9d739cc9c50bf567b131f5..e647e4d940e81a9a47d05b95fcde3f0701693496 100644 (file)
@@ -1,48 +1,49 @@
-/* src/native/vm/VMFrame.c - jdwp->jvmti interface
+/* src/native/vm/gnu/gnu_classpath_jdwp_VMFrame.c - jdwp->jvmti interface
 
-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.
+   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 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.
+   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.
+   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: Martin Platter
 
-Changes:
+#include "config.h"
 
-*/
+#include <stdint.h>
 
-#include "toolbox/logging.h"
 #include "native/jni.h"
+
+#include "native/include/java_lang_Object.h"
 #include "native/include/gnu_classpath_jdwp_VMFrame.h"
 
+#include "toolbox/logging.h"
+
 
 /*
  * Class:     gnu/classpath/jdwp/VMFrame
  * Method:    getValue
  * Signature: (I)Ljava/lang/Object;
  */
-JNIEXPORT struct java_lang_Object* JNICALL Java_gnu_classpath_jdwp_VMFrame_getValue(JNIEnv *env, struct gnu_classpath_jdwp_VMFrame* this, s4 par1) {
-    log_text ("JVMTI-Call: IMPLEMENT ME!!!");
-    return 0;
+JNIEXPORT java_lang_Object* JNICALL Java_gnu_classpath_jdwp_VMFrame_getValue(JNIEnv *env, gnu_classpath_jdwp_VMFrame* this, int32_t par1)
+{
+       log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+       return 0;
 }
 
 
@@ -51,7 +52,23 @@ JNIEXPORT struct java_lang_Object* JNICALL Java_gnu_classpath_jdwp_VMFrame_getVa
  * Method:    setValue
  * Signature: (ILjava/lang/Object;)V
  */
-JNIEXPORT void JNICALL Java_gnu_classpath_jdwp_VMFrame_setValue(JNIEnv *env, struct gnu_classpath_jdwp_VMFrame* this, s4 par1, struct java_lang_Object* par2) {
-    log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+JNIEXPORT void JNICALL Java_gnu_classpath_jdwp_VMFrame_setValue(JNIEnv *env, gnu_classpath_jdwp_VMFrame* this, int32_t par1, java_lang_Object* par2)
+{
+       log_text ("JVMTI-Call: IMPLEMENT ME!!!");
        return 0;
 }
+
+
+/*
+ * 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 cce58eb8dbfedadf4646f648f9ef8774060b3003..54ff53478a647926d4dce1029cc3a94d181551c8 100644 (file)
@@ -1,39 +1,36 @@
-/* src/native/vm/VMMethod.c - jdwp->jvmti interface
+/* src/native/vm/gnu/gnu_classpath_jdwp_VMMethod.c - jdwp->jvmti interface
 
-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.
+   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 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.
+   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.
+   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: Samuel Vinson
-         Martin Platter
-         
-
-Changes: 
 
+#include "config.h"
 
+#include <stdint.h>
 
 #include "native/jni.h"
+
 #include "native/include/gnu_classpath_jdwp_VMMethod.h"
+
 #include "native/jvmti/jvmti.h"
 #include "native/jvmti/VMjdwp.h"
 
@@ -55,7 +52,7 @@ void printjvmtierror(char *desc, jvmtiError err) {
  * Method:    getName
  * Signature: ()Ljava/lang/String;
  */
-JNIEXPORT struct java_lang_String* JNICALL Java_gnu_classpath_jdwp_VMMethod_getName(JNIEnv *env, struct gnu_classpath_jdwp_VMMethod* this) 
+JNIEXPORT struct java_lang_String* JNICALL Java_gnu_classpath_jdwp_VMMethod_getName(JNIEnv *env, gnu_classpath_jdwp_VMMethod* this) 
 {
     jvmtiError err;
     char *name;
@@ -81,7 +78,7 @@ JNIEXPORT struct java_lang_String* JNICALL Java_gnu_classpath_jdwp_VMMethod_getN
  * Method:    getSignature
  * Signature: ()Ljava/lang/String;
  */
-JNIEXPORT struct java_lang_String* JNICALL Java_gnu_classpath_jdwp_VMMethod_getSignature(JNIEnv *env, struct gnu_classpath_jdwp_VMMethod* this) 
+JNIEXPORT struct java_lang_String* JNICALL Java_gnu_classpath_jdwp_VMMethod_getSignature(JNIEnv *env, gnu_classpath_jdwp_VMMethod* this) 
 {
     jvmtiError err;
     char *signature;
@@ -107,7 +104,7 @@ JNIEXPORT struct java_lang_String* JNICALL Java_gnu_classpath_jdwp_VMMethod_getS
  * Method:    getModifiers
  * Signature: ()I
  */
-JNIEXPORT s4 JNICALL Java_gnu_classpath_jdwp_VMMethod_getModifiers(JNIEnv *env, struct gnu_classpath_jdwp_VMMethod* this) 
+JNIEXPORT int32_t JNICALL Java_gnu_classpath_jdwp_VMMethod_getModifiers(JNIEnv *env, gnu_classpath_jdwp_VMMethod* this) 
 {
     jvmtiError err;
     jint modifiers;
index eb5a4287bacb2e281e5a74fa83c2e98bd81f807b..9e06a6b57b737eb72827bb27444d8296e3118aa1 100644 (file)
@@ -1,34 +1,32 @@
-/* src/native/vm/VMVirtualMachine.c - jdwp->jvmti interface
+/* src/native/vm/gnu/gnu_classpath_jdwp_VMVirtualMachine.c - jdwp->jvmti interface
 
-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.
+   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 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.
+   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.
+   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: Martin Platter
 
-Changes: Samuel Vinson
+#include "config.h"
 
-*/
+#include <stdint.h>
+#include <string.h>
 
 #include "toolbox/logging.h"
 #include "native/jni.h"
@@ -41,7 +39,6 @@ Changes: Samuel Vinson
 #include "native/include/gnu_classpath_jdwp_VMVirtualMachine.h"
 #include "native/jvmti/jvmti.h"
 #include "native/jvmti/VMjdwp.h"
-#include <string.h>
 
 
 /*
@@ -76,7 +73,7 @@ JNIEXPORT void JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_resumeThread(JNI
  * Method:    getSuspendCount
  * Signature: (Ljava/lang/Thread;)I
  */
-JNIEXPORT s4 JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getSuspendCount(JNIEnv *env, jclass clazz, struct java_lang_Thread* par1) {
+JNIEXPORT int32_t JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getSuspendCount(JNIEnv *env, jclass clazz, struct java_lang_Thread* par1) {
     log_text ("VMVirtualMachine_getSuspendCount: not supported");
        return 1;
 }
@@ -86,7 +83,7 @@ JNIEXPORT s4 JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getSuspendCount(JN
  * Method:    getAllLoadedClassesCount
  * Signature: ()I
  */
-JNIEXPORT s4 JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getAllLoadedClassesCount(JNIEnv *env, jclass clazz) {
+JNIEXPORT int32_t JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getAllLoadedClassesCount(JNIEnv *env, jclass clazz) {
     jint count;
     jclass* classes;
        jvmtiError err;
@@ -157,7 +154,7 @@ JNIEXPORT struct java_util_Iterator* JNICALL Java_gnu_classpath_jdwp_VMVirtualMa
  * Method:    getClassStatus
  * Signature: (Ljava/lang/Class;)I
  */
-JNIEXPORT s4 JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getClassStatus(JNIEnv *env, jclass clazz, struct java_lang_Class* par1) {
+JNIEXPORT int32_t JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getClassStatus(JNIEnv *env, jclass clazz, struct java_lang_Class* par1) {
        jint status;
        jvmtiError err;
 
@@ -237,7 +234,7 @@ JNIEXPORT struct gnu_classpath_jdwp_VMMethod* JNICALL Java_gnu_classpath_jdwp_VM
  * Method:    getFrames
  * Signature: (Ljava/lang/Thread;II)Ljava/util/ArrayList;
  */
-JNIEXPORT struct java_util_ArrayList* JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getFrames(JNIEnv *env, jclass clazz, struct java_lang_Thread* par1, s4 par2, s4 par3) {
+JNIEXPORT struct java_util_ArrayList* JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getFrames(JNIEnv *env, jclass clazz, struct java_lang_Thread* par1, int32_t par2, int32_t par3) {
     log_text ("VMVirtualMachine_getFrames - IMPLEMENT ME!!!");
 /*     jclass ec = (*env)->FindClass(env,"gnu/classpath/jdwp/JdwpInternalErrorException");
        if (JVMTI_ERROR_NONE != (*jvmtienv)->GetClassStatus(jvmtienv, par1, &status))
@@ -262,7 +259,7 @@ JNIEXPORT struct gnu_classpath_jdwp_VMFrame* JNICALL Java_gnu_classpath_jdwp_VMV
  * Method:    getFrameCount
  * Signature: (Ljava/lang/Thread;)I
  */
-JNIEXPORT s4 JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getFrameCount(JNIEnv *env, jclass clazz, struct java_lang_Thread* par1) {
+JNIEXPORT int32_t JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getFrameCount(JNIEnv *env, jclass clazz, struct java_lang_Thread* par1) {
        jint count;
        jvmtiError err;
        err = (*jvmtienv)->GetFrameCount(jvmtienv, (jthread)par1, &count);
@@ -276,7 +273,7 @@ JNIEXPORT s4 JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getFrameCount(JNIE
  * Method:    getThreadStatus
  * Signature: (Ljava/lang/Thread;)I
  */
-JNIEXPORT s4 JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getThreadStatus(JNIEnv *env, jclass clazz, struct java_lang_Thread* par1) {
+JNIEXPORT int32_t JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_getThreadStatus(JNIEnv *env, jclass clazz, struct java_lang_Thread* par1) {
        jint status;
        jvmtiError err; 
        if (JVMTI_ERROR_NONE != (err = (*jvmtienv)->GetThreadState(jvmtienv, (jthread)par1, &status))) {
@@ -316,7 +313,7 @@ JNIEXPORT struct java_util_ArrayList* JNICALL Java_gnu_classpath_jdwp_VMVirtualM
  * Method:    executeMethod
  * Signature: (Ljava/lang/Object;Ljava/lang/Thread;Ljava/lang/Class;Ljava/lang/reflect/Method;[Ljava/lang/Object;Z)Lgnu/classpath/jdwp/util/MethodResult;
  */
-JNIEXPORT struct gnu_classpath_jdwp_util_MethodResult* JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_executeMethod(JNIEnv *env, jclass clazz, struct java_lang_Object* par1, struct java_lang_Thread* par2, struct java_lang_Class* par3, struct java_lang_reflect_Method* par4, java_objectarray* par5, s4 par6) {
+JNIEXPORT struct gnu_classpath_jdwp_util_MethodResult* JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_executeMethod(JNIEnv *env, jclass clazz, struct java_lang_Object* par1, struct java_lang_Thread* par2, struct java_lang_Class* par3, struct java_lang_reflect_Method* par4, java_objectarray* par5, int32_t par6) {
     log_text ("VMVirtualMachine_executeMethod");
        return 0;
 }
@@ -421,7 +418,7 @@ JNIEXPORT void JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_unregisterEvent(
  * Method:    clearEvents
  * Signature: (B)V
  */
-JNIEXPORT void JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_clearEvents(JNIEnv *env, jclass clazz, s4 par1) {
+JNIEXPORT void JNICALL Java_gnu_classpath_jdwp_VMVirtualMachine_clearEvents(JNIEnv *env, jclass clazz, int32_t par1) {
        /* jvmti events are not saved - there is nothing to clear */
 }
 
index b203a73a5728fdd58cc90e68790e29dd97a3fdc0..4c05838d9e9b632ec6360fe9e3b48aa976601146 100644 (file)
@@ -1,9 +1,7 @@
 /* src/native/vm/gnu/gnu_java_lang_management_VMMemoryMXBeanImpl.c
 
-   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.
 
@@ -26,7 +24,8 @@
 
 
 #include "config.h"
-#include "vm/types.h"
+
+#include <stdint.h>
 
 #include "mm/gc-common.h"
 
 /* native methods implemented by this file ************************************/
 
 static JNINativeMethod methods[] = {
-       { "getHeapMemoryUsage",                "()Ljava/lang/management/MemoryUsage;", (void *) (ptrint) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getHeapMemoryUsage                },
-       { "getNonHeapMemoryUsage",             "()Ljava/lang/management/MemoryUsage;", (void *) (ptrint) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getNonHeapMemoryUsage             },
-       { "getObjectPendingFinalizationCount", "()I",                                  (void *) (ptrint) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getObjectPendingFinalizationCount },
-       { "isVerbose",                         "()Z",                                  (void *) (ptrint) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_isVerbose                         },
-       { "setVerbose",                        "(Z)V",                                 (void *) (ptrint) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_setVerbose                        },
+       { "getHeapMemoryUsage",                "()Ljava/lang/management/MemoryUsage;", (void *) (uintptr_t) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getHeapMemoryUsage                },
+       { "getNonHeapMemoryUsage",             "()Ljava/lang/management/MemoryUsage;", (void *) (uintptr_t) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getNonHeapMemoryUsage             },
+       { "getObjectPendingFinalizationCount", "()I",                                  (void *) (uintptr_t) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getObjectPendingFinalizationCount },
+       { "isVerbose",                         "()Z",                                  (void *) (uintptr_t) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_isVerbose                         },
+       { "setVerbose",                        "(Z)V",                                 (void *) (uintptr_t) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_setVerbose                        },
 };
 
 
@@ -84,10 +83,10 @@ JNIEXPORT java_lang_management_MemoryUsage* JNICALL Java_gnu_java_lang_managemen
        java_handle_t                    *o;
        java_lang_management_MemoryUsage *mu;
        methodinfo                       *m;
-       s8                                init;
-       s8                                used;
-       s8                                commited;
-       s8                                maximum;
+       int64_t                           init;
+       int64_t                           used;
+       int64_t                           commited;
+       int64_t                           maximum;
 
        /* get the class */
        /* XXX optimize me! sometime... */
@@ -150,7 +149,7 @@ JNIEXPORT java_lang_management_MemoryUsage* JNICALL Java_gnu_java_lang_managemen
  * Method:    getObjectPendingFinalizationCount
  * Signature: ()I
  */
-JNIEXPORT s4 JNICALL Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getObjectPendingFinalizationCount(JNIEnv *env, jclass clazz)
+JNIEXPORT int32_t JNICALL Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getObjectPendingFinalizationCount(JNIEnv *env, jclass clazz)
 {
        log_println("Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getObjectPendingFinalizationCount: IMPLEMENT ME!");
 
@@ -163,7 +162,7 @@ JNIEXPORT s4 JNICALL Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getObjectP
  * Method:    isVerbose
  * Signature: ()Z
  */
-JNIEXPORT s4 JNICALL Java_gnu_java_lang_management_VMMemoryMXBeanImpl_isVerbose(JNIEnv *env, jclass clazz)
+JNIEXPORT int32_t JNICALL Java_gnu_java_lang_management_VMMemoryMXBeanImpl_isVerbose(JNIEnv *env, jclass clazz)
 {
        return _Jv_jvm->Java_gnu_java_lang_management_VMMemoryMXBeanImpl_verbose;
 }
@@ -174,7 +173,7 @@ JNIEXPORT s4 JNICALL Java_gnu_java_lang_management_VMMemoryMXBeanImpl_isVerbose(
  * Method:    setVerbose
  * Signature: (Z)V
  */
-JNIEXPORT void JNICALL Java_gnu_java_lang_management_VMMemoryMXBeanImpl_setVerbose(JNIEnv *env, jclass clazz, s4 verbose)
+JNIEXPORT void JNICALL Java_gnu_java_lang_management_VMMemoryMXBeanImpl_setVerbose(JNIEnv *env, jclass clazz, int32_t verbose)
 {
        _Jv_jvm->Java_gnu_java_lang_management_VMMemoryMXBeanImpl_verbose = verbose;
 }
index 7195bda0fb87af45d5033b23880f44b498f8b0ae..886a3ced0efcc183ea17f09a06750c34e842862a 100644 (file)
@@ -27,8 +27,6 @@
 
 #include <stdint.h>
 
-#include "vm/types.h"
-
 #include "native/jni.h"
 #include "native/llni.h"
 #include "native/native.h"
 /* native methods implemented by this file ************************************/
 
 static JNINativeMethod methods[] = {
-       { "isInstance",              "(Ljava/lang/Class;Ljava/lang/Object;)Z",                        (void *) (ptrint) &Java_java_lang_VMClass_isInstance              },
-       { "isAssignableFrom",        "(Ljava/lang/Class;Ljava/lang/Class;)Z",                         (void *) (ptrint) &Java_java_lang_VMClass_isAssignableFrom        },
-       { "isInterface",             "(Ljava/lang/Class;)Z",                                          (void *) (ptrint) &Java_java_lang_VMClass_isInterface             },
-       { "isPrimitive",             "(Ljava/lang/Class;)Z",                                          (void *) (ptrint) &Java_java_lang_VMClass_isPrimitive             },
-       { "getName",                 "(Ljava/lang/Class;)Ljava/lang/String;",                         (void *) (ptrint) &Java_java_lang_VMClass_getName                 },
-       { "getSuperclass",           "(Ljava/lang/Class;)Ljava/lang/Class;",                          (void *) (ptrint) &Java_java_lang_VMClass_getSuperclass           },
-       { "getInterfaces",           "(Ljava/lang/Class;)[Ljava/lang/Class;",                         (void *) (ptrint) &Java_java_lang_VMClass_getInterfaces           },
-       { "getComponentType",        "(Ljava/lang/Class;)Ljava/lang/Class;",                          (void *) (ptrint) &Java_java_lang_VMClass_getComponentType        },
-       { "getModifiers",            "(Ljava/lang/Class;Z)I",                                         (void *) (ptrint) &Java_java_lang_VMClass_getModifiers            },
-       { "getDeclaringClass",       "(Ljava/lang/Class;)Ljava/lang/Class;",                          (void *) (ptrint) &Java_java_lang_VMClass_getDeclaringClass       },
-       { "getDeclaredClasses",      "(Ljava/lang/Class;Z)[Ljava/lang/Class;",                        (void *) (ptrint) &Java_java_lang_VMClass_getDeclaredClasses      },
-       { "getDeclaredFields",       "(Ljava/lang/Class;Z)[Ljava/lang/reflect/Field;",                (void *) (ptrint) &Java_java_lang_VMClass_getDeclaredFields       },
-       { "getDeclaredMethods",      "(Ljava/lang/Class;Z)[Ljava/lang/reflect/Method;",               (void *) (ptrint) &Java_java_lang_VMClass_getDeclaredMethods      },
-       { "getDeclaredConstructors", "(Ljava/lang/Class;Z)[Ljava/lang/reflect/Constructor;",          (void *) (ptrint) &Java_java_lang_VMClass_getDeclaredConstructors },
-       { "getClassLoader",          "(Ljava/lang/Class;)Ljava/lang/ClassLoader;",                    (void *) (ptrint) &Java_java_lang_VMClass_getClassLoader          },
-       { "forName",                 "(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;", (void *) (ptrint) &Java_java_lang_VMClass_forName                 },
-       { "isArray",                 "(Ljava/lang/Class;)Z",                                          (void *) (ptrint) &Java_java_lang_VMClass_isArray                 },
-       { "throwException",          "(Ljava/lang/Throwable;)V",                                      (void *) (ptrint) &Java_java_lang_VMClass_throwException          },
+       { "isInstance",              "(Ljava/lang/Class;Ljava/lang/Object;)Z",                        (void *) (uintptr_t) &Java_java_lang_VMClass_isInstance              },
+       { "isAssignableFrom",        "(Ljava/lang/Class;Ljava/lang/Class;)Z",                         (void *) (uintptr_t) &Java_java_lang_VMClass_isAssignableFrom        },
+       { "isInterface",             "(Ljava/lang/Class;)Z",                                          (void *) (uintptr_t) &Java_java_lang_VMClass_isInterface             },
+       { "isPrimitive",             "(Ljava/lang/Class;)Z",                                          (void *) (uintptr_t) &Java_java_lang_VMClass_isPrimitive             },
+       { "getName",                 "(Ljava/lang/Class;)Ljava/lang/String;",                         (void *) (uintptr_t) &Java_java_lang_VMClass_getName                 },
+       { "getSuperclass",           "(Ljava/lang/Class;)Ljava/lang/Class;",                          (void *) (uintptr_t) &Java_java_lang_VMClass_getSuperclass           },
+       { "getInterfaces",           "(Ljava/lang/Class;)[Ljava/lang/Class;",                         (void *) (uintptr_t) &Java_java_lang_VMClass_getInterfaces           },
+       { "getComponentType",        "(Ljava/lang/Class;)Ljava/lang/Class;",                          (void *) (uintptr_t) &Java_java_lang_VMClass_getComponentType        },
+       { "getModifiers",            "(Ljava/lang/Class;Z)I",                                         (void *) (uintptr_t) &Java_java_lang_VMClass_getModifiers            },
+       { "getDeclaringClass",       "(Ljava/lang/Class;)Ljava/lang/Class;",                          (void *) (uintptr_t) &Java_java_lang_VMClass_getDeclaringClass       },
+       { "getDeclaredClasses",      "(Ljava/lang/Class;Z)[Ljava/lang/Class;",                        (void *) (uintptr_t) &Java_java_lang_VMClass_getDeclaredClasses      },
+       { "getDeclaredFields",       "(Ljava/lang/Class;Z)[Ljava/lang/reflect/Field;",                (void *) (uintptr_t) &Java_java_lang_VMClass_getDeclaredFields       },
+       { "getDeclaredMethods",      "(Ljava/lang/Class;Z)[Ljava/lang/reflect/Method;",               (void *) (uintptr_t) &Java_java_lang_VMClass_getDeclaredMethods      },
+       { "getDeclaredConstructors", "(Ljava/lang/Class;Z)[Ljava/lang/reflect/Constructor;",          (void *) (uintptr_t) &Java_java_lang_VMClass_getDeclaredConstructors },
+       { "getClassLoader",          "(Ljava/lang/Class;)Ljava/lang/ClassLoader;",                    (void *) (uintptr_t) &Java_java_lang_VMClass_getClassLoader          },
+       { "forName",                 "(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;", (void *) (uintptr_t) &Java_java_lang_VMClass_forName                 },
+       { "isArray",                 "(Ljava/lang/Class;)Z",                                          (void *) (uintptr_t) &Java_java_lang_VMClass_isArray                 },
+       { "throwException",          "(Ljava/lang/Throwable;)V",                                      (void *) (uintptr_t) &Java_java_lang_VMClass_throwException          },
 #if defined(WITH_CLASSPATH_GNU) && defined(ENABLE_ANNOTATIONS)
-       { "getDeclaredAnnotations",  "(Ljava/lang/Class;)[Ljava/lang/annotation/Annotation;",         (void *) (ptrint) &Java_java_lang_VMClass_getDeclaredAnnotations  },
+       { "getDeclaredAnnotations",  "(Ljava/lang/Class;)[Ljava/lang/annotation/Annotation;",         (void *) (uintptr_t) &Java_java_lang_VMClass_getDeclaredAnnotations  },
 #endif
-       { "getEnclosingClass",       "(Ljava/lang/Class;)Ljava/lang/Class;",                          (void *) (ptrint) &Java_java_lang_VMClass_getEnclosingClass       },
-       { "getEnclosingConstructor", "(Ljava/lang/Class;)Ljava/lang/reflect/Constructor;",            (void *) (ptrint) &Java_java_lang_VMClass_getEnclosingConstructor },
-       { "getEnclosingMethod",      "(Ljava/lang/Class;)Ljava/lang/reflect/Method;",                 (void *) (ptrint) &Java_java_lang_VMClass_getEnclosingMethod      },
-       { "getClassSignature",       "(Ljava/lang/Class;)Ljava/lang/String;",                         (void *) (ptrint) &Java_java_lang_VMClass_getClassSignature       },
-       { "isAnonymousClass",        "(Ljava/lang/Class;)Z",                                          (void *) (ptrint) &Java_java_lang_VMClass_isAnonymousClass        },
-       { "isLocalClass",            "(Ljava/lang/Class;)Z",                                          (void *) (ptrint) &Java_java_lang_VMClass_isLocalClass            },
-       { "isMemberClass",           "(Ljava/lang/Class;)Z",                                          (void *) (ptrint) &Java_java_lang_VMClass_isMemberClass           },
+       { "getEnclosingClass",       "(Ljava/lang/Class;)Ljava/lang/Class;",                          (void *) (uintptr_t) &Java_java_lang_VMClass_getEnclosingClass       },
+       { "getEnclosingConstructor", "(Ljava/lang/Class;)Ljava/lang/reflect/Constructor;",            (void *) (uintptr_t) &Java_java_lang_VMClass_getEnclosingConstructor },
+       { "getEnclosingMethod",      "(Ljava/lang/Class;)Ljava/lang/reflect/Method;",                 (void *) (uintptr_t) &Java_java_lang_VMClass_getEnclosingMethod      },
+       { "getClassSignature",       "(Ljava/lang/Class;)Ljava/lang/String;",                         (void *) (uintptr_t) &Java_java_lang_VMClass_getClassSignature       },
+       { "isAnonymousClass",        "(Ljava/lang/Class;)Z",                                          (void *) (uintptr_t) &Java_java_lang_VMClass_isAnonymousClass        },
+       { "isLocalClass",            "(Ljava/lang/Class;)Z",                                          (void *) (uintptr_t) &Java_java_lang_VMClass_isLocalClass            },
+       { "isMemberClass",           "(Ljava/lang/Class;)Z",                                          (void *) (uintptr_t) &Java_java_lang_VMClass_isMemberClass           },
 };
 
 
@@ -113,7 +111,7 @@ void _Jv_java_lang_VMClass_init(void)
  * Method:    isInstance
  * Signature: (Ljava/lang/Class;Ljava/lang/Object;)Z
  */
-JNIEXPORT s4 JNICALL Java_java_lang_VMClass_isInstance(JNIEnv *env, jclass clazz, java_lang_Class *klass, java_lang_Object *o)
+JNIEXPORT int32_t JNICALL Java_java_lang_VMClass_isInstance(JNIEnv *env, jclass clazz, java_lang_Class *klass, java_lang_Object *o)
 {
        classinfo     *c;
        java_handle_t *h;
@@ -152,7 +150,7 @@ JNIEXPORT int32_t JNICALL Java_java_lang_VMClass_isAssignableFrom(JNIEnv *env, j
  * Method:    isInterface
  * Signature: (Ljava/lang/Class;)Z
  */
-JNIEXPORT s4 JNICALL Java_java_lang_VMClass_isInterface(JNIEnv *env, jclass clazz, java_lang_Class *klass)
+JNIEXPORT int32_t JNICALL Java_java_lang_VMClass_isInterface(JNIEnv *env, jclass clazz, java_lang_Class *klass)
 {
        classinfo *c;
 
@@ -323,7 +321,7 @@ JNIEXPORT java_handle_objectarray_t* JNICALL Java_java_lang_VMClass_getDeclaredF
  * Method:    getDeclaredMethods
  * Signature: (Ljava/lang/Class;Z)[Ljava/lang/reflect/Method;
  */
-JNIEXPORT java_handle_objectarray_t* JNICALL Java_java_lang_VMClass_getDeclaredMethods(JNIEnv *env, jclass clazz, java_lang_Class *klass, s4 publicOnly)
+JNIEXPORT java_handle_objectarray_t* JNICALL Java_java_lang_VMClass_getDeclaredMethods(JNIEnv *env, jclass clazz, java_lang_Class *klass, int32_t publicOnly)
 {
        classinfo                 *c;
        java_handle_objectarray_t *oa;
@@ -341,7 +339,7 @@ JNIEXPORT java_handle_objectarray_t* JNICALL Java_java_lang_VMClass_getDeclaredM
  * Method:    getDeclaredConstructors
  * Signature: (Ljava/lang/Class;Z)[Ljava/lang/reflect/Constructor;
  */
-JNIEXPORT java_handle_objectarray_t* JNICALL Java_java_lang_VMClass_getDeclaredConstructors(JNIEnv *env, jclass clazz, java_lang_Class *klass, s4 publicOnly)
+JNIEXPORT java_handle_objectarray_t* JNICALL Java_java_lang_VMClass_getDeclaredConstructors(JNIEnv *env, jclass clazz, java_lang_Class *klass, int32_t publicOnly)
 {
        classinfo                 *c;
        java_handle_objectarray_t *oa;
@@ -376,14 +374,14 @@ JNIEXPORT java_lang_ClassLoader* JNICALL Java_java_lang_VMClass_getClassLoader(J
  * Method:    forName
  * Signature: (Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;
  */
-JNIEXPORT java_lang_Class* JNICALL Java_java_lang_VMClass_forName(JNIEnv *env, jclass clazz, java_lang_String *name, s4 initialize, java_lang_ClassLoader *loader)
+JNIEXPORT java_lang_Class* JNICALL Java_java_lang_VMClass_forName(JNIEnv *env, jclass clazz, java_lang_String *name, int32_t initialize, java_lang_ClassLoader *loader)
 {
        classloader_t *cl;
        utf           *ufile;
        utf           *uname;
        classinfo     *c;
        u2            *pos;
-       s4             i;
+       int32_t        i;
 
        cl = loader_hashtable_classloader_add((java_handle_t *) loader);
 
index ccf39075119851becaba4a4d5849f585cfd42b01..7df215ca4a8ddbf57f5e43fc34fa53647a1f300d 100644 (file)
 #include "config.h"
 
 #include <assert.h>
+#include <stdint.h>
 #include <sys/stat.h>
 
-#include "vm/types.h"
-
 #include "mm/memory.h"
 
 #include "native/jni.h"
 /* native methods implemented by this file ************************************/
 
 static JNINativeMethod methods[] = {
-       { "defineClass",                "(Ljava/lang/ClassLoader;Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class;", (void *) (ptrint) &Java_java_lang_VMClassLoader_defineClass                },
-       { "getPrimitiveClass",          "(C)Ljava/lang/Class;",                                                                             (void *) (ptrint) &Java_java_lang_VMClassLoader_getPrimitiveClass          },
-       { "resolveClass",               "(Ljava/lang/Class;)V",                                                                             (void *) (ptrint) &Java_java_lang_VMClassLoader_resolveClass               },
-       { "loadClass",                  "(Ljava/lang/String;Z)Ljava/lang/Class;",                                                           (void *) (ptrint) &Java_java_lang_VMClassLoader_loadClass                  },
-       { "nativeGetResources",         "(Ljava/lang/String;)Ljava/util/Vector;",                                                           (void *) (ptrint) &Java_java_lang_VMClassLoader_nativeGetResources         },
-       { "defaultAssertionStatus",     "()Z",                                                                                              (void *) (ptrint) &Java_java_lang_VMClassLoader_defaultAssertionStatus     },
-       { "defaultUserAssertionStatus", "()Z",                                                                                              (void *) (ptrint) &Java_java_lang_VMClassLoader_defaultUserAssertionStatus },
-       { "packageAssertionStatus0",    "(Ljava/lang/Boolean;Ljava/lang/Boolean;)Ljava/util/Map;",                                          (void *) (ptrint) &Java_java_lang_VMClassLoader_packageAssertionStatus0    },
-       { "classAssertionStatus0",      "(Ljava/lang/Boolean;Ljava/lang/Boolean;)Ljava/util/Map;",                                          (void *) (ptrint) &Java_java_lang_VMClassLoader_classAssertionStatus0      },
-       { "findLoadedClass",            "(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class;",                                     (void *) (ptrint) &Java_java_lang_VMClassLoader_findLoadedClass            },
+       { "defineClass",                "(Ljava/lang/ClassLoader;Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class;", (void *) (uintptr_t) &Java_java_lang_VMClassLoader_defineClass                },
+       { "getPrimitiveClass",          "(C)Ljava/lang/Class;",                                                                             (void *) (uintptr_t) &Java_java_lang_VMClassLoader_getPrimitiveClass          },
+       { "resolveClass",               "(Ljava/lang/Class;)V",                                                                             (void *) (uintptr_t) &Java_java_lang_VMClassLoader_resolveClass               },
+       { "loadClass",                  "(Ljava/lang/String;Z)Ljava/lang/Class;",                                                           (void *) (uintptr_t) &Java_java_lang_VMClassLoader_loadClass                  },
+       { "nativeGetResources",         "(Ljava/lang/String;)Ljava/util/Vector;",                                                           (void *) (uintptr_t) &Java_java_lang_VMClassLoader_nativeGetResources         },
+       { "defaultAssertionStatus",     "()Z",                                                                                              (void *) (uintptr_t) &Java_java_lang_VMClassLoader_defaultAssertionStatus     },
+       { "defaultUserAssertionStatus", "()Z",                                                                                              (void *) (uintptr_t) &Java_java_lang_VMClassLoader_defaultUserAssertionStatus },
+       { "packageAssertionStatus0",    "(Ljava/lang/Boolean;Ljava/lang/Boolean;)Ljava/util/Map;",                                          (void *) (uintptr_t) &Java_java_lang_VMClassLoader_packageAssertionStatus0    },
+       { "classAssertionStatus0",      "(Ljava/lang/Boolean;Ljava/lang/Boolean;)Ljava/util/Map;",                                          (void *) (uintptr_t) &Java_java_lang_VMClassLoader_classAssertionStatus0      },
+       { "findLoadedClass",            "(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class;",                                     (void *) (uintptr_t) &Java_java_lang_VMClassLoader_findLoadedClass            },
 };
 
 
@@ -112,7 +111,7 @@ void _Jv_java_lang_VMClassLoader_init(void)
  * Method:    defineClass
  * Signature: (Ljava/lang/ClassLoader;Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class;
  */
-JNIEXPORT java_lang_Class* JNICALL Java_java_lang_VMClassLoader_defineClass(JNIEnv *env, jclass clazz, java_lang_ClassLoader *cl, java_lang_String *name, java_handle_bytearray_t *data, s4 offset, s4 len, java_security_ProtectionDomain *pd)
+JNIEXPORT java_lang_Class* JNICALL Java_java_lang_VMClassLoader_defineClass(JNIEnv *env, jclass clazz, java_lang_ClassLoader *cl, java_lang_String *name, java_handle_bytearray_t *data, int32_t offset, int32_t len, java_security_ProtectionDomain *pd)
 {
        utf             *utfname;
        classinfo       *c;
@@ -195,7 +194,7 @@ JNIEXPORT java_lang_Class* JNICALL Java_java_lang_VMClassLoader_defineClass(JNIE
  * Method:    getPrimitiveClass
  * Signature: (C)Ljava/lang/Class;
  */
-JNIEXPORT java_lang_Class* JNICALL Java_java_lang_VMClassLoader_getPrimitiveClass(JNIEnv *env, jclass clazz, s4 type)
+JNIEXPORT java_lang_Class* JNICALL Java_java_lang_VMClassLoader_getPrimitiveClass(JNIEnv *env, jclass clazz, int32_t type)
 {
        classinfo *c;
 
@@ -240,7 +239,7 @@ JNIEXPORT void JNICALL Java_java_lang_VMClassLoader_resolveClass(JNIEnv *env, jc
  * Method:    loadClass
  * Signature: (Ljava/lang/String;Z)Ljava/lang/Class;
  */
-JNIEXPORT java_lang_Class* JNICALL Java_java_lang_VMClassLoader_loadClass(JNIEnv *env, jclass clazz, java_lang_String *name, s4 resolve)
+JNIEXPORT java_lang_Class* JNICALL Java_java_lang_VMClassLoader_loadClass(JNIEnv *env, jclass clazz, java_lang_String *name, int32_t resolve)
 {
        classinfo *c;
        utf       *u;
@@ -286,10 +285,10 @@ JNIEXPORT java_util_Vector* JNICALL Java_java_lang_VMClassLoader_nativeGetResour
        char                 *buffer;    /* char buffer              */
        char                 *namestart; /* start of name to use     */
        char                 *tmppath;   /* temporary buffer         */
-       s4                    namelen;   /* length of name to use    */
-       s4                    searchlen; /* length of name to search */
-       s4                    bufsize;   /* size of buffer allocated */
-       s4                    pathlen;   /* name of path to assemble */
+       int32_t               namelen;   /* length of name to use    */
+       int32_t               searchlen; /* length of name to search */
+       int32_t               bufsize;   /* size of buffer allocated */
+       int32_t               pathlen;   /* name of path to assemble */
        struct stat           buf;       /* buffer for stat          */
        jboolean              ret;       /* return value of "add"    */
 
@@ -420,7 +419,7 @@ return_NULL:
  * Method:    defaultAssertionStatus
  * Signature: ()Z
  */
-JNIEXPORT s4 JNICALL Java_java_lang_VMClassLoader_defaultAssertionStatus(JNIEnv *env, jclass clazz)
+JNIEXPORT int32_t JNICALL Java_java_lang_VMClassLoader_defaultAssertionStatus(JNIEnv *env, jclass clazz)
 {
 #if defined(ENABLE_ASSERTION)
        return assertion_system_enabled;
@@ -434,7 +433,7 @@ JNIEXPORT s4 JNICALL Java_java_lang_VMClassLoader_defaultAssertionStatus(JNIEnv
  * Method:    userAssertionStatus
  * Signature: ()Z
  */
-JNIEXPORT s4 JNICALL Java_java_lang_VMClassLoader_defaultUserAssertionStatus(JNIEnv *env, jclass clazz)
+JNIEXPORT int32_t JNICALL Java_java_lang_VMClassLoader_defaultUserAssertionStatus(JNIEnv *env, jclass clazz)
 {
 #if defined(ENABLE_ASSERTION)
        return assertion_user_enabled;
index 0b574d9d71248b389c4b183c18518e8490512a88..40c978c8a433e2f96c18eac4ff13d3a79bd90db6 100644 (file)
@@ -1,9 +1,7 @@
 /* src/native/vm/gnu/java_lang_VMSystem.c - java/lang/VMSystem
 
-   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 "config.h"
 
+#include <stdint.h>
 #include <string.h>
 
-#include "vm/types.h"
-
 #include "mm/gc-common.h"
 
 #include "native/jni.h"
@@ -49,8 +46,8 @@
 /* native methods implemented by this file ************************************/
 
 static JNINativeMethod methods[] = {
-       { "arraycopy",        "(Ljava/lang/Object;ILjava/lang/Object;II)V", (void *) (ptrint) &Java_java_lang_VMSystem_arraycopy },
-       { "identityHashCode", "(Ljava/lang/Object;)I",                      (void *) (ptrint) &Java_java_lang_VMSystem_identityHashCode },
+       { "arraycopy",        "(Ljava/lang/Object;ILjava/lang/Object;II)V", (void *) (uintptr_t) &Java_java_lang_VMSystem_arraycopy },
+       { "identityHashCode", "(Ljava/lang/Object;)I",                      (void *) (uintptr_t) &Java_java_lang_VMSystem_identityHashCode },
 };
 
 
@@ -75,7 +72,7 @@ void _Jv_java_lang_VMSystem_init(void)
  * Method:    arraycopy
  * Signature: (Ljava/lang/Object;ILjava/lang/Object;II)V
  */
-JNIEXPORT void JNICALL Java_java_lang_VMSystem_arraycopy(JNIEnv *env, jclass clazz, java_lang_Object *src, s4 srcStart, java_lang_Object *dest, s4 destStart, s4 len)
+JNIEXPORT void JNICALL Java_java_lang_VMSystem_arraycopy(JNIEnv *env, jclass clazz, java_lang_Object *src, int32_t srcStart, java_lang_Object *dest, int32_t destStart, int32_t len)
 {
        builtin_arraycopy((java_handle_t *) src, srcStart,
                                          (java_handle_t *) dest, destStart, len);
@@ -87,9 +84,9 @@ JNIEXPORT void JNICALL Java_java_lang_VMSystem_arraycopy(JNIEnv *env, jclass cla
  * Method:    identityHashCode
  * Signature: (Ljava/lang/Object;)I
  */
-JNIEXPORT s4 JNICALL Java_java_lang_VMSystem_identityHashCode(JNIEnv *env, jclass clazz, java_lang_Object *o)
+JNIEXPORT int32_t JNICALL Java_java_lang_VMSystem_identityHashCode(JNIEnv *env, jclass clazz, java_lang_Object *o)
 {
-       s4 hashcode;
+       int32_t hashcode;
 
        LLNI_CRITICAL_START;
 
index a0f4d573accc4f7cccb3bc85044defbc53afe5c0..8b1853f06237cfa4e10a9f4909ceb914593647a9 100644 (file)
 
 #include "config.h"
 
-#include <assert.h>
+#include <stdint.h>
 
 #if defined(ENABLE_ANNOTATIONS)
 #include "vm/vm.h"
 #endif
 
-#include "vm/types.h"
-
 #include "native/jni.h"
 #include "native/llni.h"
 #include "native/native.h"
 /* native methods implemented by this file ************************************/
 
 static JNINativeMethod methods[] = {
-       { "getModifiersInternal",    "()I",                                                       (void *) (intptr_t) &Java_java_lang_reflect_VMMethod_getModifiersInternal    },
-       { "getReturnType",           "()Ljava/lang/Class;",                                       (void *) (intptr_t) &Java_java_lang_reflect_VMMethod_getReturnType           },
-       { "getParameterTypes",       "()[Ljava/lang/Class;",                                      (void *) (intptr_t) &Java_java_lang_reflect_VMMethod_getParameterTypes       },
-       { "getExceptionTypes",       "()[Ljava/lang/Class;",                                      (void *) (intptr_t) &Java_java_lang_reflect_VMMethod_getExceptionTypes       },
-       { "invoke",                  "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;", (void *) (intptr_t) &Java_java_lang_reflect_VMMethod_invoke                  },
-       { "getSignature",            "()Ljava/lang/String;",                                      (void *) (intptr_t) &Java_java_lang_reflect_VMMethod_getSignature            },
+       { "getModifiersInternal",    "()I",                                                       (void *) (uintptr_t) &Java_java_lang_reflect_VMMethod_getModifiersInternal    },
+       { "getReturnType",           "()Ljava/lang/Class;",                                       (void *) (uintptr_t) &Java_java_lang_reflect_VMMethod_getReturnType           },
+       { "getParameterTypes",       "()[Ljava/lang/Class;",                                      (void *) (uintptr_t) &Java_java_lang_reflect_VMMethod_getParameterTypes       },
+       { "getExceptionTypes",       "()[Ljava/lang/Class;",                                      (void *) (uintptr_t) &Java_java_lang_reflect_VMMethod_getExceptionTypes       },
+       { "invoke",                  "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;", (void *) (uintptr_t) &Java_java_lang_reflect_VMMethod_invoke                  },
+       { "getSignature",            "()Ljava/lang/String;",                                      (void *) (uintptr_t) &Java_java_lang_reflect_VMMethod_getSignature            },
 #if defined(ENABLE_ANNOTATIONS)
-       { "getDefaultValue",         "()Ljava/lang/Object;",                                      (void *) (intptr_t) &Java_java_lang_reflect_VMMethod_getDefaultValue         },
-       { "declaredAnnotations",     "()Ljava/util/Map;",                                         (void *) (intptr_t) &Java_java_lang_reflect_VMMethod_declaredAnnotations     },
-       { "getParameterAnnotations", "()[[Ljava/lang/annotation/Annotation;",                     (void *) (intptr_t) &Java_java_lang_reflect_VMMethod_getParameterAnnotations },
+       { "getDefaultValue",         "()Ljava/lang/Object;",                                      (void *) (uintptr_t) &Java_java_lang_reflect_VMMethod_getDefaultValue         },
+       { "declaredAnnotations",     "()Ljava/util/Map;",                                         (void *) (uintptr_t) &Java_java_lang_reflect_VMMethod_declaredAnnotations     },
+       { "getParameterAnnotations", "()[[Ljava/lang/annotation/Annotation;",                     (void *) (uintptr_t) &Java_java_lang_reflect_VMMethod_getParameterAnnotations },
 #endif
 };
 
@@ -100,7 +98,7 @@ void _Jv_java_lang_reflect_VMMethod_init(void)
  * Method:    getModifiersInternal
  * Signature: ()I
  */
-JNIEXPORT s4 JNICALL Java_java_lang_reflect_VMMethod_getModifiersInternal(JNIEnv *env, java_lang_reflect_VMMethod *this)
+JNIEXPORT int32_t JNICALL Java_java_lang_reflect_VMMethod_getModifiersInternal(JNIEnv *env, java_lang_reflect_VMMethod *this)
 {
        classinfo  *c;
        methodinfo *m;
@@ -246,6 +244,8 @@ JNIEXPORT struct java_lang_Object* JNICALL Java_java_lang_reflect_VMMethod_getDe
        java_lang_Class          *constantPoolOop = NULL;            /* methods declaring class                           */
        classinfo                *referer         = NULL;            /* class, which calles the annotation parser         */
                                                                     /* (for the parameter 'referer' of vm_call_method()) */
+       java_lang_reflect_Method* rm;
+       java_handle_t*            h;
 
        if (this == NULL) {
                exceptions_throw_nullpointerexception();
@@ -291,11 +291,12 @@ JNIEXPORT struct java_lang_Object* JNICALL Java_java_lang_reflect_VMMethod_getDe
                }
        }
 
+       LLNI_field_get_ref(this, m,                 rm);
        LLNI_field_get_ref(this, annotationDefault, annotationDefault);
 
-       return (java_lang_Object*)vm_call_method(
-               m_parseAnnotationDefault, NULL,
-               this, annotationDefault, constantPool);
+       h = vm_call_method(m_parseAnnotationDefault, NULL, rm, annotationDefault, constantPool);
+
+       return (java_lang_Object*) h;
 }
 
 
index f237127a919b7547eaca5097b99be3c62df87669..07a5362cfe4a6d93782330ee4aa05072f07ac396 100644 (file)
@@ -1408,10 +1408,10 @@ static void lock_record_notify(threadobject *t, lock_record_t *lr, bool one)
 
                waitingthread = w->thread;
 
-               /* We must skip threads which have already been notified or
-                  interrupted. They will remove themselves from the list. */
+               /* We must skip threads which have already been notified. They will
+                  remove themselves from the list. */
 
-               if (waitingthread->signaled || waitingthread->interrupted)
+               if (waitingthread->signaled)
                        continue;
 
                /* Enter the wait-mutex. */
index 5dd5236262e38fca6fc6583ed4848509ffdd68ee..4f438809f627ab56ea1f84f9c33240d06e784ac4 100644 (file)
@@ -1341,7 +1341,7 @@ java_handle_t *codegen_start_native_call(u1 *sp, u1 *pv)
 #endif
 
 #if !defined(NDEBUG)
-# if defined(__ALPHA__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined(__X86_64__) || defined(__S390__)
+# if defined(__ALPHA__) || defined(__I386__) || defined(__M68K__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined(__S390__) || defined(__X86_64__)
        /* print the call-trace if necesarry */
        /* BEFORE: filling the local reference table */
 
@@ -1419,7 +1419,10 @@ java_object_t *codegen_finish_native_call(u1 *sp, u1 *pv)
 #elif defined(__I386__)
        datasp   = sp + framesize;
        ret_regs = (uint64_t *) (sp + 2 * SIZEOF_VOID_P);
-#elif defined(__M68K__) || defined(__X86_64__)
+#elif defined(__M68K__)
+       datasp   = sp + framesize;
+       ret_regs = (uint64_t *) (sp + 2 * 8);
+#elif defined(__X86_64__)
        datasp   = sp + framesize;
        ret_regs = (uint64_t *) sp;
 #elif defined(__POWERPC__)
@@ -1463,7 +1466,7 @@ java_object_t *codegen_finish_native_call(u1 *sp, u1 *pv)
 #endif
 
 #if !defined(NDEBUG)
-# if defined(__ALPHA__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined(__X86_64__) || defined(__S390__)
+# if defined(__ALPHA__) || defined(__I386__) || defined(__M68K__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined(__S390__) || defined(__X86_64__)
        /* print the call-trace if necesarry */
        /* AFTER: unwrapping the return value */
 
index 0862cad4905ad2d5ea407286e7f7f80e0f2af714..41bd7c7f7f83e459c527546e81fe368a01bbdf8b 100644 (file)
@@ -2410,27 +2410,9 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int s
        (void) dseg_add_unique_s4(cd, 0);                              /* IntSave         */
        (void) dseg_add_unique_s4(cd, 0);                              /* FltSave         */
 
-       /* print call trace */
-#if 0
-#if !defined(NDEBUG)
-       if (JITDATA_HAS_FLAG_VERBOSECALL(jd)) {
-               emit_verbosecall_enter(jd);
-       }
-#endif
-#endif
-
        /* generate code */
        M_AADD_IMM(-(cd->stackframesize*8), REG_SP);
 
-       /* get function address (this must happen before the stackframeinfo) */
-       if (f == NULL)  {
-               patcher_add_patch_ref(jd, PATCHER_resolve_native_function, m, 0);
-       }
-
-       M_AMOV_IMM(f, REG_ATMP2); /* do not move this line, the patcher is needed */
-
-       M_AST(REG_ATMP2, REG_SP, 4 * 4);
-
        /* put arguments for codegen_start_native_call onto stack */
        /* void codegen_start_native_call(u1 *datasp, u1 *pv, u1 *sp, u1 *ra) */
        
@@ -2448,9 +2430,6 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int s
        if (m->flags & ACC_STATIC)
                M_INT2ADRMOVE(REG_RESULT, REG_ATMP3);
 
-       /* load function pointer */
-       M_ALD(REG_ATMP2, REG_SP, 4 * 4);
-
        /* copy arguments into stackframe */
        for (i = md->paramcount -1, j = i + skipparams; i >= 0; --i, --j)       {
                t = md->paramtypes[i].type;
@@ -2481,6 +2460,7 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int s
        }
 
        /* call the native function */
+       M_AMOV_IMM(f, REG_ATMP2);
        M_JSR(REG_ATMP2);
 
        /* save return value */
@@ -2501,14 +2481,7 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int s
 
                default: assert(0);
        }
-#if 0  
-       /* print call trace */
-#if ! defined(NDEBUG)
-       if (JITDATA_HAS_FLAG_VERBOSECALL(jd)) {
-               emit_verbosecall_exit(jd);
-       }
-#endif
-#endif
+
        /* remove native stackframe info */
        /* therefore we call: java_objectheader *codegen_finish_native_call(u1 *datasp) */
 
@@ -2566,9 +2539,6 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int s
 
        /* should never be reached from within jit code*/
        M_JSR_IMM(0);
-
-       /* generate patcher stub call code */
-       emit_patcher_traps(jd);
 }
 
 
index 31dc479e5c9018071a62c6b5e5abfbc6c1d448ae..f8c9407d9e3bd82e24ddc26e16593690b0f03733 100644 (file)
@@ -120,7 +120,8 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
        sp  = (u1 *) (ptrint) _gregs[REG_SP];
        ra  = (u1 *) (ptrint) _gregs[REG_RA];        /* this is correct for leafs */
 
-#if !defined(__UCLIBC__) && ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 5))
+#if !defined(__UCLIBC__)
+# if ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 5))
        /* NOTE: We only need this for pre glibc-2.5. */
 
        xpc = (u1 *) (ptrint) _mc->pc;
@@ -143,6 +144,9 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
                xpc = xpc - 4;
                break;
        }
+# else
+       xpc = (u1 *) (ptrint) _mc->pc;
+# endif
 #else
        xpc = (u1 *) (ptrint) _gregs[CTX_EPC];
 #endif
index 6d036b08cb128530d9ca99dca5bbe3287d72f6d9..ba7599937487f3ceb34d7575f06a680ed9537bf1 100644 (file)
@@ -202,6 +202,13 @@ void trace_java_call_enter(methodinfo *m, uint64_t *arg_regs, uint64_t *stack)
        s4          pos;
        int32_t     dumpmarker;
 
+       /* We don't trace builtin functions here because the argument
+          passing happens via the native ABI and does not fit these
+          functions. */
+
+       if (method_is_builtin(m))
+               return;
+
 #if defined(ENABLE_DEBUG_FILTER)
        if (!show_filters_test_verbosecall_enter(m))
                return;
@@ -288,7 +295,6 @@ void trace_java_call_enter(methodinfo *m, uint64_t *arg_regs, uint64_t *stack)
        if (m->flags & ACC_NATIVE)         strcat(logtext, " NATIVE");
        if (m->flags & ACC_INTERFACE)      strcat(logtext, " INTERFACE");
        if (m->flags & ACC_ABSTRACT)       strcat(logtext, " ABSTRACT");
-       if (m->flags & ACC_METHOD_BUILTIN) strcat(logtext, " METHOD_BUILTIN");
 
        strcat(logtext, "(");
 
@@ -333,6 +339,13 @@ void trace_java_call_exit(methodinfo *m, uint64_t *return_regs)
        imm_union   val;
        int32_t     dumpmarker;
 
+       /* We don't trace builtin functions here because the argument
+          passing happens via the native ABI and does not fit these
+          functions. */
+
+       if (method_is_builtin(m))
+               return;
+
 #if defined(ENABLE_DEBUG_FILTER)
        if (!show_filters_test_verbosecall_exit(m))
                return;
index 3a44d2daec65ab4e5df0f31bcdf3547413e1c943..30134fcb11eb31a270201d08b74e8a4c1253b56b 100644 (file)
@@ -2244,7 +2244,8 @@ static char *vm_get_mainclass_from_jar(char *mainstring)
        o = vm_call_method(m, o, s);
 
        if (o == NULL) {
-               exceptions_print_stacktrace();
+               fprintf(stderr, "Failed to load Main-Class manifest attribute from\n");
+               fprintf(stderr, "%s\n", mainstring);
                return NULL;
        }
 
index 189616174f14c1f5ae132fffeacaec4ded34193b..34b529ba2d3b34d294f6a9f24ff6650e81903968 100644 (file)
@@ -159,6 +159,14 @@ struct lineinfo {
 extern methodinfo *method_java_lang_reflect_Method_invoke;
 
 
+/* inline functions ***********************************************************/
+
+inline static bool method_is_builtin(methodinfo* m)
+{
+       return m->flags & ACC_METHOD_BUILTIN;
+}
+
+
 /* function prototypes ********************************************************/
 
 void method_init(void);
index 18b846fc5cfe821fe06114323de27598f385633d..277918f423c702ee7df7f02d74eef0a42e7e1a33 100644 (file)
@@ -29,7 +29,7 @@ SUBDIRS = \
        regression
 
 EXTRA_DIST = \
-       *.java
+       $(srcdir)/*.java
 
 CLEANFILES = \
        *.class
index c62ecbd2caf597081401058e2d750ea17237796c..02addaa9ee75287a0bfeca66322513c47500fd34 100644 (file)
@@ -24,8 +24,8 @@
 SUBDIRS = \
        assertion \
        bugzilla \
-       codepatching \
        jasmin \
+       junit \
        native \
        resolving
 
@@ -39,7 +39,6 @@ SOURCE_FILES = \
        $(srcdir)/fptest.java \
        $(srcdir)/fp.java \
        $(srcdir)/extest.java \
-       $(srcdir)/clinitexception.java \
        $(srcdir)/LoadDisplacementOverflow.java \
        $(srcdir)/FieldDisplacementOverflow.java \
        $(srcdir)/StackDisplacementOverflow.java \
@@ -54,7 +53,6 @@ EXTRA_DIST = \
        fptest.output \
        fp.output\
        extest.2output \
-       clinitexception.2output \
        LoadDisplacementOverflow.output \
        FieldDisplacementOverflow.output \
        StackDisplacementOverflow.output \
@@ -74,7 +72,6 @@ OUTPUT_JAVA_TESTS = \
        fp \
        extest \
        \
-       clinitexception \
        LoadDisplacementOverflow \
        FieldDisplacementOverflow \
        StackDisplacementOverflow \
@@ -84,7 +81,7 @@ OUTPUT_JAVA_TESTS = \
 check: build $(SIMPLE_JAVA_TESTS) $(OUTPUT_JAVA_TESTS)
 
 build:
-       @$(JAVACCMD) -d . $(SOURCE_FILES)
+       $(JAVACCMD) -d . $(SOURCE_FILES)
 
 $(SIMPLE_JAVA_TESTS):
        @echo "$@: "
index dc3d2b624693ef71cf22b4a0e3ba1ff236d432c2..15327bf9c2bb8121035050f5849bdee42678acad 100644 (file)
@@ -26,16 +26,16 @@ JAVACMD  = $(JAVA) -Xbootclasspath:$(BOOTCLASSPATH)
 JAVACCMD = $(JAVAC) -bootclasspath $(BOOTCLASSPATH)
 
 EXTRA_DIST = \
-       *.java
+       $(srcdir)/*.java
 
 CLEANFILES = \
        *.class
 
 build:
-       $(JAVACCMD) -cp /usr/share/java/junit4.jar -d . $(srcdir)/*.java
+       $(JAVACCMD) -classpath /usr/share/java/junit4.jar -d . $(srcdir)/*.java
 
 check: build
-       $(JAVACMD) -cp /usr/share/java/junit4.jar:. org.junit.runner.JUnitCore All
+       $(JAVACMD) -classpath /usr/share/java/junit4.jar:. org.junit.runner.JUnitCore All
 
 
 ## Local variables:
diff --git a/tests/regression/clinitexception.2output b/tests/regression/clinitexception.2output
deleted file mode 100644 (file)
index 9f6a360..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Exception in thread "main" java.lang.ExceptionInInitializerError
-   <<No stacktrace available>>
-Caused by: java.lang.RuntimeException
-   at clinitexception.<clinit>(clinitexception.java:4)
diff --git a/tests/regression/clinitexception.java b/tests/regression/clinitexception.java
deleted file mode 100644 (file)
index aa75bc4..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-public class clinitexception {
-    static {
-        if (true)
-            throw new RuntimeException();
-    }
-
-    public static void main(String[] argv) {
-    }
-}
diff --git a/tests/regression/codepatching/Makefile.am b/tests/regression/codepatching/Makefile.am
deleted file mode 100644 (file)
index 99fe7fe..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-## tests/regression/codepatching/Makefile.am
-##
-## Copyright (C) 1996-2005, 2006, 2008
-## CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
-##
-## 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.
-
-
-JAVA     = $(top_builddir)/src/cacao/cacao
-JAVACMD  = $(JAVA) -Xbootclasspath:$(BOOTCLASSPATH)
-JAVACCMD = $(JAVAC) -bootclasspath $(BOOTCLASSPATH)
-
-SOURCE_FILES = \
-       $(srcdir)/aastoreconstClass.java \
-       $(srcdir)/checkcastC.java \
-       $(srcdir)/checkcastI.java \
-       $(srcdir)/getfieldD.java \
-       $(srcdir)/getfieldF.java \
-       $(srcdir)/getfieldI.java \
-       $(srcdir)/getfieldJ.java \
-       $(srcdir)/getfieldL.java \
-       $(srcdir)/getstaticD.java \
-       $(srcdir)/getstaticF.java \
-       $(srcdir)/getstaticI.java \
-       $(srcdir)/getstaticJ.java \
-       $(srcdir)/getstaticL.java \
-       $(srcdir)/instanceofC.java \
-       $(srcdir)/instanceofI.java \
-       $(srcdir)/invokespecial.java \
-       $(srcdir)/invokestatic.java \
-       $(srcdir)/multianewarray.java \
-       $(srcdir)/newarray.java \
-       $(srcdir)/putfieldD.java \
-       $(srcdir)/putfieldF.java \
-       $(srcdir)/putfieldI.java \
-       $(srcdir)/putfieldJ.java \
-       $(srcdir)/putfieldL.java \
-       $(srcdir)/putfieldconstC.java \
-       $(srcdir)/putfieldconstD.java \
-       $(srcdir)/putfieldconstF.java \
-       $(srcdir)/putfieldconstI.java \
-       $(srcdir)/putfieldconstJ.java \
-       $(srcdir)/putfieldconstL.java \
-       $(srcdir)/putstaticD.java \
-       $(srcdir)/putstaticF.java \
-       $(srcdir)/putstaticI.java \
-       $(srcdir)/putstaticJ.java \
-       $(srcdir)/putstaticL.java \
-       $(srcdir)/putstaticconstC.java \
-       $(srcdir)/putstaticconstD.java \
-       $(srcdir)/putstaticconstF.java \
-       $(srcdir)/putstaticconstI.java \
-       $(srcdir)/putstaticconstJ.java \
-       $(srcdir)/putstaticconstL.java \
-       $(srcdir)/test.java
-
-EXTRA_DIST = \
-       $(SOURCE_FILES)
-
-MAINCLASS = \
-       test.class
-
-CLASSES = \
-       aastoreconstClass.class \
-       checkcastC.class \
-       checkcastI.class \
-       getfieldD.class \
-       getfieldF.class \
-       getfieldI.class \
-       getfieldJ.class \
-       getfieldL.class \
-       getstaticD.class \
-       getstaticF.class \
-       getstaticI.class \
-       getstaticJ.class \
-       getstaticL.class \
-       instanceofC.class \
-       instanceofI.class \
-       invokespecial.class \
-       invokestatic.class \
-       multianewarray.class \
-       newarray.class \
-       putfieldD.class \
-       putfieldF.class \
-       putfieldI.class \
-       putfieldJ.class \
-       putfieldL.class \
-       putfieldconstC.class \
-       putfieldconstD.class \
-       putfieldconstF.class \
-       putfieldconstI.class \
-       putfieldconstJ.class \
-       putfieldconstL.class \
-       putstaticD.class \
-       putstaticF.class \
-       putstaticI.class \
-       putstaticJ.class \
-       putstaticL.class \
-       putstaticconstC.class \
-       putstaticconstD.class \
-       putstaticconstF.class \
-       putstaticconstI.class \
-       putstaticconstJ.class \
-       putstaticconstL.class
-
-CLEANFILES = \
-       *.class
-
-build:
-       @$(JAVACCMD) -d . $(SOURCE_FILES)
-
-check: build
-       @LD_LIBRARY_PATH=$(top_builddir)/src/cacao/.libs $(JAVACMD) test
-
-remove:
-       $(RM) $(CLASSES)
-
-
-## Local variables:
-## mode: Makefile
-## indent-tabs-mode: t
-## c-basic-offset: 4
-## tab-width: 8
-## compile-command: "automake --add-missing"
-## End:
diff --git a/tests/regression/codepatching/aastoreconstClass.java b/tests/regression/codepatching/aastoreconstClass.java
deleted file mode 100644 (file)
index bd11a04..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class aastoreconstClass {
-}
-
diff --git a/tests/regression/codepatching/checkcastC.java b/tests/regression/codepatching/checkcastC.java
deleted file mode 100644 (file)
index 06e4d53..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-public class checkcastC {
-}
diff --git a/tests/regression/codepatching/checkcastI.java b/tests/regression/codepatching/checkcastI.java
deleted file mode 100644 (file)
index 39137be..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-public interface checkcastI {
-}
diff --git a/tests/regression/codepatching/getfieldD.java b/tests/regression/codepatching/getfieldD.java
deleted file mode 100644 (file)
index 0462af9..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class getfieldD {
-    public double d = 789.012;
-}
diff --git a/tests/regression/codepatching/getfieldF.java b/tests/regression/codepatching/getfieldF.java
deleted file mode 100644 (file)
index aa3f23e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class getfieldF {
-    public float f = 123.456F;
-}
diff --git a/tests/regression/codepatching/getfieldI.java b/tests/regression/codepatching/getfieldI.java
deleted file mode 100644 (file)
index 90fa2c4..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class getfieldI {
-    public int i = 123;
-}
diff --git a/tests/regression/codepatching/getfieldJ.java b/tests/regression/codepatching/getfieldJ.java
deleted file mode 100644 (file)
index d022d08..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class getfieldJ {
-    public long l = 1234567890123L;
-}
diff --git a/tests/regression/codepatching/getfieldL.java b/tests/regression/codepatching/getfieldL.java
deleted file mode 100644 (file)
index 18392a8..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class getfieldL {
-    public Object o = null;
-}
diff --git a/tests/regression/codepatching/getstaticD.java b/tests/regression/codepatching/getstaticD.java
deleted file mode 100644 (file)
index 15620a7..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class getstaticD {
-    public static double d = 789.012;
-}
diff --git a/tests/regression/codepatching/getstaticF.java b/tests/regression/codepatching/getstaticF.java
deleted file mode 100644 (file)
index 64a610d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class getstaticF {
-    public static float f = 123.456F;
-}
diff --git a/tests/regression/codepatching/getstaticI.java b/tests/regression/codepatching/getstaticI.java
deleted file mode 100644 (file)
index c08fbb9..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class getstaticI {
-    public static int i = 123;
-}
diff --git a/tests/regression/codepatching/getstaticJ.java b/tests/regression/codepatching/getstaticJ.java
deleted file mode 100644 (file)
index 49b7275..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class getstaticJ {
-    public static long l = 1234567890123L;
-}
diff --git a/tests/regression/codepatching/getstaticL.java b/tests/regression/codepatching/getstaticL.java
deleted file mode 100644 (file)
index c2e0355..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class getstaticL {
-    public static Object o = null;
-}
diff --git a/tests/regression/codepatching/instanceofC.java b/tests/regression/codepatching/instanceofC.java
deleted file mode 100644 (file)
index d4d9857..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-public class instanceofC {
-}
diff --git a/tests/regression/codepatching/instanceofI.java b/tests/regression/codepatching/instanceofI.java
deleted file mode 100644 (file)
index 6cf5671..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-public interface instanceofI {
-}
diff --git a/tests/regression/codepatching/invokespecial.java b/tests/regression/codepatching/invokespecial.java
deleted file mode 100644 (file)
index 9f1885a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-public class invokespecial {
-    public invokespecial() {
-        System.out.println("OK");
-    }
-}
diff --git a/tests/regression/codepatching/invokestatic.java b/tests/regression/codepatching/invokestatic.java
deleted file mode 100644 (file)
index 9aaeb50..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-public class invokestatic {
-    public static void sub() {
-        System.out.println("OK");
-    }
-}
diff --git a/tests/regression/codepatching/multianewarray.java b/tests/regression/codepatching/multianewarray.java
deleted file mode 100644 (file)
index 1573d48..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-public class multianewarray {
-}
diff --git a/tests/regression/codepatching/newarray.java b/tests/regression/codepatching/newarray.java
deleted file mode 100644 (file)
index 5f116d0..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-public class newarray {
-}
diff --git a/tests/regression/codepatching/putfieldD.java b/tests/regression/codepatching/putfieldD.java
deleted file mode 100644 (file)
index a7b28f7..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putfieldD {
-    public double d;
-}
diff --git a/tests/regression/codepatching/putfieldF.java b/tests/regression/codepatching/putfieldF.java
deleted file mode 100644 (file)
index 85d9f2b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putfieldF {
-    public float f;
-}
diff --git a/tests/regression/codepatching/putfieldI.java b/tests/regression/codepatching/putfieldI.java
deleted file mode 100644 (file)
index 6af25d1..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putfieldI {
-    public int i;
-}
diff --git a/tests/regression/codepatching/putfieldJ.java b/tests/regression/codepatching/putfieldJ.java
deleted file mode 100644 (file)
index 6b2db7e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putfieldJ {
-    public long l;
-}
diff --git a/tests/regression/codepatching/putfieldL.java b/tests/regression/codepatching/putfieldL.java
deleted file mode 100644 (file)
index 75b3ecc..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putfieldL {
-    public Object o;
-}
diff --git a/tests/regression/codepatching/putfieldconstC.java b/tests/regression/codepatching/putfieldconstC.java
deleted file mode 100644 (file)
index e62abd6..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putfieldconstC {
-    public Class c;
-}
diff --git a/tests/regression/codepatching/putfieldconstD.java b/tests/regression/codepatching/putfieldconstD.java
deleted file mode 100644 (file)
index 3cb4478..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putfieldconstD {
-    public double d;
-}
diff --git a/tests/regression/codepatching/putfieldconstF.java b/tests/regression/codepatching/putfieldconstF.java
deleted file mode 100644 (file)
index 49c07db..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putfieldconstF {
-    public float f;
-}
diff --git a/tests/regression/codepatching/putfieldconstI.java b/tests/regression/codepatching/putfieldconstI.java
deleted file mode 100644 (file)
index 062271a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putfieldconstI {
-    public int i;
-}
diff --git a/tests/regression/codepatching/putfieldconstJ.java b/tests/regression/codepatching/putfieldconstJ.java
deleted file mode 100644 (file)
index a38325d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putfieldconstJ {
-    public long l;
-}
diff --git a/tests/regression/codepatching/putfieldconstL.java b/tests/regression/codepatching/putfieldconstL.java
deleted file mode 100644 (file)
index 3d00829..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putfieldconstL {
-    public Object o;
-}
diff --git a/tests/regression/codepatching/putstaticD.java b/tests/regression/codepatching/putstaticD.java
deleted file mode 100644 (file)
index 49f2010..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putstaticD {
-    public static double d;
-}
diff --git a/tests/regression/codepatching/putstaticF.java b/tests/regression/codepatching/putstaticF.java
deleted file mode 100644 (file)
index 08cc3bc..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putstaticF {
-    public static float f;
-}
diff --git a/tests/regression/codepatching/putstaticI.java b/tests/regression/codepatching/putstaticI.java
deleted file mode 100644 (file)
index 39a18ca..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putstaticI {
-    public static int i;
-}
diff --git a/tests/regression/codepatching/putstaticJ.java b/tests/regression/codepatching/putstaticJ.java
deleted file mode 100644 (file)
index 8a3cfc5..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putstaticJ {
-    public static long l;
-}
diff --git a/tests/regression/codepatching/putstaticL.java b/tests/regression/codepatching/putstaticL.java
deleted file mode 100644 (file)
index f8e8dee..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putstaticL {
-    public static Object o;
-}
diff --git a/tests/regression/codepatching/putstaticconstC.java b/tests/regression/codepatching/putstaticconstC.java
deleted file mode 100644 (file)
index 358614b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putstaticconstC {
-    public static Class c;
-}
diff --git a/tests/regression/codepatching/putstaticconstD.java b/tests/regression/codepatching/putstaticconstD.java
deleted file mode 100644 (file)
index 219909d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putstaticconstD {
-    public static double d;
-}
diff --git a/tests/regression/codepatching/putstaticconstF.java b/tests/regression/codepatching/putstaticconstF.java
deleted file mode 100644 (file)
index 454c0c3..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putstaticconstF {
-    public static float f;
-}
diff --git a/tests/regression/codepatching/putstaticconstI.java b/tests/regression/codepatching/putstaticconstI.java
deleted file mode 100644 (file)
index 7038a51..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putstaticconstI {
-    public static int i;
-}
diff --git a/tests/regression/codepatching/putstaticconstJ.java b/tests/regression/codepatching/putstaticconstJ.java
deleted file mode 100644 (file)
index 00409d0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putstaticconstJ {
-    public static long l;
-}
diff --git a/tests/regression/codepatching/putstaticconstL.java b/tests/regression/codepatching/putstaticconstL.java
deleted file mode 100644 (file)
index 45e97dd..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-public class putstaticconstL {
-    public static Object o;
-}
diff --git a/tests/regression/codepatching/test.java b/tests/regression/codepatching/test.java
deleted file mode 100644 (file)
index aba4d5e..0000000
+++ /dev/null
@@ -1,763 +0,0 @@
-public class test extends Thread {
-    static boolean doit = true;
-
-    public static void main(String[] argv) {
-        int threadcount = 1;
-
-        if (argv.length > 0) {
-            for (int i = 0; i < argv.length; i++) {
-                if (argv[i].equals("--help")) {
-                    usage();
-
-                } else if (argv[i].equals("skip")) {
-                    doit = false;
-
-                } else {
-                    threadcount = Integer.valueOf(argv[i]).intValue();
-                }
-            }
-        }
-
-        System.out.println("Running with " + threadcount + " threads.");
-
-        for (int i = 0; i < threadcount; i++) {
-            new test().start();
-        }
-    }
-
-    static void usage() {
-        System.out.println("test [number of threads] [skip]");
-        System.exit(1);
-    }
-
-    public test() {
-    }
-
-    public void start() {
-        run();
-    }
-
-    public void run() {
-        invokestatic();
-
-        getstatic();
-        putstatic();
-        putstaticconst();
-
-        getfield();
-        putfield();
-        putfieldconst();
-
-        newarray();
-        multianewarray();
-
-        invokespecial();
-
-        checkcast();
-        _instanceof();
-
-        aastoreconst();
-    }
-
-
-    final private static void invokestatic() {
-        try {
-            p("invokestatic: ");
-            if (doit)
-                invokestatic.sub();
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-    }
-
-
-    private void getstatic() {
-        try {
-            p("getstatic (I): ");
-            if (doit)
-                check(getstaticI.i, 123);
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("getstatic (J): ");
-            if (doit)
-                check(getstaticJ.l, 1234567890123L);
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("getstatic (F): ");
-            if (doit)
-                check(getstaticF.f, 123.456F);
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("getstatic (D): ");
-            if (doit)
-                check(getstaticD.d, 789.012);
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("getstatic (L): ");
-            if (doit)
-                check(getstaticL.o, null);
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-    }
-
-    private void putstatic() {
-        try {
-            p("putstatic (I): ");
-            if (doit) {
-                int i = 123;
-                putstaticI.i = i;
-                check(putstaticI.i, i);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putstatic (J): ");
-            if (doit) {
-                long l = 1234567890123L;
-                putstaticJ.l = l;
-                check(putstaticJ.l, l);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putstatic (F): ");
-            if (doit) {
-                float f = 123.456F;
-                putstaticF.f = f;
-                check(putstaticF.f, f);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putstatic (D): ");
-            if (doit) {
-                double d = 789.012;
-                putstaticD.d = d;
-                check(putstaticD.d, d);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-
-        try {
-            p("putstatic (L): ");
-            if (doit) {
-                Object o = null;
-                putstaticL.o = o;
-                check(putstaticL.o, o);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-    }
-
-    private void putstaticconst() {
-        try {
-            p("putstaticconst (I): ");
-            if (doit) {
-                putstaticconstI.i = 123;
-                check(putstaticconstI.i, 123);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putstaticconst (J): ");
-            if (doit) {
-                putstaticconstJ.l = 1234567890123L;
-                check(putstaticconstJ.l, 1234567890123L);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putstaticconst (F): ");
-            if (doit) {
-                putstaticconstF.f = 123.456F;
-                check(putstaticconstF.f, 123.456F);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putstaticconst (D): ");
-            if (doit) {
-                putstaticconstD.d = 789.012;
-                check(putstaticconstD.d, 789.012);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putstaticconst zero (I): ");
-            if (doit) {
-                putstaticconstI.i = 0;
-                check(putstaticconstI.i, 0);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putstaticconst zero (J): ");
-            if (doit) {
-                putstaticconstJ.l = 0L;
-                check(putstaticconstJ.l, 0L);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putstaticconst zero (F): ");
-            if (doit) {
-                putstaticconstF.f = 0.0F;
-                check(putstaticconstF.f, 0.0F);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putstaticconst zero (D): ");
-            if (doit) {
-                putstaticconstD.d = 0.0;
-                check(putstaticconstD.d, 0.0);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putstaticconst zero (L): ");
-            if (doit) {
-                putstaticconstL.o = null;
-                check(putstaticconstL.o, null);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putstaticconst unresolved class: ");
-            if (doit) {
-                putstaticconstC.c = putstaticconstC.class;
-                check(putstaticconstC.c, Class.forName("putstaticconstC"));
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        } catch (ClassNotFoundException t) {
-            failed(t);
-        }
-    }
-
-    private void getfield() {
-        try {
-            p("getfield (I): ");
-            if (doit)
-                check(new getfieldI().i, 123);
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("getfield (J): ");
-            if (doit)
-                check(new getfieldJ().l, 1234567890123L);
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("getfield (F): ");
-            if (doit)
-                check(new getfieldF().f, 123.456F);
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("getfield (D): ");
-            if (doit)
-                check(new getfieldD().d, 789.012);
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("getfield (L): ");
-            if (doit)
-                check(new getfieldL().o, null);
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-    }
-
-    private void putfield() {
-        try {
-            p("putfield (I): ");
-            if (doit) {
-                putfieldI pfi = new putfieldI();
-                int i = 123;
-                pfi.i = i;
-                check(pfi.i, i);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putfield (J): ");
-            if (doit) {
-                putfieldJ pfj = new putfieldJ();
-                long l = 1234567890123L;
-                pfj.l = l;
-                check(pfj.l, l);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putfield (F): ");
-            if (doit) {
-                putfieldF pff = new putfieldF();
-                float f = 123.456F;
-                pff.f = f;
-                check(pff.f, f);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putfield (D): ");
-            if (doit) {
-                putfieldD pfd = new putfieldD();
-                double d = 789.012;
-                pfd.d = d;
-                check(pfd.d, d);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putfield (L): ");
-            if (doit) {
-                putfieldL pfl = new putfieldL();
-                Object o = null;
-                pfl.o = o;
-                check(pfl.o, o);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-    }
-
-    private void putfieldconst() {
-        try {
-            p("putfieldconst (I): ");
-            if (doit) {
-                putfieldconstI pfci = new putfieldconstI();
-                pfci.i = 123;
-                check(pfci.i, 123);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-        try {
-            p("putfieldconst (J): ");
-            if (doit) {
-                putfieldconstJ pfcj = new putfieldconstJ();
-                pfcj.l = 1234567890123L;
-                check(pfcj.l, 1234567890123L);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putfieldconst (F): ");
-            if (doit) {
-                putfieldconstF pfcf = new putfieldconstF();
-                pfcf.f = 123.456F;
-                check(pfcf.f, 123.456F);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-        try {
-            p("putfieldconst (D): ");
-            if (doit) {
-                putfieldconstD pfcd = new putfieldconstD();
-                pfcd.d = 789.012;
-                check(pfcd.d, 789.012);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putfieldconst zero (I): ");
-            if (doit) {
-                putfieldconstI pfci = new putfieldconstI();
-                pfci.i = 0;
-                check(pfci.i, 0);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-        try {
-            p("putfieldconst zero (J): ");
-            if (doit) {
-                putfieldconstJ pfcj = new putfieldconstJ();
-                pfcj.l = 0L;
-                check(pfcj.l, 0L);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putfieldconst zero (F): ");
-            if (doit) {
-                putfieldconstF pfcf = new putfieldconstF();
-                pfcf.f = 0.0F;
-                check(pfcf.f, 0.0F);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-        try {
-            p("putfieldconst zero (D): ");
-            if (doit) {
-                putfieldconstD pfcd = new putfieldconstD();
-                pfcd.d = 0.0;
-                check(pfcd.d, 0.0);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putfieldconst zero (L): ");
-            if (doit) {
-                putfieldconstL pfcl = new putfieldconstL();
-                pfcl.o = null;
-                check(pfcl.o, null);
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("putfieldconst unresolved class: ");
-            if (doit) {
-                putfieldconstC pfcc = new putfieldconstC();
-                pfcc.c = putfieldconstC.class;
-                check(pfcc.c, Class.forName("putfieldconstC"));
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        } catch (ClassNotFoundException t) {
-            failed(t);
-        }
-    }
-
-    private void newarray() {
-        try {
-            p("newarray: ");
-            if (doit) {
-                newarray[] na = new newarray[1];
-            }
-            ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-    }
-
-    private void multianewarray() {
-        try {
-            p("multianewarray: ");
-            if (doit) {
-                multianewarray[][] ma = new multianewarray[1][1];
-            }
-            ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-    }
-
-    private void invokespecial() {
-        try {
-            p("invokespecial: ");
-            if (doit)
-                new invokespecial();
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-    }
-
-    private void checkcast() {
-        Object o = new Object();
-
-        // class
-        try {
-            p("checkcast class: ");
-            if (doit) {
-                checkcastC cc = (checkcastC) o;
-                failed();
-            } else
-                ok();
-        } catch (ClassCastException e) {
-            ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        // interface
-        try {
-            p("checkcast interface: ");
-            if (doit) {
-                checkcastI ci = (checkcastI) o;
-                failed();
-            } else
-                ok();
-        } catch (ClassCastException e) {
-            ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-
-        // array
-
-        Object[] oa = new Object[1];
-
-        try {
-            p("checkcast class array: ");
-            if (doit) {
-                checkcastC[] cca = (checkcastC[]) oa;
-                failed();
-            } else
-                ok();
-        } catch (ClassCastException e) {
-            ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-    }
-
-    private void _instanceof() {
-        Object o = new Object();
-
-        try {
-            p("instanceof class: ");
-            if (doit)
-                if (o instanceof instanceofC)
-                    failed();
-                else
-                    ok();
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-        try {
-            p("instanceof interface: ");
-            if (doit)
-                if (o instanceof instanceofI)
-                    failed();
-                else
-                    ok();
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-
-
-        // array
-
-        Object[] oa = new Object[1];
-
-        try {
-            p("instanceof class array: ");
-            if (doit)
-                if (oa instanceof instanceofC[])
-                    failed();
-                else
-                    ok();
-            else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        }
-    }
-
-    private void aastoreconst() {
-        Class[] ca = new Class[1];
-
-        try {
-            p("aastoreconst of unresolved class != NULL: ");
-            if (doit) {
-                ca[0] = aastoreconstClass.class;
-
-                if (ca[0] != null)
-                    ok();
-                else
-                    failed();
-
-                p("aastoreconst of unresolved correct value: ");
-                check(ca[0],Class.forName("aastoreconstClass"));
-            } else
-                ok();
-        } catch (NoClassDefFoundError t) {
-            failed(t);
-        } catch (ClassNotFoundException t) {
-            failed(t);
-        }
-    }
-
-    private static final void ok() {
-        pln("OK");
-    }
-
-    private static final void failed() {
-        pln("FAILED");
-    }
-
-    private static final void failed(Throwable t) {
-        pln("FAILED: " + t);
-    }
-
-    private static final void check(int a, int b) {
-        if (a == b)
-            ok();
-        else
-            pln("FAILED: " + a + " != " + b + " (0x" + Integer.toHexString(a) + " != 0x" + Integer.toHexString(b) + ")");
-    }
-
-    private static final void check(long a, long b) {
-        if (a == b)
-            ok();
-        else
-            pln("FAILED: " + a + " != " + b + " (0x" + Long.toHexString(a) + " != 0x" + Long.toHexString(b) + ")");
-    }
-
-    private static final void check(float a, float b) {
-        if (a == b)
-            ok();
-        else
-            pln("FAILED: " + a + " != " + b);
-    }
-
-    private static final void check(double a, double b) {
-        if (a == b)
-            ok();
-        else
-            pln("FAILED: " + a + " != " + b);
-    }
-
-    private static final void check(Object a, Object b) {
-        if (a == b)
-            ok();
-        else
-            pln("FAILED: " + a + " != " + b);
-    }
-
-    private static final void p(String s) {
-        System.out.print(s);
-    }
-
-    private static final void pln(String s) {
-        System.out.println(s);
-    }
-}
-
-// vim: et ts=4 sw=4
-
diff --git a/tests/regression/junit/All.java b/tests/regression/junit/All.java
new file mode 100644 (file)
index 0000000..15a5523
--- /dev/null
@@ -0,0 +1,52 @@
+/* tests/regression/junit/All.java - runs all CACAO regression unit tests
+
+   Copyright (C) 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+
+   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.
+
+*/
+
+
+import junit.framework.*;
+import junit.textui.*;
+
+public class All extends TestCase {
+    /**
+     * Runs all CACAO regression unit tests using
+     * junit.textui.TestRunner
+     */
+    public static void main(String[] args) {
+        Test s = suite();
+        TestRunner.run(s);
+    }
+
+    /**
+     * Collects all CACAO regression unit tests as one suite.
+     */
+    public static Test suite() {
+        TestSuite suite = new TestSuite("CACAO Regression Unit Tests");
+
+        // Add your test here.
+
+        suite.addTest(new TestSuite(TestPatcher.class));
+        suite.addTest(new TestSuite(TestExceptionInStaticClassInitializer.class));
+
+        return suite;
+    }
+}
diff --git a/tests/regression/junit/Makefile.am b/tests/regression/junit/Makefile.am
new file mode 100644 (file)
index 0000000..5b7351b
--- /dev/null
@@ -0,0 +1,47 @@
+## tests/regression/junit/Makefile.am
+##
+## Copyright (C) 2008
+## CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+##
+## 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.
+
+
+JAVA     = LD_LIBRARY_PATH=$(top_builddir)/src/cacao/.libs $(top_builddir)/src/cacao/cacao
+JAVACMD  = $(JAVA) -Xbootclasspath:$(BOOTCLASSPATH)
+JAVACCMD = $(JAVAC) -bootclasspath $(BOOTCLASSPATH)
+
+EXTRA_DIST = \
+       $(srcdir)/*.java
+
+CLEANFILES = \
+       *.class
+
+build:
+       $(JAVACCMD) -classpath /usr/share/java/junit4.jar -d . $(srcdir)/*.java
+
+check: build
+       $(JAVACMD) -classpath /usr/share/java/junit4.jar:. org.junit.runner.JUnitCore All
+
+
+## Local variables:
+## mode: Makefile
+## indent-tabs-mode: t
+## c-basic-offset: 4
+## tab-width: 8
+## compile-command: "automake --add-missing"
+## End:
diff --git a/tests/regression/junit/TestExceptionInStaticClassInitializer.java b/tests/regression/junit/TestExceptionInStaticClassInitializer.java
new file mode 100644 (file)
index 0000000..e6cc93e
--- /dev/null
@@ -0,0 +1,66 @@
+/* tests/regression/bugzilla/TestExceptionInStaticClassInitializer.java
+
+   Copyright (C) 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+
+   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.
+
+*/
+
+
+import junit.framework.*;
+import junit.textui.*;
+
+public class TestExceptionInStaticClassInitializer extends TestCase {
+    public static void main(String[] args) {
+        TestRunner.run(suite());
+    }
+
+    public static Test suite() {
+        return new TestSuite(TestExceptionInStaticClassInitializer.class);
+    }
+
+    public void test() {
+        try {
+            TestExceptionInStaticClassInitializer_x.i = 1;
+            fail("Should throw ExceptionInInitializerError");
+        }
+        catch (ExceptionInInitializerError success) {
+            Throwable cause = success.getCause();
+
+            assertTrue("Cause should be RuntimeException but is " + cause.getClass(), cause.getClass() == RuntimeException.class);
+
+            StackTraceElement[] ste = cause.getStackTrace();
+
+            assertTrue("Linenumber should be " + LINE + " but is " + ste[0].getLineNumber(), ste[0].getLineNumber() == LINE);
+        }
+    }
+
+    // This linenumber must be the one from...
+    final static int LINE = 64;
+}
+
+class TestExceptionInStaticClassInitializer_x {
+    static int i;
+
+    static {
+        if (true)
+            // ...the following line.
+            throw new RuntimeException();
+    }
+}
diff --git a/tests/regression/junit/TestPatcher.java b/tests/regression/junit/TestPatcher.java
new file mode 100644 (file)
index 0000000..8417608
--- /dev/null
@@ -0,0 +1,650 @@
+/* tests/regression/bugzilla/TestPatcher.java
+
+   Copyright (C) 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+
+   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.
+
+*/
+
+
+import junit.framework.*;
+import junit.textui.*;
+
+import java.io.*;
+
+public class TestPatcher extends TestCase {
+    public static void main(String[] args) {
+        TestRunner.run(suite());
+    }
+
+    public static Test suite() {
+        return new TestSuite(TestPatcher.class);
+    }
+
+    static boolean doit = true;
+
+    final static int    i = 123;
+    final static long   l = 1234567890123L;
+    final static float  f = 123.456F;
+    final static double d = 789.012;
+    final static Object o = new Object();
+
+    public void testNormal() {
+        invokestatic();
+        invokespecial();
+
+        getstatic();
+        putstatic();
+        putstaticconst();
+
+        getfield();
+        putfield();
+        putfieldconst();
+
+        newarray();
+        multianewarray();
+
+        checkcast();
+        _instanceof();
+
+        aastoreconst();
+    }
+
+    public void testWithoutClasses() {
+        // Delete all classes.
+        //new File("TestPatcher$invokestatic.class").delete();
+
+        invokestatic();
+        invokespecial();
+
+        getstatic();
+        putstatic();
+        putstaticconst();
+
+        getfield();
+        putfield();
+        putfieldconst();
+
+        newarray();
+        multianewarray();
+
+        checkcast();
+        _instanceof();
+
+        aastoreconst();
+    }
+
+    private void invokestatic() {
+        try {
+            if (doit)
+                invokestatic.sub();
+        } catch (NoClassDefFoundError e) {
+            fail(e.toString());
+        }
+    }
+
+    private void getstatic() {
+        try {
+            if (doit)
+                assertTrue(getstaticI.i + " != " + i, getstaticI.i == i);
+        } catch (NoClassDefFoundError e) {
+            fail(e.toString());
+        }
+
+        try {
+            if (doit)
+                assertTrue(getstaticJ.l + " != " + l, getstaticJ.l == l);
+        } catch (NoClassDefFoundError e) {
+            fail(e.toString());
+        }
+
+        try {
+            if (doit)
+                assertTrue(getstaticF.f + " != " + f, getstaticF.f == f);
+        } catch (NoClassDefFoundError e) {
+            fail(e.toString());
+        }
+
+        try {
+            if (doit)
+                assertTrue(getstaticD.d + " != " + d, getstaticD.d == d);
+        } catch (NoClassDefFoundError e) {
+            fail(e.toString());
+        }
+
+        try {
+            if (doit)
+                assertTrue(getstaticL.o + " != null", getstaticL.o == null);
+        } catch (NoClassDefFoundError e) {
+            fail(e.toString());
+        }
+    }
+
+    private void putstatic() {
+        try {
+            if (doit) {
+                putstaticI.i = i;
+                assertTrue(putstaticI.i + " != " + i, putstaticI.i == i);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putstaticJ.l = l;
+                assertTrue(putstaticJ.l + " != " + l, putstaticJ.l == l);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putstaticF.f = f;
+                assertTrue(putstaticF.f + " != " + f, putstaticF.f == f);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putstaticD.d = d;
+                assertTrue(putstaticD.d + " != " + d, putstaticD.d == d);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+
+        try {
+            if (doit) {
+                putstaticL.o = o;
+                assertTrue(putstaticL.o + " != " + o, putstaticL.o == o);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+    }
+
+    private void putstaticconst() {
+        try {
+            if (doit) {
+                putstaticconstI.i = i;
+                assertTrue(putstaticconstI.i + " != " + i, putstaticconstI.i == i);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putstaticconstJ.l = l;
+                assertTrue(putstaticconstJ.l + " != " + l, putstaticconstJ.l == l);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putstaticconstF.f = f;
+                assertTrue(putstaticconstF.f + " != " + f, putstaticconstF.f == f);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putstaticconstD.d = d;
+                assertTrue(putstaticconstD.d + " != " + d, putstaticconstD.d == d);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putstaticconstI.i = 0;
+                assertTrue(putstaticconstI.i + " != " + 0, putstaticconstI.i == 0);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putstaticconstJ.l = 0L;
+                assertTrue(putstaticconstJ.l + " != " + 0L, putstaticconstJ.l == 0L);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putstaticconstF.f = 0.0F;
+                assertTrue(putstaticconstF.f + " != " + 0.0F, putstaticconstF.f == 0.0F);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putstaticconstD.d = 0.0;
+                assertTrue(putstaticconstD.d + " != " + 0.0, putstaticconstD.d == 0.0);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putstaticconstL.o = null;
+                assertTrue(putstaticconstL.o + " != " + null, putstaticconstL.o == null);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putstaticconstC.c = putstaticconstC.class;
+                assertTrue(putstaticconstC.c + " != " + Class.forName("TestPatcher$putstaticconstC"), putstaticconstC.c == Class.forName("TestPatcher$putstaticconstC"));
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        } catch (ClassNotFoundException t) {
+            fail(t.toString());
+        }
+    }
+
+    private void getfield() {
+        try {
+            if (doit)
+                assertTrue(new getfieldI().i + " != " + i, new getfieldI().i == i);
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit)
+                assertTrue(new getfieldJ().l + " != " + l, new getfieldJ().l == l);
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit)
+                assertTrue(new getfieldF().f + " != " + f, new getfieldF().f == f);
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit)
+                assertTrue(new getfieldD().d + " != " + d, new getfieldD().d == d);
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit)
+                assertTrue(new getfieldL().o + " != " + null, new getfieldL().o == null);
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+    }
+
+    private void putfield() {
+        try {
+            if (doit) {
+                TestPatcher.putfieldI pfi = new TestPatcher.putfieldI();
+                pfi.i = i;
+                assertTrue(pfi.i + " != " + i, pfi.i == i);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putfieldJ pfj = new putfieldJ();
+                pfj.l = l;
+                assertTrue(pfj.l + " != " + l, pfj.l == l);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putfieldF pff = new putfieldF();
+                pff.f = f;
+                assertTrue(pff.f + " != " + f, pff.f == f);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putfieldD pfd = new putfieldD();
+                pfd.d = d;
+                assertTrue(pfd.d + " != " + d, pfd.d == d);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putfieldL pfl = new putfieldL();
+                pfl.o = o;
+                assertTrue(pfl.o + " != " + o, pfl.o == o);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+    }
+
+    private void putfieldconst() {
+        try {
+            if (doit) {
+                putfieldconstI pfci = new putfieldconstI();
+                pfci.i = i;
+                assertTrue(pfci.i + " != " + i, pfci.i == i);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+        try {
+            if (doit) {
+                putfieldconstJ pfcj = new putfieldconstJ();
+                pfcj.l = l;
+                assertTrue(pfcj.l + " != " + l, pfcj.l == l);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putfieldconstF pfcf = new putfieldconstF();
+                pfcf.f = f;
+                assertTrue(pfcf.f + " != " + f, pfcf.f == f);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+        try {
+            if (doit) {
+                putfieldconstD pfcd = new putfieldconstD();
+                pfcd.d = d;
+                assertTrue(pfcd.d + " != " + d, pfcd.d == d);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putfieldconstI pfci = new putfieldconstI();
+                pfci.i = 0;
+                assertTrue(pfci.i + " != " + 0, pfci.i == 0);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+        try {
+            if (doit) {
+                putfieldconstJ pfcj = new putfieldconstJ();
+                pfcj.l = 0L;
+                assertTrue(pfcj.l + " != " + 0L, pfcj.l == 0L);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putfieldconstF pfcf = new putfieldconstF();
+                pfcf.f = 0.0F;
+                assertTrue(pfcf.f + " != " + 0.0F, pfcf.f == 0.0F);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+        try {
+            if (doit) {
+                putfieldconstD pfcd = new putfieldconstD();
+                pfcd.d = 0.0;
+                assertTrue(pfcd.d + " != " + 0.0, pfcd.d == 0.0);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putfieldconstL pfcl = new putfieldconstL();
+                pfcl.o = null;
+                assertTrue(pfcl.o + " != " + null, pfcl.o == null);
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit) {
+                putfieldconstC pfcc = new putfieldconstC();
+                pfcc.c = putfieldconstC.class;
+                assertTrue(pfcc.c + " != " + Class.forName("TestPatcher$putfieldconstC"), pfcc.c == Class.forName("TestPatcher$putfieldconstC"));
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        } catch (ClassNotFoundException t) {
+            fail(t.toString());
+        }
+    }
+
+    private void newarray() {
+        try {
+            if (doit) {
+                newarray[] na = new newarray[1];
+                na[0] = null;
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+    }
+
+    private void multianewarray() {
+        try {
+            if (doit) {
+                multianewarray[][] ma = new multianewarray[1][1];
+                ma[0][0] = null;
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+    }
+
+    private void invokespecial() {
+        try {
+            if (doit)
+                new invokespecial();
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+    }
+
+    private void checkcast() {
+        Object o = new Object();
+
+        // class
+        try {
+            if (doit) {
+                checkcastC cc = (checkcastC) o;
+                fail();
+            }
+        } catch (ClassCastException success) {
+            // This is OK.
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        // interface
+        try {
+            if (doit) {
+                checkcastI ci = (checkcastI) o;
+                fail();
+            }
+        } catch (ClassCastException success) {
+            // This is OK.
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+
+        // array
+        Object[] oa = new Object[1];
+
+        try {
+            if (doit) {
+                checkcastC[] cca = (checkcastC[]) oa;
+                fail();
+            }
+        } catch (ClassCastException e) {
+            // This is OK.
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+    }
+
+    private void _instanceof() {
+        Object o = new Object();
+
+        try {
+            if (doit)
+                if (o instanceof instanceofC)
+                    fail();
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+        try {
+            if (doit)
+                if (o instanceof instanceofI)
+                    fail();
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+
+
+        // array
+        Object[] oa = new Object[1];
+
+        try {
+            if (doit)
+                if (oa instanceof instanceofC[])
+                    fail();
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        }
+    }
+
+    private void aastoreconst() {
+        Class[] ca = new Class[1];
+
+        try {
+            if (doit) {
+                ca[0] = aastoreconstClass.class;
+
+                if (ca[0] == null)
+                    fail();
+
+                assertTrue(ca[0] + " != " + Class.forName("TestPatcher$aastoreconstClass") , ca[0] == Class.forName("TestPatcher$aastoreconstClass"));
+            }
+        } catch (NoClassDefFoundError t) {
+            fail(t.toString());
+        } catch (ClassNotFoundException t) {
+            fail(t.toString());
+        }
+    }
+
+    static class invokestatic  { static void sub() {} }
+    static class invokespecial { void invokespecial() {} }
+
+    static class getstaticI { static int    i = TestPatcher.i; }
+    static class getstaticJ { static long   l = TestPatcher.l; }
+    static class getstaticF { static float  f = TestPatcher.f; }
+    static class getstaticD { static double d = TestPatcher.d; }
+    static class getstaticL { static Object o = null; }
+
+    static class putstaticI { static int    i; }
+    static class putstaticJ { static long   l; }
+    static class putstaticF { static float  f; }
+    static class putstaticD { static double d; }
+    static class putstaticL { static Object o; }
+
+    static class putstaticconstI { static int    i; }
+    static class putstaticconstJ { static long   l; }
+    static class putstaticconstF { static float  f; }
+    static class putstaticconstD { static double d; }
+    static class putstaticconstL { static Object o; }
+    static class putstaticconstC { static Class<putstaticconstC> c; }
+
+    static class getfieldI { int    i = TestPatcher.i; }
+    static class getfieldJ { long   l = TestPatcher.l; }
+    static class getfieldF { float  f = TestPatcher.f; }
+    static class getfieldD { double d = TestPatcher.d; }
+    static class getfieldL { Object o = null; }
+
+    static class putfieldI { int    i; }
+    static class putfieldJ { long   l; }
+    static class putfieldF { float  f; }
+    static class putfieldD { double d; }
+    static class putfieldL { Object o; }
+
+    static class putfieldconstI { int    i; }
+    static class putfieldconstJ { long   l; }
+    static class putfieldconstF { float  f; }
+    static class putfieldconstD { double d; }
+    static class putfieldconstL { Object o; }
+    static class putfieldconstC { Class<putfieldconstC> c; }
+
+    static class newarray {}
+    static class multianewarray {}
+
+    static class instanceofC {}
+    static interface instanceofI {}
+
+    static class checkcastC {}
+    static interface checkcastI {}
+
+    static class aastoreconstClass {}
+}