Closed yegor256 closed 1 week ago
@yegor256 We don't save line numbers in XMIR
representation. We have it only in the listing
element (that exists only for informational purposes)
@volodya-lombrozo we convert LINENUMBER
opcodes to labels:
<o base="jeo.label"><!-- L610874314 -->
<o base="org.eolang.bytes" data="bytes">61 32 30 34 31 32 61 64 2D 38 32 39 65 2D 34 63 31 63 2D 62 64 66 62 2D 66 32 34 33 30 32 39 63 65 39 66 34</o>
</o>
Right?
@yegor256 Indeed. You are almost right. Actually, we have both of them: 1) line
numbers and 2) labels
. We don't convert line numbers to labels. We have both of them independently. Usually labels
serve as target points for other jump instructions, for example as for goto
in your example:
L2
...
GOTO L2
But sometimes, there are labels that are only targets for lines
:
L0
...
LINENUMBER 62 L0
We can try to remove these labels that are used only by line entries, and it will indeed reduce the size of xmir and might even speed up the entire pipeline a bit. However, I’m afraid that, in this case, we might need to perform an analysis that could negate the possible performance boost. At least I can try.
@volodya-lombrozo if GOTO
is the only opcode that uses labels, it seems, you can easily (and quickly) find unused labels
@yegor256 Labels might be used by try-catch
statements as well. The exception table is placed separately from the instructions set. This might complicate things a bit. Moreover, labels might serve some other purposes which we don't see for now. I will try to do to remove such labels. But, please, don't underestimate the problem:
you can easily (and quickly) find unused labels
We don't know yet.
@rultor release, tag is 0.6.20
, title is 0.6.20
@rultor release, tag is
0.6.20
, title is0.6.20
@volodya-lombrozo OK, I will release it now. Please check the progress here.
@rultor release, tag is
0.6.20
, title is0.6.20
@volodya-lombrozo Done! FYI, the full log is here (took me 17min).
@yegor256 Would you mind trying the new 0.6.20
version, please?
@yegor256 friendly reminder
@volodya-lombrozo it's much better now, thanks!
This is the bytecode for my Java method:
I see many
LINENUMBER
opcodes (actually, one per every Java line), which are not necessary and may easily be eliminated before translating this code to XMIR. This will simplify XMIR and increase its readability (and speed of processing).