This commit is contained in:
konsoletyper 2015-03-09 22:10:26 +03:00
parent 824cc79901
commit 80814ef167
4 changed files with 14 additions and 8 deletions

View File

@ -752,7 +752,7 @@ public class AstIO {
} }
case 9: { case 9: {
ConstantExpr expr = new ConstantExpr(); ConstantExpr expr = new ConstantExpr();
expr.setValue(symbolTable.at(input.readInt())); expr.setValue(ValueType.parse(symbolTable.at(input.readInt())));
return expr; return expr;
} }
case 10: { case 10: {

View File

@ -62,8 +62,11 @@ public class DataFlowGraphBuilder implements InstructionReader {
} }
IntegerArray startNodes = new IntegerArray(graph.size()); IntegerArray startNodes = new IntegerArray(graph.size());
for (int i = paramCount; i < graph.size(); ++i) { for (int i = paramCount; i < graph.size(); ++i) {
if (!importantNodes.contains(i) && graph.incomingEdgesCount(i) == 1) { if (importantNodes.contains(i)) {
classes.union(graph.incomingEdges(i)[0], i); continue;
}
for (int pred : graph.incomingEdges(i)) {
classes.union(pred, i);
} }
if (graph.incomingEdgesCount(i) == 0) { if (graph.incomingEdgesCount(i) == 0) {
startNodes.add(i); startNodes.add(i);
@ -72,9 +75,12 @@ public class DataFlowGraphBuilder implements InstructionReader {
int[][] sccs = GraphUtils.findStronglyConnectedComponents(graph, startNodes.getAll()); int[][] sccs = GraphUtils.findStronglyConnectedComponents(graph, startNodes.getAll());
for (int[] scc : sccs) { for (int[] scc : sccs) {
int first = scc[0]; int last = -1;
for (int i = 1; i < scc.length; ++i) { for (int node : scc) {
classes.union(first, scc[i]); if (!importantNodes.contains(node)) {
continue;
}
last = last < 0 ? node : classes.union(node, last);
} }
} }
return classes.pack(program.variableCount()); return classes.pack(program.variableCount());

View File

@ -53,7 +53,7 @@ public class Linker {
for (Instruction insn : block.getInstructions()) { for (Instruction insn : block.getInstructions()) {
if (insn instanceof InvokeInstruction) { if (insn instanceof InvokeInstruction) {
InvokeInstruction invoke = (InvokeInstruction)insn; InvokeInstruction invoke = (InvokeInstruction)insn;
MethodDependencyInfo linkedMethod = dependency.getMethod(invoke.getMethod()); MethodDependencyInfo linkedMethod = dependency.getMethodImplementation(invoke.getMethod());
if (linkedMethod != null) { if (linkedMethod != null) {
invoke.setMethod(linkedMethod.getReference()); invoke.setMethod(linkedMethod.getReference());
} }

View File

@ -491,7 +491,7 @@ function $rt_s(index) {
} }
var $rt_continueCounter = 0; var $rt_continueCounter = 0;
function $rt_continue(f) { function $rt_continue(f) {
if ($rt_continueCounter++ == 40) { if ($rt_continueCounter++ == 5) {
$rt_continueCounter = 0; $rt_continueCounter = 0;
return function() { return function() {
var self = this; var self = this;