mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
wasm: fix bugs in coroutine support
This commit is contained in:
parent
219de85e24
commit
ab507bb22b
|
@ -126,6 +126,7 @@ public class CoroutineTransformation {
|
||||||
splitter.fixProgram();
|
splitter.fixProgram();
|
||||||
processIrreducibleCfg();
|
processIrreducibleCfg();
|
||||||
RedundantJumpElimination.optimize(program);
|
RedundantJumpElimination.optimize(program);
|
||||||
|
new PhiUpdater().updatePhis(program, parameterCount + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createSplitPrologue() {
|
private void createSplitPrologue() {
|
||||||
|
@ -479,7 +480,6 @@ public class CoroutineTransformation {
|
||||||
weights[i] = program.basicBlockAt(i).instructionCount();
|
weights[i] = program.basicBlockAt(i).instructionCount();
|
||||||
}
|
}
|
||||||
GraphUtils.splitIrreducibleGraph(graph, weights, splittingBackend);
|
GraphUtils.splitIrreducibleGraph(graph, weights, splittingBackend);
|
||||||
new PhiUpdater().updatePhis(program, parameterCount + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class SplittingBackend implements GraphSplittingBackend {
|
class SplittingBackend implements GraphSplittingBackend {
|
||||||
|
|
|
@ -1114,7 +1114,7 @@ public class WasmTarget implements TeaVMTarget, TeaVMWasmHost {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAsyncSupported() {
|
public boolean isAsyncSupported() {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -17,7 +17,6 @@ package org.teavm.backend.wasm.intrinsics;
|
||||||
|
|
||||||
import org.teavm.ast.InvocationExpr;
|
import org.teavm.ast.InvocationExpr;
|
||||||
import org.teavm.backend.wasm.model.expression.WasmExpression;
|
import org.teavm.backend.wasm.model.expression.WasmExpression;
|
||||||
import org.teavm.backend.wasm.model.expression.WasmInt32Constant;
|
|
||||||
import org.teavm.model.MethodDescriptor;
|
import org.teavm.model.MethodDescriptor;
|
||||||
import org.teavm.model.MethodReference;
|
import org.teavm.model.MethodReference;
|
||||||
|
|
||||||
|
@ -34,7 +33,6 @@ public class PlatformIntrinsic implements WasmIntrinsic {
|
||||||
switch (methodDescriptor.getName()) {
|
switch (methodDescriptor.getName()) {
|
||||||
case "getPlatformObject":
|
case "getPlatformObject":
|
||||||
case "asJavaClass":
|
case "asJavaClass":
|
||||||
case "createQueue":
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -47,8 +45,6 @@ public class PlatformIntrinsic implements WasmIntrinsic {
|
||||||
case "getPlatformObject":
|
case "getPlatformObject":
|
||||||
case "asJavaClass":
|
case "asJavaClass":
|
||||||
return manager.generate(invocation.getArguments().get(0));
|
return manager.generate(invocation.getArguments().get(0));
|
||||||
case "createQueue":
|
|
||||||
return new WasmInt32Constant(0);
|
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException(invocation.getMethod().toString());
|
throw new IllegalArgumentException(invocation.getMethod().toString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ TeaVM.wasm = function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result >= 0) {
|
if (result >= 0) {
|
||||||
controller.timer = setTimeout(() => process(controller), result)
|
controller.timer = setTimeout(() => process(controller), Number(result))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user