* src/native/vm/nativevm.c: Moved to .cpp.
authorChristian Thalinger <twisti@complang.tuwien.ac.at>
Wed, 10 Sep 2008 09:28:42 +0000 (11:28 +0200)
committerChristian Thalinger <twisti@complang.tuwien.ac.at>
Wed, 10 Sep 2008 09:28:42 +0000 (11:28 +0200)
* src/native/vm/nativevm.h: Likewise.
* src/native/vm/nativevm.cpp: New file.
* src/native/vm/nativevm.hpp: Likewise.
* src/native/native.cpp,
src/native/vm/cldc1.1/com_sun_cldc_io_ResourceInputStream.cpp,
src/native/vm/cldc1.1/com_sun_cldc_io_j2me_socket_Protocol.cpp,
src/native/vm/cldc1.1/com_sun_cldchi_io_ConsoleOutputStream.cpp,
src/native/vm/cldc1.1/com_sun_cldchi_jvm_JVM.cpp,
src/native/vm/cldc1.1/java_lang_Class.cpp,
src/native/vm/cldc1.1/java_lang_Double.cpp,
src/native/vm/cldc1.1/java_lang_Float.cpp,
src/native/vm/cldc1.1/java_lang_Math.cpp,
src/native/vm/cldc1.1/java_lang_Object.cpp,
src/native/vm/cldc1.1/java_lang_Runtime.cpp,
src/native/vm/cldc1.1/java_lang_String.cpp,
src/native/vm/cldc1.1/java_lang_System.cpp,
src/native/vm/cldc1.1/java_lang_Thread.cpp,
src/native/vm/cldc1.1/java_lang_Throwable.cpp,
src/native/vm/gnuclasspath/gnu_classpath_VMStackWalker.cpp,
src/native/vm/gnuclasspath/gnu_classpath_VMSystemProperties.cpp,
src/native/vm/gnuclasspath/gnu_java_lang_VMCPStringBuilder.cpp,
src/native/vm/gnuclasspath/gnu_java_lang_management_VMClassLoadingMXBeanImpl.cpp,
src/native/vm/gnuclasspath/gnu_java_lang_management_VMMemoryMXBeanImpl.cpp,
src/native/vm/gnuclasspath/gnu_java_lang_management_VMRuntimeMXBeanImpl.cpp,
src/native/vm/gnuclasspath/gnu_java_lang_management_VMThreadMXBeanImpl.cpp,
src/native/vm/gnuclasspath/java_lang_VMClass.cpp,
src/native/vm/gnuclasspath/java_lang_VMClassLoader.cpp,
src/native/vm/gnuclasspath/java_lang_VMObject.cpp,
src/native/vm/gnuclasspath/java_lang_VMRuntime.cpp,
src/native/vm/gnuclasspath/java_lang_VMString.cpp,
src/native/vm/gnuclasspath/java_lang_VMSystem.cpp,
src/native/vm/gnuclasspath/java_lang_VMThread.cpp,
src/native/vm/gnuclasspath/java_lang_VMThrowable.cpp,
src/native/vm/gnuclasspath/java_lang_management_VMManagementFactory.cpp,
src/native/vm/gnuclasspath/java_lang_reflect_VMConstructor.cpp,
src/native/vm/gnuclasspath/java_lang_reflect_VMField.cpp,
src/native/vm/gnuclasspath/java_lang_reflect_VMMethod.cpp,
src/native/vm/gnuclasspath/java_lang_reflect_VMProxy.c,
src/native/vm/gnuclasspath/java_security_VMAccessController.cpp,
src/native/vm/gnuclasspath/java_util_concurrent_atomic_AtomicLong.cpp,
src/native/vm/gnuclasspath/sun_reflect_ConstantPool.cpp,
src/native/vm/sun_misc_Unsafe.cpp,
src/vm/vm.cpp: Related changes.

--HG--
rename : src/native/vm/nativevm.c => src/native/vm/nativevm.cpp
rename : src/native/vm/nativevm.h => src/native/vm/nativevm.hpp

44 files changed:
src/native/native.cpp
src/native/vm/cldc1.1/com_sun_cldc_io_ResourceInputStream.cpp
src/native/vm/cldc1.1/com_sun_cldc_io_j2me_socket_Protocol.cpp
src/native/vm/cldc1.1/com_sun_cldchi_io_ConsoleOutputStream.cpp
src/native/vm/cldc1.1/com_sun_cldchi_jvm_JVM.cpp
src/native/vm/cldc1.1/java_lang_Class.cpp
src/native/vm/cldc1.1/java_lang_Double.cpp
src/native/vm/cldc1.1/java_lang_Float.cpp
src/native/vm/cldc1.1/java_lang_Math.cpp
src/native/vm/cldc1.1/java_lang_Object.cpp
src/native/vm/cldc1.1/java_lang_Runtime.cpp
src/native/vm/cldc1.1/java_lang_String.cpp
src/native/vm/cldc1.1/java_lang_System.cpp
src/native/vm/cldc1.1/java_lang_Thread.cpp
src/native/vm/cldc1.1/java_lang_Throwable.cpp
src/native/vm/gnuclasspath/gnu_classpath_VMStackWalker.cpp
src/native/vm/gnuclasspath/gnu_classpath_VMSystemProperties.cpp
src/native/vm/gnuclasspath/gnu_java_lang_VMCPStringBuilder.cpp
src/native/vm/gnuclasspath/gnu_java_lang_management_VMClassLoadingMXBeanImpl.cpp
src/native/vm/gnuclasspath/gnu_java_lang_management_VMMemoryMXBeanImpl.cpp
src/native/vm/gnuclasspath/gnu_java_lang_management_VMRuntimeMXBeanImpl.cpp
src/native/vm/gnuclasspath/gnu_java_lang_management_VMThreadMXBeanImpl.cpp
src/native/vm/gnuclasspath/java_lang_VMClass.cpp
src/native/vm/gnuclasspath/java_lang_VMClassLoader.cpp
src/native/vm/gnuclasspath/java_lang_VMObject.cpp
src/native/vm/gnuclasspath/java_lang_VMRuntime.cpp
src/native/vm/gnuclasspath/java_lang_VMString.cpp
src/native/vm/gnuclasspath/java_lang_VMSystem.cpp
src/native/vm/gnuclasspath/java_lang_VMThread.cpp
src/native/vm/gnuclasspath/java_lang_VMThrowable.cpp
src/native/vm/gnuclasspath/java_lang_management_VMManagementFactory.cpp
src/native/vm/gnuclasspath/java_lang_reflect_VMConstructor.cpp
src/native/vm/gnuclasspath/java_lang_reflect_VMField.cpp
src/native/vm/gnuclasspath/java_lang_reflect_VMMethod.cpp
src/native/vm/gnuclasspath/java_lang_reflect_VMProxy.c
src/native/vm/gnuclasspath/java_security_VMAccessController.cpp
src/native/vm/gnuclasspath/java_util_concurrent_atomic_AtomicLong.cpp
src/native/vm/gnuclasspath/sun_reflect_ConstantPool.cpp
src/native/vm/nativevm.c [deleted file]
src/native/vm/nativevm.cpp [new file with mode: 0644]
src/native/vm/nativevm.h [deleted file]
src/native/vm/nativevm.hpp [new file with mode: 0644]
src/native/vm/sun_misc_Unsafe.cpp
src/vm/vm.cpp

index 62516b78cba2847c5e1795ac1d2a52d8a9e23537..794fffbe2edcdf9ef1e4d9bf1b595e4a5d3cbc01 100644 (file)
@@ -37,8 +37,6 @@
 #include "native/jni.hpp"
 #include "native/native.hpp"
 
-#include "native/vm/nativevm.h"
-
 #include "threads/mutex.hpp"
 
 #include "toolbox/avl.h"
index 75ca9c21e924186a33bb36e51ff3c0f4aa7cdedc..7722a28021c49623c6d4acb0b37c63b3c978913f 100644 (file)
@@ -375,8 +375,6 @@ static JNINativeMethod methods[] = {
  
 *******************************************************************************/
  
-// FIXME
-extern "C" {
 void _Jv_com_sun_cldc_io_ResourceInputStream_init(void)
 {
        utf *u;
@@ -385,7 +383,6 @@ void _Jv_com_sun_cldc_io_ResourceInputStream_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 2776de22b2aabacfc5a312ac71b8d0bb2617fa29..80124b3b27e3c137e06ee0b0eeecd6929cda72cb 100644 (file)
@@ -238,8 +238,6 @@ static JNINativeMethod methods[] = {
  
 *******************************************************************************/
  
-// FIXME
-extern "C" {
 void _Jv_com_sun_cldc_io_j2me_socket_Protocol_init(void)
 {
        utf *u;
@@ -248,7 +246,6 @@ void _Jv_com_sun_cldc_io_j2me_socket_Protocol_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 448c75f02d3df827e127691631dfc73a6359ae25..0b00e0d9898e82f01460da1a9cc727fb66a0178b 100644 (file)
@@ -67,8 +67,6 @@ static JNINativeMethod methods[] = {
  
 *******************************************************************************/
  
-// FIXME
-extern "C" { 
 void _Jv_com_sun_cldchi_io_ConsoleOutputStream_init(void)
 {
        utf *u;
@@ -77,7 +75,6 @@ void _Jv_com_sun_cldchi_io_ConsoleOutputStream_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 3e0b45434836372092329326a3ebd413b173e394..229b929112e596801bb2e76b57d1e07b99ee7e18 100644 (file)
@@ -82,8 +82,6 @@ static JNINativeMethod methods[] = {
  
 *******************************************************************************/
  
-// FIXME
-extern "C" { 
 void _Jv_com_sun_cldchi_jvm_JVM_init(void)
 {
        utf *u;
@@ -92,7 +90,6 @@ void _Jv_com_sun_cldchi_jvm_JVM_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 90ed82147800c6a373d1e87ea5f17c0c0e19e57a..57b5ddaace8508f0a4972b7ef4c2c931534e36f7 100644 (file)
@@ -214,14 +214,13 @@ static JNINativeMethod methods[] = {
        { (char*) "getName",          (char*) "()Ljava/lang/String;",                 (void*) (uintptr_t) &Java_java_lang_Class_getName          },
 };
 
+
 /* _Jv_java_lang_Class_init ****************************************************
  
    Register native functions.
  
 *******************************************************************************/
 
-// FIXME
-extern "C" { 
 void _Jv_java_lang_Class_init(void)
 {
        utf *u;
@@ -230,7 +229,6 @@ void _Jv_java_lang_Class_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 594e8a265e236f43b23b45a284d2c1969ce1f5fb..de0ee083dbd5667720684ade7e6662d5f3f05c23 100644 (file)
@@ -105,8 +105,6 @@ static JNINativeMethod methods[] = {
  
 *******************************************************************************/
 
-// FIXME
-extern "C" { 
 void _Jv_java_lang_Double_init(void)
 {
        utf *u;
@@ -115,7 +113,6 @@ void _Jv_java_lang_Double_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index ab49dda7bb0c958f235fd5b095543da826ad7d05..6a4face1d70703ebcd53d06294428c89b701231b 100644 (file)
@@ -77,8 +77,6 @@ static JNINativeMethod methods[] = {
  
 *******************************************************************************/
 
-// FIXME
-extern "C" { 
 void _Jv_java_lang_Float_init(void)
 {
        utf *u;
@@ -87,7 +85,6 @@ void _Jv_java_lang_Float_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index a5827b97b2720848d1df7d18325d8f91a9bbc837..b728f783cd4e5f68f308578b506088d9327fb66b 100644 (file)
@@ -126,8 +126,6 @@ static JNINativeMethod methods[] = {
  
 *******************************************************************************/
 
-// FIXME
-extern "C" { 
 void _Jv_java_lang_Math_init(void)
 {
        utf *u;
@@ -136,7 +134,6 @@ void _Jv_java_lang_Math_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 9df64c167b198ce6c36333f767c0f5cf9011ead9..839dca7444977e009529bdf1cd8e4a8a97553487 100644 (file)
@@ -145,8 +145,6 @@ static JNINativeMethod methods[] = {
  
 *******************************************************************************/
  
-// FIXME
-extern "C" {
 void _Jv_java_lang_Object_init(void)
 {
        utf *u;
@@ -155,7 +153,6 @@ void _Jv_java_lang_Object_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 9e93c0825ce633af9ac10e498cd3f2f3c350627a..c7751160563ff7c9fc796b915143bf7b7dd6f3c1 100644 (file)
@@ -105,8 +105,6 @@ static JNINativeMethod methods[] = {
  
 *******************************************************************************/
  
-// FIXME
-extern "C" {
 void _Jv_java_lang_Runtime_init(void)
 {
        utf *u;
@@ -115,7 +113,6 @@ void _Jv_java_lang_Runtime_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index e93d25af43f3bbdff1576a2ee8043ac29ce10166..c9e49c89a40c0ab345c4508bdaeb29e3a96d6e74 100644 (file)
@@ -198,8 +198,6 @@ static JNINativeMethod methods[] = {
  
 *******************************************************************************/
  
-// FIXME
-extern "C" {
 void _Jv_java_lang_String_init(void)
 {
        utf *u;
@@ -208,7 +206,6 @@ void _Jv_java_lang_String_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index e47c3c15bbd100771962d8defba1114cf3d19a8f..47f3e63b0fbeeb017a2388976efcb72daf10828a 100644 (file)
@@ -110,8 +110,6 @@ static JNINativeMethod methods[] = {
  
 *******************************************************************************/
  
-// FIXME
-extern "C" {
 void _Jv_java_lang_System_init(void)
 {
        utf *u;
@@ -120,7 +118,6 @@ void _Jv_java_lang_System_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 9863574e1354dc0ccff244528bb6b27aa7d021a6..d7e6750e890f251146e88f2a29fcf7b37cafbf6d 100644 (file)
@@ -199,8 +199,6 @@ static JNINativeMethod methods[] = {
  
 *******************************************************************************/
  
-// FIXME
-extern "C" {
 void _Jv_java_lang_Thread_init(void)
 {
        utf *u;
@@ -209,7 +207,6 @@ void _Jv_java_lang_Thread_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 785e9677dd7a397583838a27423ac453701930a9..8385cf9b41e7c8a95521c1a931a18cc9ad68c8ca 100644 (file)
@@ -92,8 +92,6 @@ static JNINativeMethod methods[] = {
  
 *******************************************************************************/
  
-// FIXME
-extern "C" {
 void _Jv_java_lang_Throwable_init(void)
 {
        utf *u;
@@ -102,7 +100,6 @@ void _Jv_java_lang_Throwable_init(void)
  
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index ee8becd8c52cb00b39d032ba97ae81c631b3dfc9..ac09c220cd3fd211b51f3836ff0ad56d1d44c3cf 100644 (file)
@@ -124,8 +124,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_gnu_classpath_VMStackWalker_init(void)
 {
        utf *u;
@@ -134,7 +132,6 @@ void _Jv_gnu_classpath_VMStackWalker_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 7b14b4329ebb639a3e3504eac2978c85469073e3..25b7d7967ca567c50c703e4122ee67ae551df8d8 100644 (file)
@@ -134,8 +134,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_gnu_classpath_VMSystemProperties_init(void)
 {
        utf *u;
@@ -144,7 +142,6 @@ void _Jv_gnu_classpath_VMSystemProperties_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 90f92c89f778e138aa350c78e67acde602d8e6a2..d414ee26953a1db00598e1305b0dd48f927da4b2 100644 (file)
@@ -101,8 +101,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_gnu_java_lang_VMCPStringBuilder_init(void)
 {
        utf *u;
@@ -111,7 +109,6 @@ void _Jv_gnu_java_lang_VMCPStringBuilder_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 7008efccf1c867c8fe7c963a239a258b74d153b0..80fd5654c8102c8599800b92ba70722d59101edd 100644 (file)
@@ -119,8 +119,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_gnu_java_lang_management_VMClassLoadingMXBeanImpl_init(void)
 {
        utf *u;
@@ -129,7 +127,6 @@ void _Jv_gnu_java_lang_management_VMClassLoadingMXBeanImpl_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index b7440e8e019fec4d6a583176c63f05ef05ca6fab..221b0fd1249df371a5d0d568f7cace8555f7f1bc 100644 (file)
@@ -173,8 +173,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_gnu_java_lang_management_VMMemoryMXBeanImpl_init(void)
 {
        utf *u;
@@ -183,7 +181,6 @@ void _Jv_gnu_java_lang_management_VMMemoryMXBeanImpl_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index daeee412030de6dc677b0b3ca1c7740bab8f395c..b469172b459889ef1dfd2b6e8d6c208e49648037 100644 (file)
@@ -84,8 +84,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_gnu_java_lang_management_VMRuntimeMXBeanImpl_init(void)
 {
        utf *u;
@@ -94,7 +92,6 @@ void _Jv_gnu_java_lang_management_VMRuntimeMXBeanImpl_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 85be25bfc2181718877f5f869a483ec3314b2b9d..19ce5197ab5c3f523b977798c00f6e6cae6de981 100644 (file)
@@ -189,8 +189,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_gnu_java_lang_management_VMThreadMXBeanImpl_init(void)
 {
        utf *u;
@@ -199,7 +197,6 @@ void _Jv_gnu_java_lang_management_VMThreadMXBeanImpl_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 95d712d0626a597476ff0a82735070f2dde0547f..998b8c41b17a27ca6a97d3243b8dfccff35fcff9 100644 (file)
@@ -615,8 +615,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_java_lang_VMClass_init(void)
 {
        utf *u;
@@ -625,7 +623,6 @@ void _Jv_java_lang_VMClass_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 32bc1660e90f0785846d6a48cacb657d649c5f53..60a0083d9d06995b1f49a1ce17e9ee28d8db30e0 100644 (file)
@@ -597,8 +597,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_java_lang_VMClassLoader_init(void)
 {
        utf *u;
@@ -607,7 +605,6 @@ void _Jv_java_lang_VMClassLoader_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 6d270ab773102a01b9a0f375e7f5b43503666e02..c80de0ecf98de5c73a83eb60a410c683700da6ac 100644 (file)
@@ -144,8 +144,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_java_lang_VMObject_init(void)
 {
        utf *u;
@@ -154,7 +152,6 @@ void _Jv_java_lang_VMObject_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 4e7a39ee0d830c8b8a981dcaaab8ad344e7e513b..c26433d7fa3cb512eb0db41b121b2641f3d34330 100644 (file)
@@ -293,8 +293,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_java_lang_VMRuntime_init(void)
 {
        utf *u;
@@ -303,7 +301,6 @@ void _Jv_java_lang_VMRuntime_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 80f06722520a63714d0bbe7129a2537f5d01aa0b..7660a38e3ea344462c9ef9ee21f7af64e8475abf 100644 (file)
@@ -70,8 +70,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_java_lang_VMString_init(void)
 {
        utf *u;
@@ -80,7 +78,6 @@ void _Jv_java_lang_VMString_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index a8f4b334c7306af1948e4f6aee4455299599b96e..640dfd60e9418c2538a3ad213c81deeefc9e68de 100644 (file)
@@ -86,8 +86,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_java_lang_VMSystem_init(void)
 {
        utf *u;
@@ -96,7 +94,6 @@ void _Jv_java_lang_VMSystem_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 84d5c41d323c699583734825333d45514b94c735..76aaaf81d766d4a81a9d749a4ca572b741bb92c7 100644 (file)
@@ -346,8 +346,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_java_lang_VMThread_init(void)
 {
        utf *u;
@@ -356,7 +354,6 @@ void _Jv_java_lang_VMThread_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 12f75e5787fa09c3432505572fdc2a8952ef2223..36dfaa3156542a37ba575aec5e633bfd2d8b0a77 100644 (file)
@@ -180,7 +180,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-extern "C" {
 void _Jv_java_lang_VMThrowable_init(void)
 {
        utf *u;
@@ -189,7 +188,6 @@ void _Jv_java_lang_VMThrowable_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index a566f7444cb868b25e2a9c3d5b9e8c4cd466d55d..9d91b0c3db04f7ef2613082a7ff7a65211f581f8 100644 (file)
@@ -113,8 +113,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_java_lang_management_VMManagementFactory_init(void)
 {
        utf *u;
@@ -123,7 +121,6 @@ void _Jv_java_lang_management_VMManagementFactory_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index ffd97f2b9bfd98c5e8b7df66621eb17f6fab8460..42664496f019d7d4e3d140d674d29bd669b3bc85 100644 (file)
@@ -204,7 +204,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-extern "C" {
 void _Jv_java_lang_reflect_VMConstructor_init(void)
 {
        utf *u;
@@ -213,7 +212,6 @@ void _Jv_java_lang_reflect_VMConstructor_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 64a33213da04f26ecede432c8e5fe69b0a56703a..fe8fbb77e19cb9f6e20107a976ea831a6ed0d16d 100644 (file)
@@ -1111,8 +1111,6 @@ static const JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_java_lang_reflect_VMField_init(void)
 {
        utf *u;
@@ -1121,7 +1119,6 @@ void _Jv_java_lang_reflect_VMField_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 16b34aab3373245f89ba40a8f89644ce73496df5..e89f28af4d3cf47c72f59474d19b88561d6f3fb9 100644 (file)
@@ -285,8 +285,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_java_lang_reflect_VMMethod_init(void)
 {
        utf *u;
@@ -295,7 +293,6 @@ void _Jv_java_lang_reflect_VMMethod_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index e52de0e350bcad030b8e557d2ea4e19081ca1554..29f894bfb482023edd55305837cffa0bc38d577f 100644 (file)
@@ -51,16 +51,16 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
+#if 0
 void _Jv_java_lang_reflect_VMProxy_init(void)
 {
-#if 0
        utf *u;
 
        u = utf_new_char("java/lang/reflect/VMProxy");
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
-#endif
 }
+#endif
 
 
 #if 0
index 90cd29a5457477d77e9db4d45e1641b3e3449208..0e6c17ff61ea4a19df960428684178c906c1e9b4 100644 (file)
@@ -69,8 +69,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_java_security_VMAccessController_init(void)
 {
        utf *u;
@@ -79,7 +77,6 @@ void _Jv_java_security_VMAccessController_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index 940559cc2a063026d6ca03af38f7cda993115e36..a17a853653f0c675be465baf6f7778946f9e5e22 100644 (file)
@@ -67,8 +67,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_java_util_concurrent_atomic_AtomicLong_init(void)
 {
        utf *u;
@@ -77,7 +75,6 @@ void _Jv_java_util_concurrent_atomic_AtomicLong_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
index eb063169e1e77dd3e8f4e3a23bdcd360f88b677a..13c274b1ade06a0a765b38411fe077ebb992fa25 100644 (file)
@@ -416,13 +416,10 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_sun_reflect_ConstantPool_init(void)
 {
        native_method_register(utf_new_char("sun/reflect/ConstantPool"), methods, NATIVE_METHODS_COUNT);
 }
-}
 
 
 /*
diff --git a/src/native/vm/nativevm.c b/src/native/vm/nativevm.c
deleted file mode 100644 (file)
index 8693562..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/* src/native/vm/nativevm.c - register the native functions
-
-   Copyright (C) 2007, 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.
-
-*/
-
-
-#include "config.h"
-
-#include <stdint.h>
-
-#include "native/vm/nativevm.h"
-
-#include "vm/class.h"
-#include "vm/initialize.h"
-#include "vm/method.h"
-#include "vm/options.h"
-#include "vm/os.hpp"
-
-#if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
-# include "mm/memory.h"
-
-# include "native/native.hpp"
-
-# include "native/vm/openjdk/hpi.hpp"
-
-# include "vm/globals.hpp"
-# include "vm/properties.hpp"
-# include "vm/utf8.h"
-# include "vm/vm.hpp"
-#endif
-
-
-/* nativevm_preinit ************************************************************
-
-   Pre-initialize the implementation specific native stuff.
-
-*******************************************************************************/
-
-void nativevm_preinit(void)
-{
-       /* Register native methods of all classes implemented. */
-
-#if defined(ENABLE_JAVASE)
-# if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
-
-       TRACESUBSYSTEMINITIALIZATION("nativevm_preinit");
-
-       _Jv_gnu_classpath_VMStackWalker_init();
-       _Jv_gnu_classpath_VMSystemProperties_init();
-       _Jv_gnu_java_lang_VMCPStringBuilder_init();
-       _Jv_gnu_java_lang_management_VMClassLoadingMXBeanImpl_init();
-       _Jv_gnu_java_lang_management_VMMemoryMXBeanImpl_init();
-       _Jv_gnu_java_lang_management_VMRuntimeMXBeanImpl_init();
-       _Jv_gnu_java_lang_management_VMThreadMXBeanImpl_init();
-       _Jv_java_lang_VMClass_init();
-       _Jv_java_lang_VMClassLoader_init();
-       _Jv_java_lang_VMObject_init();
-       _Jv_java_lang_VMRuntime_init();
-       _Jv_java_lang_VMSystem_init();
-       _Jv_java_lang_VMString_init();
-       _Jv_java_lang_VMThread_init();
-       _Jv_java_lang_VMThrowable_init();
-       _Jv_java_lang_management_VMManagementFactory_init();
-       _Jv_java_lang_reflect_VMConstructor_init();
-       _Jv_java_lang_reflect_VMField_init();
-       _Jv_java_lang_reflect_VMMethod_init();
-       _Jv_java_lang_reflect_VMProxy_init();
-       _Jv_java_security_VMAccessController_init();
-       _Jv_java_util_concurrent_atomic_AtomicLong_init();
-       _Jv_sun_misc_Unsafe_init();
-
-#if defined(ENABLE_ANNOTATIONS)
-       _Jv_sun_reflect_ConstantPool_init();
-#endif
-
-# elif defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
-
-       const char* boot_library_path;
-       int   len;
-       char* p;
-       utf*  u;
-       void* handle;
-
-       TRACESUBSYSTEMINITIALIZATION("nativevm_preinit");
-
-       /* Load libjava.so */
-
-       boot_library_path = Properties_get("sun.boot.library.path");
-
-       len =
-               os_strlen(boot_library_path) +
-               os_strlen("/libjava.so") +
-               os_strlen("0");
-
-       p = MNEW(char, len);
-
-       os_strcpy(p, boot_library_path);
-       os_strcat(p, "/libjava.so");
-
-       u = utf_new_char(p);
-
-       handle = native_library_open(u);
-
-       if (handle == NULL)
-               vm_abort("nativevm_init: failed to open libjava.so at: %s", p);
-
-       MFREE(p, char, len);
-
-       native_library_add(u, NULL, handle);
-
-       /* Initialize the HPI. */
-
-       HPI_initialize();
-
-       _Jv_sun_misc_Unsafe_init();
-
-# else
-#  error unknown classpath configuration
-# endif
-
-#elif defined(ENABLE_JAVAME_CLDC1_1)
-
-       TRACESUBSYSTEMINITIALIZATION("nativevm_preinit");
-
-       _Jv_com_sun_cldc_io_ResourceInputStream_init();
-       _Jv_com_sun_cldc_io_j2me_socket_Protocol_init();
-       _Jv_com_sun_cldchi_io_ConsoleOutputStream_init();
-       _Jv_com_sun_cldchi_jvm_JVM_init();
-       _Jv_java_lang_Class_init();
-       _Jv_java_lang_Double_init();
-       _Jv_java_lang_Float_init();
-       _Jv_java_lang_Math_init();
-       _Jv_java_lang_Object_init();
-       _Jv_java_lang_Runtime_init();
-       _Jv_java_lang_String_init();
-       _Jv_java_lang_System_init();
-       _Jv_java_lang_Thread_init();
-       _Jv_java_lang_Throwable_init();
-
-#else
-# error unknown Java configuration
-#endif
-}
-
-
-/* nativevm_init ***************************************************************
-
-   Initialize the implementation specific native stuff.
-
-*******************************************************************************/
-
-void nativevm_init(void)
-{
-#if defined(ENABLE_JAVASE)
-
-# if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
-
-       TRACESUBSYSTEMINITIALIZATION("nativevm_init");
-
-       /* nothing to do */
-
-# elif defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
-
-       methodinfo *m;
-
-       TRACESUBSYSTEMINITIALIZATION("nativevm_init");
-
-       m = class_resolveclassmethod(class_java_lang_System,
-                                                                utf_new_char("initializeSystemClass"),
-                                                                utf_void__void,
-                                                                class_java_lang_Object,
-                                                                false);
-
-       if (m == NULL)
-               vm_abort("nativevm_init: Error resolving java.lang.System.initializeSystemClass()");
-
-       (void) vm_call_method(m, NULL);
-
-# else
-#  error unknown classpath configuration
-# endif
-
-#elif defined(ENABLE_JAVAME_CLDC1_1)
-
-       TRACESUBSYSTEMINITIALIZATION("nativevm_init");
-
-       /* nothing to do */
-
-#else
-# error unknown Java configuration
-#endif
-}
-
-
-/*
- * These are local overrides for various environment variables in Emacs.
- * Please do not remove this and leave it at the end of the file, where
- * Emacs will automagically detect them.
- * ---------------------------------------------------------------------
- * Local variables:
- * mode: c
- * indent-tabs-mode: t
- * c-basic-offset: 4
- * tab-width: 4
- * End:
- */
diff --git a/src/native/vm/nativevm.cpp b/src/native/vm/nativevm.cpp
new file mode 100644 (file)
index 0000000..54db83e
--- /dev/null
@@ -0,0 +1,211 @@
+/* src/native/vm/nativevm.cpp - Register native VM interface functions.
+
+   Copyright (C) 2007, 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.
+
+*/
+
+
+#include "config.h"
+
+#include <stdint.h>
+
+#include "native/vm/nativevm.hpp"
+
+#include "vm/class.h"
+#include "vm/initialize.h"
+#include "vm/method.h"
+#include "vm/options.h"
+#include "vm/os.hpp"
+
+#if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
+# include "mm/memory.h"
+
+# include "native/native.hpp"
+
+# include "native/vm/openjdk/hpi.hpp"
+
+# include "vm/globals.hpp"
+# include "vm/properties.hpp"
+# include "vm/utf8.h"
+# include "vm/vm.hpp"
+#endif
+
+
+/* nativevm_preinit ************************************************************
+
+   Pre-initialize the implementation specific native stuff.
+
+*******************************************************************************/
+
+void nativevm_preinit(void)
+{
+       TRACESUBSYSTEMINITIALIZATION("nativevm_preinit");
+
+       /* Register native methods of all classes implemented. */
+
+#if defined(ENABLE_JAVASE)
+# if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
+
+       _Jv_gnu_classpath_VMStackWalker_init();
+       _Jv_gnu_classpath_VMSystemProperties_init();
+       _Jv_gnu_java_lang_VMCPStringBuilder_init();
+       _Jv_gnu_java_lang_management_VMClassLoadingMXBeanImpl_init();
+       _Jv_gnu_java_lang_management_VMMemoryMXBeanImpl_init();
+       _Jv_gnu_java_lang_management_VMRuntimeMXBeanImpl_init();
+       _Jv_gnu_java_lang_management_VMThreadMXBeanImpl_init();
+       _Jv_java_lang_VMClass_init();
+       _Jv_java_lang_VMClassLoader_init();
+       _Jv_java_lang_VMObject_init();
+       _Jv_java_lang_VMRuntime_init();
+       _Jv_java_lang_VMSystem_init();
+       _Jv_java_lang_VMString_init();
+       _Jv_java_lang_VMThread_init();
+       _Jv_java_lang_VMThrowable_init();
+       _Jv_java_lang_management_VMManagementFactory_init();
+       _Jv_java_lang_reflect_VMConstructor_init();
+       _Jv_java_lang_reflect_VMField_init();
+       _Jv_java_lang_reflect_VMMethod_init();
+       //_Jv_java_lang_reflect_VMProxy_init();
+       _Jv_java_security_VMAccessController_init();
+       _Jv_java_util_concurrent_atomic_AtomicLong_init();
+       _Jv_sun_misc_Unsafe_init();
+
+#if defined(ENABLE_ANNOTATIONS)
+       _Jv_sun_reflect_ConstantPool_init();
+#endif
+
+# elif defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
+
+       // Load libjava.so
+       VM* vm = VM::get_current();
+       Properties& properties = vm->get_properties();
+       const char* boot_library_path = properties.get("sun.boot.library.path");
+
+       size_t len =
+               os::strlen(boot_library_path) +
+               os::strlen("/libjava.so") +
+               os::strlen("0");
+
+       char* p = MNEW(char, len);
+
+       os::strcpy(p, boot_library_path);
+       os::strcat(p, "/libjava.so");
+
+       utf* u = utf_new_char(p);
+
+       void* handle = native_library_open(u);
+
+       if (handle == NULL)
+               vm_abort("nativevm_init: failed to open libjava.so at: %s", p);
+
+       MFREE(p, char, len);
+
+       native_library_add(u, NULL, handle);
+
+       // Initialize the HPI.
+       HPI& hpi = vm->get_hpi();
+       hpi.initialize();
+
+       _Jv_sun_misc_Unsafe_init();
+
+# else
+#  error unknown classpath configuration
+# endif
+
+#elif defined(ENABLE_JAVAME_CLDC1_1)
+
+       _Jv_com_sun_cldc_io_ResourceInputStream_init();
+       _Jv_com_sun_cldc_io_j2me_socket_Protocol_init();
+       _Jv_com_sun_cldchi_io_ConsoleOutputStream_init();
+       _Jv_com_sun_cldchi_jvm_JVM_init();
+       _Jv_java_lang_Class_init();
+       _Jv_java_lang_Double_init();
+       _Jv_java_lang_Float_init();
+       _Jv_java_lang_Math_init();
+       _Jv_java_lang_Object_init();
+       _Jv_java_lang_Runtime_init();
+       _Jv_java_lang_String_init();
+       _Jv_java_lang_System_init();
+       _Jv_java_lang_Thread_init();
+       _Jv_java_lang_Throwable_init();
+
+#else
+# error unknown Java configuration
+#endif
+}
+
+
+/* nativevm_init ***************************************************************
+
+   Initialize the implementation specific native stuff.
+
+*******************************************************************************/
+
+void nativevm_init(void)
+{
+       TRACESUBSYSTEMINITIALIZATION("nativevm_init");
+
+#if defined(ENABLE_JAVASE)
+
+# if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
+
+       // Nothing to do.
+
+# elif defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
+
+       methodinfo* m = class_resolveclassmethod(class_java_lang_System,
+                                                                                        utf_new_char("initializeSystemClass"),
+                                                                                        utf_void__void,
+                                                                                        class_java_lang_Object,
+                                                                                        false);
+
+       if (m == NULL)
+               os::abort("nativevm_init: Error resolving java.lang.System.initializeSystemClass()");
+
+       (void) vm_call_method(m, NULL);
+
+# else
+#  error unknown classpath configuration
+# endif
+
+#elif defined(ENABLE_JAVAME_CLDC1_1)
+
+       // Nothing to do.
+
+#else
+# error unknown Java configuration
+#endif
+}
+
+
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * 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:
+ */
diff --git a/src/native/vm/nativevm.h b/src/native/vm/nativevm.h
deleted file mode 100644 (file)
index de4ba48..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/* src/native/vm/nativevm.h - register the native functions
-
-   Copyright (C) 2007, 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.
-
-*/
-
-
-#ifndef _NATIVEVM_H
-#define _NATIVEVM_H
-
-#include "config.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "vm/types.h"
-
-#include "vm/global.h"
-
-
-/* function prototypes ********************************************************/
-
-void nativevm_preinit(void);
-void nativevm_init(void);
-
-#if defined(ENABLE_JAVASE)
-# if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
-
-void _Jv_gnu_classpath_VMStackWalker_init();
-void _Jv_gnu_classpath_VMSystemProperties_init();
-void _Jv_gnu_java_lang_VMCPStringBuilder_init();
-void _Jv_gnu_java_lang_management_VMClassLoadingMXBeanImpl_init();
-void _Jv_gnu_java_lang_management_VMMemoryMXBeanImpl_init();
-void _Jv_gnu_java_lang_management_VMRuntimeMXBeanImpl_init();
-void _Jv_gnu_java_lang_management_VMThreadMXBeanImpl_init();
-void _Jv_java_lang_VMClass_init();
-void _Jv_java_lang_VMClassLoader_init();
-void _Jv_java_lang_VMObject_init();
-void _Jv_java_lang_VMRuntime_init();
-void _Jv_java_lang_VMString_init();
-void _Jv_java_lang_VMSystem_init();
-void _Jv_java_lang_VMThread_init();
-void _Jv_java_lang_VMThrowable_init();
-void _Jv_java_lang_management_VMManagementFactory_init();
-void _Jv_java_lang_reflect_VMConstructor_init();
-void _Jv_java_lang_reflect_VMField_init();
-void _Jv_java_lang_reflect_VMMethod_init();
-void _Jv_java_lang_reflect_VMProxy_init();
-void _Jv_java_security_VMAccessController_init();
-void _Jv_java_util_concurrent_atomic_AtomicLong_init();
-void _Jv_sun_misc_Unsafe_init();
-
-#if defined(ENABLE_ANNOTATIONS)
-void _Jv_sun_reflect_ConstantPool_init();
-#endif
-
-# elif defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
-
-void _Jv_sun_misc_Unsafe_init();
-
-# else
-#  error unknown classpath configuration
-# endif
-
-#elif defined(ENABLE_JAVAME_CLDC1_1)
-
-void _Jv_com_sun_cldc_io_ResourceInputStream_init();
-void _Jv_com_sun_cldc_io_j2me_socket_Protocol_init();
-void _Jv_com_sun_cldchi_io_ConsoleOutputStream_init();
-void _Jv_com_sun_cldchi_jvm_JVM_init();
-void _Jv_java_lang_Class_init();
-void _Jv_java_lang_Double_init();
-void _Jv_java_lang_Float_init();
-void _Jv_java_lang_Math_init();
-void _Jv_java_lang_Object_init();
-void _Jv_java_lang_Runtime_init();
-void _Jv_java_lang_String_init();
-void _Jv_java_lang_System_init();
-void _Jv_java_lang_Thread_init();
-void _Jv_java_lang_Throwable_init();
-
-#else
-# error unknown Java configuration
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _NATIVEVM_H */
-
-
-/*
- * 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:
- */
diff --git a/src/native/vm/nativevm.hpp b/src/native/vm/nativevm.hpp
new file mode 100644 (file)
index 0000000..826643f
--- /dev/null
@@ -0,0 +1,111 @@
+/* src/native/vm/nativevm.hpp - Register native VM interface functions.
+
+   Copyright (C) 2007, 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.
+
+*/
+
+
+#ifndef _NATIVEVM_HPP
+#define _NATIVEVM_HPP
+
+#include "config.h"
+
+/* function prototypes ********************************************************/
+
+void nativevm_preinit(void);
+void nativevm_init(void);
+
+#if defined(ENABLE_JAVASE)
+# if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
+
+void _Jv_gnu_classpath_VMStackWalker_init();
+void _Jv_gnu_classpath_VMSystemProperties_init();
+void _Jv_gnu_java_lang_VMCPStringBuilder_init();
+void _Jv_gnu_java_lang_management_VMClassLoadingMXBeanImpl_init();
+void _Jv_gnu_java_lang_management_VMMemoryMXBeanImpl_init();
+void _Jv_gnu_java_lang_management_VMRuntimeMXBeanImpl_init();
+void _Jv_gnu_java_lang_management_VMThreadMXBeanImpl_init();
+void _Jv_java_lang_VMClass_init();
+void _Jv_java_lang_VMClassLoader_init();
+void _Jv_java_lang_VMObject_init();
+void _Jv_java_lang_VMRuntime_init();
+void _Jv_java_lang_VMString_init();
+void _Jv_java_lang_VMSystem_init();
+void _Jv_java_lang_VMThread_init();
+void _Jv_java_lang_VMThrowable_init();
+void _Jv_java_lang_management_VMManagementFactory_init();
+void _Jv_java_lang_reflect_VMConstructor_init();
+void _Jv_java_lang_reflect_VMField_init();
+void _Jv_java_lang_reflect_VMMethod_init();
+void _Jv_java_lang_reflect_VMProxy_init();
+void _Jv_java_security_VMAccessController_init();
+void _Jv_java_util_concurrent_atomic_AtomicLong_init();
+void _Jv_sun_misc_Unsafe_init();
+
+#if defined(ENABLE_ANNOTATIONS)
+void _Jv_sun_reflect_ConstantPool_init();
+#endif
+
+# elif defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
+
+void _Jv_sun_misc_Unsafe_init();
+
+# else
+#  error unknown classpath configuration
+# endif
+
+#elif defined(ENABLE_JAVAME_CLDC1_1)
+
+void _Jv_com_sun_cldc_io_ResourceInputStream_init();
+void _Jv_com_sun_cldc_io_j2me_socket_Protocol_init();
+void _Jv_com_sun_cldchi_io_ConsoleOutputStream_init();
+void _Jv_com_sun_cldchi_jvm_JVM_init();
+void _Jv_java_lang_Class_init();
+void _Jv_java_lang_Double_init();
+void _Jv_java_lang_Float_init();
+void _Jv_java_lang_Math_init();
+void _Jv_java_lang_Object_init();
+void _Jv_java_lang_Runtime_init();
+void _Jv_java_lang_String_init();
+void _Jv_java_lang_System_init();
+void _Jv_java_lang_Thread_init();
+void _Jv_java_lang_Throwable_init();
+
+#else
+# error unknown Java configuration
+#endif
+
+#endif // _NATIVEVM_HPP
+
+
+/*
+ * 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 1117cd851d768e91fc65642742e203345ba035c8..95fcef7bbc8a67b697cc980d0d81af07b7d52274 100644 (file)
@@ -1153,8 +1153,6 @@ static JNINativeMethod methods[] = {
 
 *******************************************************************************/
 
-// FIXME
-extern "C" {
 void _Jv_sun_misc_Unsafe_init(void)
 {
        utf *u;
@@ -1163,7 +1161,7 @@ void _Jv_sun_misc_Unsafe_init(void)
 
        native_method_register(u, methods, NATIVE_METHODS_COUNT);
 }
-}
+
 
 /*
  * These are local overrides for various environment variables in Emacs.
@@ -1176,4 +1174,5 @@ void _Jv_sun_misc_Unsafe_init(void)
  * c-basic-offset: 4
  * tab-width: 4
  * End:
+ * vim:noexpandtab:sw=4:ts=4:
  */
index 7f8d65c4514556efc9a0ada34856ba61c3979137..30e8d3bfcc6f7a3bf7986a4f9c74d2d49041ca67 100644 (file)
@@ -50,7 +50,7 @@
 #include "native/localref.hpp"
 #include "native/native.hpp"
 
-#include "native/vm/nativevm.h"
+#include "native/vm/nativevm.hpp"
 
 #include "threads/lock.hpp"
 #include "threads/thread.hpp"