Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

implement JVM_ConstantPoolGetFloatAt

This commit also simplifies JVM_ConstantPoolGetDoubleAt, which cannot
throw an exception and thus need not go through vmRun.
  • Loading branch information...
commit a18452f6c96f16e699117fe67a9ae84b6ba17075 1 parent e3fe909
@dicej dicej authored
Showing with 9 additions and 14 deletions.
  1. +9 −14 src/classpath-openjdk.cpp
View
23 src/classpath-openjdk.cpp
@@ -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];
-
- double v; memcpy(&v, &singletonValue(t, *pool, index - 1), 8);
+ ENTER(t, Thread::ActiveState);
- 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
Please sign in to comment.
Something went wrong with that request. Please try again.