cushon / issues-import

0 stars 0 forks source link

Investigate turning on tree end positions by default #228

Open cushon opened 9 years ago

cushon commented 9 years ago

Original issue created by eaftan@google.com on 2014-01-29 at 10:26 PM


Currently javac only computes tree end positions if the -Xjcov option is passed at the command line, or a custom DiagnosticListener is provided. Turning on tree end positions incurs a ~50% memory penalty in javac.

We need tree end positions to construct suggested fixes, so currently we reparse the tree if we encounter any errors. However, some checks need to know the end position before we know if there are any errors (e.g., LongLiteralLowerCaseSuffix), and anyway we're not happy with our reparsing hack.

Investigate whether it is feasible to turn on -Xjcov by default. We can try building some larger open source projects with -Xjcov on and see if they pass.

Note that there has been a patch submitted to upstream javac to reduce memory usage (http://openjdk.5641.n7.nabble.com/javac-ending-positions-generation-and-DiagnosticListener-tt170348.html), but even if accepted it won't help our external users who are on older versions of javac.

cushon commented 9 years ago

Original comment posted by cushon@google.com on 2014-01-30 at 10:16 PM


Upstream bug: https://bugs.openjdk.java.net/browse/JDK-8033287

cushon commented 9 years ago

Original comment posted by eaftan@google.com on 2014-03-04 at 12:50 AM


(No comment entered for this change.)


Labels: Type-Enhancement, Priority-Medium

cushon commented 9 years ago

Original comment posted by cushon@google.com on 2014-03-20 at 08:22 PM


The new endpostable made it into javac9: http://hg.openjdk.java.net/jdk9/jdk9/langtools/rev/1514b395e8e1

cushon commented 9 years ago

Original comment posted by eaftan@google.com on 2014-04-07 at 10:43 PM


Liam has a proposal that he working on. It might make sense to turn this on by default even without the upstream change, since IntelliJ is apparently turning them on.