projects
/
cacao.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* src/vm/hook.hpp: Added new file for hook points.
[cacao.git]
/
src
/
native
/
vm
/
gnuclasspath
/
java_lang_VMObject.cpp
diff --git
a/src/native/vm/gnuclasspath/java_lang_VMObject.cpp
b/src/native/vm/gnuclasspath/java_lang_VMObject.cpp
index b5af0cdefafeb5d236c3e2a28c29bc8b9de02be9..95e7e8cbb350f93c36213e1fdb468499cf0e0d11 100644
(file)
--- a/
src/native/vm/gnuclasspath/java_lang_VMObject.cpp
+++ b/
src/native/vm/gnuclasspath/java_lang_VMObject.cpp
@@
-29,15
+29,15
@@
#include "native/jni.hpp"
#include "native/llni.h"
#include "native/jni.hpp"
#include "native/llni.h"
-#include "native/native.h"
+#include "native/native.h
pp
"
#if defined(ENABLE_JNI_HEADERS)
# include "native/vm/include/java_lang_VMObject.h"
#endif
#if defined(ENABLE_JNI_HEADERS)
# include "native/vm/include/java_lang_VMObject.h"
#endif
-#include "threads/lock
-common.h
"
+#include "threads/lock
.hpp
"
-#include "vm/
builtin.h
"
+#include "vm/
jit/builtin.hpp
"
#include "vm/exceptions.hpp"
#include "vm/javaobjects.hpp"
#include "vm/utf8.h"
#include "vm/exceptions.hpp"
#include "vm/javaobjects.hpp"
#include "vm/utf8.h"
@@
-51,7
+51,7
@@
extern "C" {
* Method: getClass
* Signature: (Ljava/lang/Object;)Ljava/lang/Class;
*/
* Method: getClass
* Signature: (Ljava/lang/Object;)Ljava/lang/Class;
*/
-JNIEXPORT jclass JNICALL Java_java_lang_VMObject_getClass(JNIEnv
*
env, jclass clazz, jobject obj)
+JNIEXPORT jclass JNICALL Java_java_lang_VMObject_getClass(JNIEnv
*
env, jclass clazz, jobject obj)
{
if (obj == NULL) {
exceptions_throw_nullpointerexception();
{
if (obj == NULL) {
exceptions_throw_nullpointerexception();
@@
-69,16
+69,9
@@
JNIEXPORT jclass JNICALL Java_java_lang_VMObject_getClass(JNIEnv *env, jclass cl
* Method: clone
* Signature: (Ljava/lang/Cloneable;)Ljava/lang/Object;
*/
* Method: clone
* Signature: (Ljava/lang/Cloneable;)Ljava/lang/Object;
*/
-JNIEXPORT jobject JNICALL Java_java_lang_VMObject_clone(JNIEnv
*
env, jclass clazz, jobject _this)
+JNIEXPORT jobject JNICALL Java_java_lang_VMObject_clone(JNIEnv
*
env, jclass clazz, jobject _this)
{
{
- java_handle_t *o;
- java_handle_t *co;
-
- o = (java_handle_t *) _this;
-
- co = builtin_clone(NULL, o);
-
- return (jobject) co;
+ return builtin_clone(NULL, _this);
}
}
@@
-87,10
+80,10
@@
JNIEXPORT jobject JNICALL Java_java_lang_VMObject_clone(JNIEnv *env, jclass claz
* Method: notify
* Signature: (Ljava/lang/Object;)V
*/
* Method: notify
* Signature: (Ljava/lang/Object;)V
*/
-JNIEXPORT void JNICALL Java_java_lang_VMObject_notify(JNIEnv
*
env, jclass clazz, jobject _this)
+JNIEXPORT void JNICALL Java_java_lang_VMObject_notify(JNIEnv
*
env, jclass clazz, jobject _this)
{
#if defined(ENABLE_THREADS)
{
#if defined(ENABLE_THREADS)
- lock_notify_object(
(java_handle_t *)
_this);
+ lock_notify_object(_this);
#endif
}
#endif
}
@@
-100,10
+93,10
@@
JNIEXPORT void JNICALL Java_java_lang_VMObject_notify(JNIEnv *env, jclass clazz,
* Method: notifyAll
* Signature: (Ljava/lang/Object;)V
*/
* Method: notifyAll
* Signature: (Ljava/lang/Object;)V
*/
-JNIEXPORT void JNICALL Java_java_lang_VMObject_notifyAll(JNIEnv
*
env, jclass clazz, jobject _this)
+JNIEXPORT void JNICALL Java_java_lang_VMObject_notifyAll(JNIEnv
*
env, jclass clazz, jobject _this)
{
#if defined(ENABLE_THREADS)
{
#if defined(ENABLE_THREADS)
- lock_notify_all_object(
(java_handle_t *)
_this);
+ lock_notify_all_object(_this);
#endif
}
#endif
}
@@
-113,21
+106,10
@@
JNIEXPORT void JNICALL Java_java_lang_VMObject_notifyAll(JNIEnv *env, jclass cla
* Method: wait
* Signature: (Ljava/lang/Object;JI)V
*/
* Method: wait
* Signature: (Ljava/lang/Object;JI)V
*/
-JNIEXPORT void JNICALL Java_java_lang_VMObject_wait(JNIEnv
*
env, jclass clazz, jobject o, jlong ms, jint ns)
+JNIEXPORT void JNICALL Java_java_lang_VMObject_wait(JNIEnv
*
env, jclass clazz, jobject o, jlong ms, jint ns)
{
{
-#if defined(ENABLE_JVMTI)
- /* Monitor Wait */
- if (jvmti) jvmti_MonitorWaiting(true, o, ms);
-#endif
-
#if defined(ENABLE_THREADS)
#if defined(ENABLE_THREADS)
- lock_wait_for_object((java_handle_t *) o, ms, ns);
-#endif
-
-#if defined(ENABLE_JVMTI)
- /* Monitor Waited */
- /* XXX: How do you know if wait timed out ?*/
- if (jvmti) jvmti_MonitorWaiting(false, o, 0);
+ lock_wait_for_object(o, ms, ns);
#endif
}
#endif
}
@@
-151,16
+133,12
@@
static JNINativeMethod methods[] = {
*******************************************************************************/
*******************************************************************************/
-// FIXME
-extern "C" {
void _Jv_java_lang_VMObject_init(void)
{
void _Jv_java_lang_VMObject_init(void)
{
- utf
*u
;
+ utf
* u = utf_new_char("java/lang/VMObject")
;
- u = utf_new_char("java/lang/VMObject");
-
- native_method_register(u, methods, NATIVE_METHODS_COUNT);
-}
+ NativeMethods& nm = VM::get_current()->get_nativemethods();
+ nm.register_methods(u, methods, NATIVE_METHODS_COUNT);
}
}