mirror of
https://github.com/corda/corda.git
synced 2025-03-15 16:46:12 +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
|
||||
EXPORT(JVM_ConstantPoolGetFloatAt)(Thread*, jobject, jobject, jint)
|
||||
{ abort(); }
|
||||
|
||||
uint64_t
|
||||
jvmConstantPoolGetDoubleAt(Thread* t, uintptr_t* arguments)
|
||||
EXPORT(JVM_ConstantPoolGetFloatAt)(Thread* t, jobject, jobject pool,
|
||||
jint index)
|
||||
{
|
||||
jobject pool = reinterpret_cast<jobject>(arguments[0]);
|
||||
jint index = arguments[1];
|
||||
ENTER(t, Thread::ActiveState);
|
||||
|
||||
double v; memcpy(&v, &singletonValue(t, *pool, index - 1), 8);
|
||||
|
||||
return doubleToBits(v);
|
||||
return bitsToFloat(singletonValue(t, *pool, index - 1));
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jdouble JNICALL
|
||||
EXPORT(JVM_ConstantPoolGetDoubleAt)(Thread* t, jobject, jobject pool,
|
||||
jint index)
|
||||
{
|
||||
uintptr_t arguments[] = { reinterpret_cast<uintptr_t>(pool),
|
||||
static_cast<uintptr_t>(index) };
|
||||
ENTER(t, Thread::ActiveState);
|
||||
|
||||
return bitsToDouble
|
||||
(run(t, jvmConstantPoolGetDoubleAt, arguments));
|
||||
double v;
|
||||
memcpy(&v, &singletonValue(t, *pool, index - 1), 8);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jstring JNICALL
|
||||
|
Loading…
x
Reference in New Issue
Block a user