diff --git a/teavm-core/src/main/java/org/teavm/cache/AstIO.java b/teavm-core/src/main/java/org/teavm/cache/AstIO.java index d9bac61e0..e519cc896 100644 --- a/teavm-core/src/main/java/org/teavm/cache/AstIO.java +++ b/teavm-core/src/main/java/org/teavm/cache/AstIO.java @@ -752,7 +752,7 @@ public class AstIO { } case 9: { ConstantExpr expr = new ConstantExpr(); - expr.setValue(symbolTable.at(input.readInt())); + expr.setValue(ValueType.parse(symbolTable.at(input.readInt()))); return expr; } case 10: { diff --git a/teavm-core/src/main/java/org/teavm/dependency/DataFlowGraphBuilder.java b/teavm-core/src/main/java/org/teavm/dependency/DataFlowGraphBuilder.java index 064b300c5..43d421e48 100644 --- a/teavm-core/src/main/java/org/teavm/dependency/DataFlowGraphBuilder.java +++ b/teavm-core/src/main/java/org/teavm/dependency/DataFlowGraphBuilder.java @@ -62,8 +62,11 @@ public class DataFlowGraphBuilder implements InstructionReader { } IntegerArray startNodes = new IntegerArray(graph.size()); for (int i = paramCount; i < graph.size(); ++i) { - if (!importantNodes.contains(i) && graph.incomingEdgesCount(i) == 1) { - classes.union(graph.incomingEdges(i)[0], i); + if (importantNodes.contains(i)) { + continue; + } + for (int pred : graph.incomingEdges(i)) { + classes.union(pred, i); } if (graph.incomingEdgesCount(i) == 0) { startNodes.add(i); @@ -72,9 +75,12 @@ public class DataFlowGraphBuilder implements InstructionReader { int[][] sccs = GraphUtils.findStronglyConnectedComponents(graph, startNodes.getAll()); for (int[] scc : sccs) { - int first = scc[0]; - for (int i = 1; i < scc.length; ++i) { - classes.union(first, scc[i]); + int last = -1; + for (int node : scc) { + if (!importantNodes.contains(node)) { + continue; + } + last = last < 0 ? node : classes.union(node, last); } } return classes.pack(program.variableCount()); diff --git a/teavm-core/src/main/java/org/teavm/dependency/Linker.java b/teavm-core/src/main/java/org/teavm/dependency/Linker.java index ed653610b..b844f956f 100644 --- a/teavm-core/src/main/java/org/teavm/dependency/Linker.java +++ b/teavm-core/src/main/java/org/teavm/dependency/Linker.java @@ -53,7 +53,7 @@ public class Linker { for (Instruction insn : block.getInstructions()) { if (insn instanceof InvokeInstruction) { InvokeInstruction invoke = (InvokeInstruction)insn; - MethodDependencyInfo linkedMethod = dependency.getMethod(invoke.getMethod()); + MethodDependencyInfo linkedMethod = dependency.getMethodImplementation(invoke.getMethod()); if (linkedMethod != null) { invoke.setMethod(linkedMethod.getReference()); } diff --git a/teavm-core/src/main/resources/org/teavm/javascript/runtime.js b/teavm-core/src/main/resources/org/teavm/javascript/runtime.js index c0d860e59..d13941d6d 100644 --- a/teavm-core/src/main/resources/org/teavm/javascript/runtime.js +++ b/teavm-core/src/main/resources/org/teavm/javascript/runtime.js @@ -491,7 +491,7 @@ function $rt_s(index) { } var $rt_continueCounter = 0; function $rt_continue(f) { - if ($rt_continueCounter++ == 40) { + if ($rt_continueCounter++ == 5) { $rt_continueCounter = 0; return function() { var self = this;