Signed-off-by: Tomek Grabiec <[email protected]>
---
include/vm/object.h | 12 ++++++++++++
vm/jni-interface.c | 21 ++++++++++++++++++++-
2 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/include/vm/object.h b/include/vm/object.h
index 1fc65ab..98490a3 100644
--- a/include/vm/object.h
+++ b/include/vm/object.h
@@ -103,6 +103,18 @@ field_get_int32(const struct vm_object *obj, const struct
vm_field *field)
}
static inline void
+field_set_int64(struct vm_object *obj, const struct vm_field *field, int64_t
value)
+{
+ *(int64_t *) &obj->fields[field->offset] = value;
+}
+
+static inline int64_t
+field_get_int64(const struct vm_object *obj, const struct vm_field *field)
+{
+ return *(int64_t *) &obj->fields[field->offset];
+}
+
+static inline void
field_set_object(struct vm_object *obj, const struct vm_field *field, struct
vm_object *value)
{
*(void **) &obj->fields[field->offset] = value;
diff --git a/vm/jni-interface.c b/vm/jni-interface.c
index 405a90a..929fb8b 100644
--- a/vm/jni-interface.c
+++ b/vm/jni-interface.c
@@ -677,6 +677,25 @@ vm_jni_get_static_field_id(struct vm_jni_env *env, jclass
clazz,
return fb;
}
+static jdouble
+vm_jni_get_static_double_field(struct vm_jni_env *env, jobject object,
+ jfieldID field)
+{
+ enter_vm_from_jni();
+
+ if (!object) {
+ signal_new_exception(vm_java_lang_NullPointerException, NULL);
+ return 0;
+ }
+
+ if (vm_field_type(field) != J_DOUBLE || !vm_field_is_static(field)) {
+ NOT_IMPLEMENTED;
+ return 0;
+ }
+
+ return field_get_int64(object, field);
+}
+
/*
* The JNI native interface table.
* See: http://java.sun.com/j2se/1.4.2/docs/guide/jni/spec/functions.html
@@ -896,7 +915,7 @@ void *vm_jni_native_interface[] = {
NULL, /* GetStaticIntField */
NULL, /* GetStaticLongField */
NULL, /* GetStaticFloatField */
- NULL, /* GetStaticDoubleField */
+ vm_jni_get_static_double_field,
NULL, /* SetStaticObjectField */
/* 155 */
--
1.6.0.6
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jatovm-devel