mirror of
https://github.com/corda/corda.git
synced 2025-06-03 16:10:58 +00:00
implement JVM_ConstantPoolGetFloatAt
This commit also simplifies JVM_ConstantPoolGetDoubleAt, which cannot throw an exception and thus need not go through vmRun.
This commit is contained in:
parent
e3fe9099a2
commit
a18452f6c9
@ -4874,29 +4874,24 @@ EXPORT(JVM_ConstantPoolGetLongAt)(Thread* t, jobject, jobject pool, jint index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT jfloat JNICALL
|
extern "C" JNIEXPORT jfloat JNICALL
|
||||||
EXPORT(JVM_ConstantPoolGetFloatAt)(Thread*, jobject, jobject, jint)
|
EXPORT(JVM_ConstantPoolGetFloatAt)(Thread* t, jobject, jobject pool,
|
||||||
{ abort(); }
|
jint index)
|
||||||
|
|
||||||
uint64_t
|
|
||||||
jvmConstantPoolGetDoubleAt(Thread* t, uintptr_t* arguments)
|
|
||||||
{
|
{
|
||||||
jobject pool = reinterpret_cast<jobject>(arguments[0]);
|
ENTER(t, Thread::ActiveState);
|
||||||
jint index = arguments[1];
|
|
||||||
|
|
||||||
double v; memcpy(&v, &singletonValue(t, *pool, index - 1), 8);
|
return bitsToFloat(singletonValue(t, *pool, index - 1));
|
||||||
|
|
||||||
return doubleToBits(v);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT jdouble JNICALL
|
extern "C" JNIEXPORT jdouble JNICALL
|
||||||
EXPORT(JVM_ConstantPoolGetDoubleAt)(Thread* t, jobject, jobject pool,
|
EXPORT(JVM_ConstantPoolGetDoubleAt)(Thread* t, jobject, jobject pool,
|
||||||
jint index)
|
jint index)
|
||||||
{
|
{
|
||||||
uintptr_t arguments[] = { reinterpret_cast<uintptr_t>(pool),
|
ENTER(t, Thread::ActiveState);
|
||||||
static_cast<uintptr_t>(index) };
|
|
||||||
|
|
||||||
return bitsToDouble
|
double v;
|
||||||
(run(t, jvmConstantPoolGetDoubleAt, arguments));
|
memcpy(&v, &singletonValue(t, *pool, index - 1), 8);
|
||||||
|
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT jstring JNICALL
|
extern "C" JNIEXPORT jstring JNICALL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user