harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r582306 - in /harmony/enhanced/drlvm/trunk: build/make/components/vm/ build/make/targets/ vm/include/ vm/tests/unit/thread/utils/ vm/vmcore/src/ vm/vmcore/src/jni/
Date Fri, 05 Oct 2007 15:14:45 GMT
Author: gshimansky
Date: Fri Oct  5 08:14:39 2007
New Revision: 582306

URL: http://svn.apache.org/viewvc?rev=582306&view=rev
Log:
Applied patches for HARMONY-4006
[drlvm][init] Eclipse launcher can't start Harmony VM using JNI Invocation API.


Added:
    harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_util_platform_dependent.c
  (with props)
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/harmonyvm.def   (with props)
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/harmonyvm64.def   (with props)
Modified:
    harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml
    harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml
    harmony/enhanced/drlvm/trunk/vm/include/jni.h
    harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.c
    harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp

Modified: harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml?rev=582306&r1=582305&r2=582306&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml Fri Oct  5 08:14:39 2007
@@ -330,6 +330,12 @@
             </select>
 
             <select os="win">
+                <select arch="em64t">
+                    <linkerarg value="/DEF:${build.vm.home}/vmcore/src/harmonyvm64.def"/>
+                </select>
+                <select arch="ia32">
+                    <linkerarg value="/DEF:${build.vm.home}/vmcore/src/harmonyvm.def"/>
+                </select>
                 <select cfg="debug">
                     <linkerarg value="/NODEFAULTLIB:libcmt.lib" />
                     <linkerarg value="/NODEFAULTLIB:msvcrt.lib" />

Modified: harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml?rev=582306&r1=582305&r2=582306&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml Fri Oct  5 08:14:39 2007
@@ -172,6 +172,7 @@
                         <fileset dir="${cunit.obj.dir}">
                             <include name="thread_unit_test_main.o*" />
                             <include name="thread_unit_test_utils.o*" />
+                            <include name="thread_util_platform_dependent.o*" />
                             <include name="testframe.o*" />
                             <include name="${filename}.o*" />
                         </fileset>

Modified: harmony/enhanced/drlvm/trunk/vm/include/jni.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/jni.h?rev=582306&r1=582305&r2=582306&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/jni.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/jni.h Fri Oct  5 08:14:39 2007
@@ -1794,7 +1794,7 @@
  * Function attribute used when building VM from sources
  */
 #ifdef BUILDING_VM
-#define _JNI_EXPORT_ JNIEXPORT
+#define _JNI_EXPORT_
 #else
 #define _JNI_EXPORT_ JNIIMPORT
 #endif

Modified: harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.c?rev=582306&r1=582305&r2=582306&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.c (original)
+++ harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.c Fri Oct
 5 08:14:39 2007
@@ -81,10 +81,14 @@
 }
 
 void test_java_thread_setup(int argc, char *argv[]) {
+    create_java_vm_func CreateJavaVM;
     JavaVMInitArgs args;
     JNIEnv * jni_env;
     int i;
 
+    CreateJavaVM = test_get_java_vm_ptr();
+    assert(CreateJavaVM);
+
     args.version = JNI_VERSION_1_2;
     args.nOptions = argc;
     args.options = (JavaVMOption *) malloc(args.nOptions * sizeof(JavaVMOption));
@@ -97,7 +101,7 @@
     log_debug("test_java_thread_init()");
 
     hythread_sleep(1000);
-    JNI_CreateJavaVM(&GLOBAL_VM, &jni_env, &args);
+    CreateJavaVM(&GLOBAL_VM, &jni_env, &args);
 }
 
 void test_java_thread_teardown(void) {

Modified: harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.h?rev=582306&r1=582305&r2=582306&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.h Fri Oct
 5 08:14:39 2007
@@ -123,3 +123,7 @@
 jobject new_jobject_thread_death(JNIEnv * jni_env);
 jthread new_jobject();
 void delete_jobject(jobject obj);
+
+typedef jint (JNICALL *create_java_vm_func)(JavaVM **vm, JNIEnv **env,
+    JavaVMInitArgs *args);
+create_java_vm_func test_get_java_vm_ptr(void);

Added: harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_util_platform_dependent.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_util_platform_dependent.c?rev=582306&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_util_platform_dependent.c
(added)
+++ harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_util_platform_dependent.c
Fri Oct  5 08:14:39 2007
@@ -0,0 +1,33 @@
+#include <assert.h>
+#include "thread_unit_test_utils.h"
+
+#ifdef _WIN32
+#include <windows.h>
+
+create_java_vm_func test_get_java_vm_ptr(void)
+{
+    HANDLE lib;
+    FARPROC func;
+
+    lib = LoadLibrary("harmonyvm.dll");
+    assert(lib);
+    func = GetProcAddress(lib, "JNI_CreateJavaVM");
+    assert(func);
+
+    return (create_java_vm_func)func;
+}
+#else
+#include <dlfcn.h>
+
+create_java_vm_func test_get_java_vm_ptr(void)
+{
+    void *lib, *func;
+
+    lib = dlopen("libharmonyvm.so", RTLD_NOW);
+    assert(lib);
+    func = dlsym(lib, "JNI_CreateJavaVM");
+    assert(func);
+
+    return (create_java_vm_func)func;
+}
+#endif

Propchange: harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_util_platform_dependent.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/drlvm/trunk/vm/vmcore/src/harmonyvm.def
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/harmonyvm.def?rev=582306&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/harmonyvm.def (added)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/harmonyvm.def Fri Oct  5 08:14:39 2007
@@ -0,0 +1,6 @@
+LIBRARY harmonyvm
+
+EXPORTS
+    JNI_CreateJavaVM=_JNI_CreateJavaVM@12
+    JNI_GetCreatedJavaVMs=_JNI_GetCreatedJavaVMs@12
+    JNI_GetDefaultJavaVMInitArgs=_JNI_GetDefaultJavaVMInitArgs@4

Propchange: harmony/enhanced/drlvm/trunk/vm/vmcore/src/harmonyvm.def
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/drlvm/trunk/vm/vmcore/src/harmonyvm64.def
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/harmonyvm64.def?rev=582306&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/harmonyvm64.def (added)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/harmonyvm64.def Fri Oct  5 08:14:39 2007
@@ -0,0 +1,6 @@
+LIBRARY harmonyvm
+
+EXPORTS
+    JNI_CreateJavaVM=JNI_CreateJavaVM
+    JNI_GetCreatedJavaVMs=JNI_GetCreatedJavaVMs
+    JNI_GetDefaultJavaVMInitArgs=JNI_GetDefaultJavaVMInitArgs

Propchange: harmony/enhanced/drlvm/trunk/vm/vmcore/src/harmonyvm64.def
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp?rev=582306&r1=582305&r2=582306&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp Fri Oct  5 08:14:39 2007
@@ -34,6 +34,7 @@
 #include "open/jthread.h"
 #include "open/vm_util.h"
 
+#include "jni.h"
 #include "lock_manager.h"
 #include "Class.h"
 #include "classloader.h"
@@ -400,7 +401,7 @@
 
 /*    BEGIN: List of directly exported functions.    */
 
-JNIEXPORT jint JNICALL JNI_GetDefaultJavaVMInitArgs(void * args)
+jint JNICALL JNI_GetDefaultJavaVMInitArgs(void * args)
 {
     // TODO: current implementation doesn't support JDK1_1InitArgs.
     if (((JavaVMInitArgs *)args)->version == JNI_VERSION_1_1) {
@@ -410,7 +411,7 @@
     return JNI_OK;
 }
 
-JNIEXPORT jint JNICALL JNI_GetCreatedJavaVMs(JavaVM ** vmBuf,
+jint JNICALL JNI_GetCreatedJavaVMs(JavaVM ** vmBuf,
                                                jsize bufLen,
                                                jsize * nVMs)
 {
@@ -434,7 +435,7 @@
     return JNI_OK;
 }
 
-JNIEXPORT jint JNICALL JNI_CreateJavaVM(JavaVM ** p_vm, JNIEnv ** p_jni_env,
+jint JNICALL JNI_CreateJavaVM(JavaVM ** p_vm, JNIEnv ** p_jni_env,
                                           void * args) {
     jboolean daemon = JNI_FALSE;
     char * name = "main";



Mime
View raw message