wasm: fix bugs in coroutine support

This commit is contained in:
Alexey Andreev 2023-09-27 20:28:09 +02:00
parent 219de85e24
commit ab507bb22b
4 changed files with 3 additions and 7 deletions

View File

@ -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 {

View File

@ -1114,7 +1114,7 @@ public class WasmTarget implements TeaVMTarget, TeaVMWasmHost {
@Override @Override
public boolean isAsyncSupported() { public boolean isAsyncSupported() {
return false; return true;
} }
@Override @Override

View File

@ -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());
} }

View File

@ -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))
} }
} }