implement JVM_ConstantPoolGetDoubleAt

This commit is contained in:
Joel Dice 2012-08-29 18:34:28 -06:00
parent 374bdb3726
commit 7534eecdb3

View File

@ -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<jobject>(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<uintptr_t>(pool),
static_cast<uintptr_t>(index) };
return bitsToDouble
(run(t, jvmConstantPoolGetDoubleAt, arguments));
}
extern "C" JNIEXPORT jstring JNICALL
EXPORT(JVM_ConstantPoolGetStringAt)(Thread*, jobject, jobject, jint)