diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-10-22 18:32:19 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-10-27 10:40:52 +0100 |
commit | 3a9581d32f9d3adb1dcb0b9c4bfeb9c86f0addcf (patch) | |
tree | 0128d61ec925cf385df4358bfcecb7d74ae09fcd /docs/TODO | |
parent | 4321ea458ad1258f273ee22a4c6a7606ab054501 (diff) | |
download | scala-3a9581d32f9d3adb1dcb0b9c4bfeb9c86f0addcf.tar.gz scala-3a9581d32f9d3adb1dcb0b9c4bfeb9c86f0addcf.tar.bz2 scala-3a9581d32f9d3adb1dcb0b9c4bfeb9c86f0addcf.zip |
More efficient way to compute maxLocals / maxStack
In order to run an asm Analyzer, the maxLocals / maxStack values of
the method need to be computed. Asm doesn't provide an efficient
built-in for this purpose, but it computes these values while
serializing a class.
Previously, we used to serialize the method just to compute the max's,
which is inefficient. This commit implements a separate, efficient
traversal.
The computed values are also smaller, allowing to save space when
running an Analyzer: asm Analyzers only allocate a single stack slot
for long/double values, while the JVM allocates two. The maxStack
computed previously would always use two slots, which is not
necessary.
The new calculation was verified to be correct in the following way:
as a test, i left the old computation in place, ran the new one in
addition (in a special mode where the long/double values take two
slots) and asserted equality. Bootstrapping and test suite passed.
Diffstat (limited to 'docs/TODO')
0 files changed, 0 insertions, 0 deletions