Closed hrj closed 8 years ago
:clap: Awesome! The code looks great, too.
You can actually figure out how much stack space Java methods require. The Code
attribute has the properties maxStack
and maxLocals
that indicate the needed stack/locals size.
Would you be willing to hook up maxStack
and repeat your experiments?
If not, I can merge this as-is.
Thanks! I have used maxStack
and pushed the commit. I don't see any noticeable difference in benchmarks though.
Why did you mention maxLocals
? I am not very familiar with this stuff hence not sure if I can use it in this PR.
Typical jvilk over-explaining. My brain is a bit fried from writing up student assignments. It's not relevant.
It's likely that the maxStack
change only changes memory consumption a bit, since most JVM methods have a very short operand stack.
Thanks again for this! I'll merge it in.
dup*
opcodes to avoid frequent pops and pushesBenchmark results
I tested with two benchmarks.
Compute
just computes some fibonacci numbers over and over, and the second one compiles a.java
file usingjavax.tools
Compute
Compile