From 7534eecdb368b7f493c0206dc7343aba7f56e93a Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Wed, 29 Aug 2012 18:34:28 -0600 Subject: [PATCH] implement JVM_ConstantPoolGetDoubleAt --- src/classpath-openjdk.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index 299441a9b7..844739e3e3 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -4678,9 +4678,27 @@ extern "C" JNIEXPORT jfloat JNICALL EXPORT(JVM_ConstantPoolGetFloatAt)(Thread*, jobject, jobject, jint) { abort(); } +uint64_t +jvmConstantPoolGetDoubleAt(Thread* t, uintptr_t* arguments) +{ + jobject pool = reinterpret_cast(arguments[0]); + jint index = arguments[1]; + + double v; memcpy(&singletonValue(t, *pool, index - 1), &v, 8); + + return doubleToBits(v); +} + extern "C" JNIEXPORT jdouble JNICALL -EXPORT(JVM_ConstantPoolGetDoubleAt)(Thread*, jobject, jobject, jint) -{ abort(); } +EXPORT(JVM_ConstantPoolGetDoubleAt)(Thread* t, jobject, jobject pool, + jint index) +{ + uintptr_t arguments[] = { reinterpret_cast(pool), + static_cast(index) }; + + return bitsToDouble + (run(t, jvmConstantPoolGetDoubleAt, arguments)); +} extern "C" JNIEXPORT jstring JNICALL EXPORT(JVM_ConstantPoolGetStringAt)(Thread*, jobject, jobject, jint)