#include <stdint.h>
-#include "native/jni.h"
-#include "native/native.h"
+#include "native/jni.hpp"
+#include "native/native.hpp"
#if defined(ENABLE_JNI_HEADERS)
# include "native/include/java_lang_Float.h"
#endif
-#include "vm/builtin.h"
+#include "vm/vm.hpp"
+
+#include "vm/jit/builtin.hpp"
// Native functions are exported as C functions.
return val.i;
}
+/*
+ * Class: java/lang/Float
+ * Method: intBitsToFloat
+ * Signature: (I)F
+ */
+JNIEXPORT jfloat JNICALL Java_java_lang_Float_intBitsToFloat(JNIEnv *env, jclass clazz, jint value)
+{
+ imm_union val;
+ val.i = value;
+ return val.f;
+}
+
} // extern "C"
static JNINativeMethod methods[] = {
{ (char*) "floatToIntBits", (char*) "(F)I", (void*) (uintptr_t) &Java_java_lang_Float_floatToIntBits },
+ { (char*) "intBitsToFloat", (char*) "(I)F", (void*) (uintptr_t) &Java_java_lang_Float_intBitsToFloat }
};
*******************************************************************************/
-// FIXME
-extern "C" {
void _Jv_java_lang_Float_init(void)
{
- utf *u;
+ utf* u = utf_new_char("java/lang/Float");
- u = utf_new_char("java/lang/Float");
-
- native_method_register(u, methods, NATIVE_METHODS_COUNT);
-}
+ NativeMethods& nm = VM::get_current()->get_nativemethods();
+ nm.register_methods(u, methods, NATIVE_METHODS_COUNT);
}