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