mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
When transforming final JS method to static methods, map phis and
try-catches as well
This commit is contained in:
parent
bc0fc8e406
commit
e8803390d2
|
@ -92,6 +92,18 @@ class JavascriptNativeProcessor {
|
||||||
for (Instruction insn : block.getInstructions()) {
|
for (Instruction insn : block.getInstructions()) {
|
||||||
insn.acceptVisitor(variableMapper);
|
insn.acceptVisitor(variableMapper);
|
||||||
}
|
}
|
||||||
|
for (Phi phi : block.getPhis()) {
|
||||||
|
phi.setReceiver(program.variableAt(phi.getReceiver().getIndex() + 1));
|
||||||
|
for (Incoming incoming : phi.getIncomings()) {
|
||||||
|
incoming.setValue(program.variableAt(incoming.getValue().getIndex() + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (TryCatchBlock tryCatch : block.getTryCatchBlocks()) {
|
||||||
|
if (tryCatch.getExceptionVariable() != null) {
|
||||||
|
tryCatch.setExceptionVariable(program.variableAt(
|
||||||
|
tryCatch.getExceptionVariable().getIndex() + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
callerMethod.setProgram(program);
|
callerMethod.setProgram(program);
|
||||||
cls.addMethod(callerMethod);
|
cls.addMethod(callerMethod);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user