Open
Description
Currently, TeaVM marks method as async when is has at least one MonitorEnter/MonitorExit instruction. A better approach exists: if there is no async code between these instructions, or between any MonitorEnter/MonitorExit pair on the same monitor, they can be ommited. This can reduce the number of methods transformed to async form and therefore reduce code size and increase performance. A cross-method alias analysis is required for this task. Dependency checker currently performs cross-method analysis. It could add some metainformation for further phases to simplify analysis there.