More JNI functions
This commit is contained in:
parent
fe48706b77
commit
7dbc651a51
@ -24,5 +24,11 @@
|
||||
'java.lang.Class' : {
|
||||
'method registerNatives()V' : java_lang_Object_registerNatives,
|
||||
'method getPrimitiveClass(Ljava/lang/String;)Ljava/lang/Class;' : java_lang_Class_getPrimitiveClass
|
||||
},
|
||||
'java.lang.Float' : {
|
||||
'method floatToRawIntBits(F)I' : java_lang_Float_floatToRawIntBits
|
||||
},
|
||||
'java.lang.Double' : {
|
||||
'method doubleToRawLongBits(D)J' : java_lang_Double_doubleToRawLongBits
|
||||
}
|
||||
}
|
@ -35,3 +35,18 @@ function java_lang_System_currentTimeMillis(){
|
||||
function java_lang_Class_getPrimitiveClass (type) {
|
||||
return this.jvm['primitive_' + javaString2JS(type)];
|
||||
}
|
||||
|
||||
//java.lang.Float floatToRawIntBits(F)I
|
||||
function java_lang_Float_floatToRawIntBits(f){
|
||||
var x = new ArrayBuffer(32);
|
||||
new Float32Array(x,0)[0] = f;
|
||||
return new Int32Array(x,0)[0];
|
||||
}
|
||||
|
||||
//java.lang.Double doubleToRawLongBits(D)J
|
||||
function java_lang_Double_doubleToRawLongBits(d){
|
||||
var x = new ArrayBuffer(32);
|
||||
new Float64Array(x,0)[0] = d;
|
||||
var y = new Int32Array(x,0);
|
||||
return new math.Long(y[0],y[1]);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user