Please review JDK-8013914 - line number footprint
Marcus Lagergren
marcus.lagergren at oracle.com
Mon May 6 09:08:27 PDT 2013
I've introduced the Statement node, which proved to be a design advantage from other points of view as well - a Statement being the only kind of node that results in steppable code on the root level. Currently the Statement holds line number information and line number nodes are deprecated.
Line number nodes were brittle for several reasons 1) footprint 2) code moves around and they may not apply anymore, being loosely coupled instead of tightly coupled to code.
The next logical step is probably to move location information down into Statement, save memory for Node instances that don't need it. IdentNode needs it though, as we all know "x" in JavaScript may very well be a getter.
This fix saved quite a lot of IR footprint for large IRs.
(I also slightly tweaked the heuristic for snapshotting parsed IR, so we don't save all IR all the time in case of future recompilation).
All in all I got the IR footprint of Octane Mandrel down by almost 30% with this fix combined with JDK-8013913
http://cr.openjdk.java.net/~lagergren/8013914/
/M
More information about the nashorn-dev
mailing list