RFR: 8260053: Optimize Tokens' use of Names

Guoxiong Li github.com+13688759+lgxbslgx at openjdk.java.net
Wed Jan 20 17:13:02 UTC 2021

Hi all,

This patch initializes the names about `TokenKind` at the beginning of the constructor of the class `Names`. As a result, the `Tokens.maxKey` and the length of the array `Tokens.key` become small. By using this patch, the length of the array `Tokens.key` is changed from 4280 to 383.

The original discussion is at [compiler-dev](https://mail.openjdk.java.net/pipermail/compiler-dev/2021-January/016126.html).

Thank you for taking the time to review.

Best Regards.


Commit messages:
 - 8260053: Optimize Tokens' use of Names

Changes: https://git.openjdk.java.net/jdk/pull/2169/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2169&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8260053
  Stats: 27 lines in 2 files changed: 14 ins; 7 del; 6 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2169.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2169/head:pull/2169

PR: https://git.openjdk.java.net/jdk/pull/2169

More information about the compiler-dev mailing list