mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fix bug in bytecode parser. Fix
https://github.com/konsoletyper/teavm/issues/104 Fix https://github.com/konsoletyper/teavm/issues/105
This commit is contained in:
parent
fee4fbc24e
commit
26379afc50
|
@ -93,7 +93,7 @@ public final class TMath extends TObject {
|
||||||
public static native double atan2(double y, double x);
|
public static native double atan2(double y, double x);
|
||||||
|
|
||||||
public static int round(float a) {
|
public static int round(float a) {
|
||||||
return (int)(a + 1.5f);
|
return (int)(a + 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long round(double a) {
|
public static long round(double a) {
|
||||||
|
|
|
@ -485,7 +485,12 @@ public class ProgramParser implements VariableDebugInformation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visitMethodInsn(int opcode, String owner, String name, String desc) {
|
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) {
|
||||||
|
throw new IllegalStateException("InvokeDynamic is not supported in TeaVM");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
case Opcodes.INVOKEINTERFACE:
|
case Opcodes.INVOKEINTERFACE:
|
||||||
case Opcodes.INVOKEVIRTUAL:
|
case Opcodes.INVOKEVIRTUAL:
|
||||||
|
|
|
@ -250,6 +250,14 @@ function $rt_createByteMultiArray(dimensions) {
|
||||||
}
|
}
|
||||||
return $rt_createMultiArrayImpl($rt_bytecls(), arrays, dimensions);
|
return $rt_createMultiArrayImpl($rt_bytecls(), arrays, dimensions);
|
||||||
}
|
}
|
||||||
|
function $rt_createCharMultiArray(dimensions) {
|
||||||
|
var arrays = new Array($rt_primitiveArrayCount(dimensions));
|
||||||
|
var firstDim = dimensions[0] | 0;
|
||||||
|
for (var i = 0 | 0; i < arrays.length; i = (i + 1) | 0) {
|
||||||
|
arrays[i] = $rt_createCharArray(firstDim);
|
||||||
|
}
|
||||||
|
return $rt_createMultiArrayImpl($rt_charcls(), arrays, dimensions);
|
||||||
|
}
|
||||||
function $rt_createBooleanMultiArray(dimensions) {
|
function $rt_createBooleanMultiArray(dimensions) {
|
||||||
var arrays = new Array($rt_primitiveArrayCount(dimensions));
|
var arrays = new Array($rt_primitiveArrayCount(dimensions));
|
||||||
var firstDim = dimensions[0] | 0;
|
var firstDim = dimensions[0] | 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user