* m4/jvm.m4: New file.
authorChristian Thalinger <twisti@complang.tuwien.ac.at>
Fri, 5 Sep 2008 12:48:20 +0000 (14:48 +0200)
committerChristian Thalinger <twisti@complang.tuwien.ac.at>
Fri, 5 Sep 2008 12:48:20 +0000 (14:48 +0200)
* configure.ac (AC_CHECK_WITH_JVM_MD_H, AC_CHECK_WITH_JVM_H): Call for
OpenJDK.
* src/native/vm/openjdk/jvm.cpp (INCLUDE_JVM_MD_H, INCLUDE_JVM_H):
Added.
(jvm_version_info): Removed.
(JVM_ExceptionTableEntryType): Likewise.

configure.ac
m4/jvm.m4 [new file with mode: 0644]
src/native/vm/openjdk/jvm.cpp

index 1d100c667b4f05930bfe2fba768030946ae51aa5..bfd698fb5f3836f4518e87e5fa041527e27c454d 100644 (file)
@@ -584,9 +584,11 @@ dnl The check for jni_md.h must be before jni.h.
 AC_CHECK_WITH_JNI_MD_H
 AC_CHECK_WITH_JNI_H
 
-dnl HPI is only required for OpenJDK
+dnl JVM, HPI, and JMM is only required for OpenJDK.
 case "${WITH_JAVA_RUNTIME_LIBRARY}" in
     openjdk)
+        AC_CHECK_WITH_JVM_MD_H
+        AC_CHECK_WITH_JVM_H
         AC_CHECK_WITH_HPI_MD_H
         AC_CHECK_WITH_HPI_H
         AC_CHECK_WITH_JMM_H
diff --git a/m4/jvm.m4 b/m4/jvm.m4
new file mode 100644 (file)
index 0000000..b431497
--- /dev/null
+++ b/m4/jvm.m4
@@ -0,0 +1,67 @@
+dnl m4/jvm.m4
+dnl
+dnl Copyright (C) 2008 Theobroma Systems Ltd.
+dnl
+dnl This file is part of CACAO.
+dnl
+dnl This program is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation; either version 2, or (at
+dnl your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+dnl 02110-1301, USA.
+
+
+dnl Check for jvm_md.h
+
+AC_DEFUN([AC_CHECK_WITH_JVM_MD_H],[
+AC_MSG_CHECKING(where jvm_md.h is installed)
+AC_ARG_WITH([jvm_md_h],
+            [AS_HELP_STRING(--with-jvm_md_h=<dir>,path to jvm_md.h (only with --with-java-runtime-library=openjdk) [[default=${JAVA_RUNTIME_LIBRARY_PREFIX}/jdk/src/solaris/javavm/export]])],
+            [WITH_JVM_MD_H=${withval}],
+            [case "${WITH_JAVA_RUNTIME_LIBRARY}" in
+                 openjdk)
+                     WITH_JVM_MD_H=${JAVA_RUNTIME_LIBRARY_PREFIX}/jdk/src/solaris/javavm/export
+                     ;;
+                 *)
+                     ;;
+            esac])
+AC_MSG_RESULT(${WITH_JVM_MD_H})
+
+AC_CHECK_HEADER([${WITH_JVM_MD_H}/jvm_md.h],
+                [AC_DEFINE_UNQUOTED([INCLUDE_JVM_MD_H], "${WITH_JVM_MD_H}/jvm_md.h", [Java runtime library jvm_md.h header])],
+                [AC_MSG_ERROR(cannot find jvm_md.h)])
+
+dnl Add the path to jvm_md.h to the CPPFLAGS so jvm.h can find it.
+CPPFLAGS="${CPPFLAGS} -I${WITH_JVM_MD_H}"
+])
+
+
+dnl Check for jvm.h
+
+AC_DEFUN([AC_CHECK_WITH_JVM_H],[
+AC_MSG_CHECKING(where jvm.h is installed)
+AC_ARG_WITH([jvm_h],
+            [AS_HELP_STRING(--with-jvm_h=<dir>,path to jvm.h (only with --with-java-runtime-library=openjdk) [[default=${JAVA_RUNTIME_LIBRARY_PREFIX}/jdk/src/share/javavm/export]])],
+            [WITH_JVM_H=${withval}],
+            [case "${WITH_JAVA_RUNTIME_LIBRARY}" in
+                 openjdk)
+                     WITH_JVM_H=${JAVA_RUNTIME_LIBRARY_PREFIX}/jdk/src/share/javavm/export
+                     ;;
+                 *)
+                     ;;
+            esac])
+AC_MSG_RESULT(${WITH_JVM_H})
+
+AC_CHECK_HEADER([${WITH_JVM_H}/jvm.h],
+                [AC_DEFINE_UNQUOTED([INCLUDE_JVM_H], "${WITH_JVM_H}/jvm.h", [Java runtime library jvm.h header])],
+                [AC_MSG_ERROR(cannot find jvm.h)])
+])
index b62ae3fe5f0b7b01b59242afb97cbfdcdc20eea1..1b9780fafffc3cd6a3cb4437f3bc324408ad16e6 100644 (file)
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#include "vm/types.h"
+// Include our JNI header before the JVM headers, because the JVM
+// headers include jni.h and we want to override the typedefs in
+// jni.h.
+#include "native/jni.hpp"
+
+// We include jvm_md.h before jvm.h as the latter includes the former.
+#include INCLUDE_JVM_MD_H
+#include INCLUDE_JVM_H
 
 #include "mm/memory.h"
 
-#include "native/jni.hpp"
 #include "native/llni.h"
 #include "native/native.hpp"
 
 #endif
 
 
-typedef struct {
-    /* Naming convention of RE build version string: n.n.n[_uu[c]][-<identifier>]-bxx */
-    unsigned int jvm_version;   /* Consists of major, minor, micro (n.n.n) */
-                                /* and build number (xx) */
-    unsigned int update_version : 8;         /* Update release version (uu) */
-    unsigned int special_update_version : 8; /* Special update release version (c) */
-    unsigned int reserved1 : 16; 
-    unsigned int reserved2; 
-
-    /* The following bits represents JVM supports that JDK has dependency on.
-     * JDK can use these bits to determine which JVM version
-     * and support it has to maintain runtime compatibility.
-     *
-     * When a new bit is added in a minor or update release, make sure
-     * the new bit is also added in the main/baseline.
-     */
-    unsigned int is_attachable : 1;
-    unsigned int : 31;
-    unsigned int : 32;
-    unsigned int : 32;
-} jvm_version_info;
-
-
-/*
- * A structure used to a capture exception table entry in a Java method.
- */
-typedef struct {
-    jint start_pc;
-    jint end_pc;
-    jint handler_pc;
-    jint catchType;
-} JVM_ExceptionTableEntryType;
-
-
 // Interface functions are exported as C functions.
 extern "C" {