RFR: 8267612: Declare package-private VarHandle.AccessMode/-Type counts
Slightly reduce VarHandle startup overhead by introducing package-private COUNT constants for two enums ------------- Commit messages: - Declare package-private VarHandle.AccessMode/-Type counts Changes: https://git.openjdk.java.net/jdk/pull/4164/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4164&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8267612 Stats: 18 lines in 4 files changed: 8 ins; 2 del; 8 mod Patch: https://git.openjdk.java.net/jdk/pull/4164.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4164/head:pull/4164 PR: https://git.openjdk.java.net/jdk/pull/4164
On Mon, 24 May 2021 11:26:51 GMT, Claes Redestad <redestad@openjdk.org> wrote:
Slightly reduce VarHandle startup overhead by introducing package-private COUNT constants for two enums
src/java.base/share/classes/java/lang/invoke/VarHandle.java line 1639:
1637: GET_AND_UPDATE(Object.class); 1638: 1639: static final int COUNT = 5;
Suggestion: static final int COUNT = GET_AND_UPDATE.ordinal() + 1; This would avoid the hardcoded count which is a bit fragile. src/java.base/share/classes/java/lang/invoke/VarHandle.java line 1897:
1895: ; 1896: 1897: static final int COUNT = 31;
Suggestion: static final int COUNT = GET_AND_BITWISE_XOR_ACQUIRE.ordinal() + 1; ------------- PR: https://git.openjdk.java.net/jdk/pull/4164
Slightly reduce VarHandle startup overhead by introducing package-private COUNT constants for two enums
Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Mandy review ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4164/files - new: https://git.openjdk.java.net/jdk/pull/4164/files/89f7c64d..5b5e719f Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4164&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4164&range=00-01 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/4164.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4164/head:pull/4164 PR: https://git.openjdk.java.net/jdk/pull/4164
On Mon, 24 May 2021 22:49:05 GMT, Claes Redestad <redestad@openjdk.org> wrote:
Slightly reduce VarHandle startup overhead by introducing package-private COUNT constants for two enums
Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:
Mandy review
Looks good. ------------- Marked as reviewed by mchung (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/4164
On Mon, 24 May 2021 22:49:05 GMT, Claes Redestad <redestad@openjdk.org> wrote:
Slightly reduce VarHandle startup overhead by introducing package-private COUNT constants for two enums
Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:
Mandy review
Thanks Mandy! ------------- PR: https://git.openjdk.java.net/jdk/pull/4164
On Mon, 24 May 2021 11:26:51 GMT, Claes Redestad <redestad@openjdk.org> wrote:
Slightly reduce VarHandle startup overhead by introducing package-private COUNT constants for two enums
This pull request has now been integrated. Changeset: 66b190e1 Author: Claes Redestad <redestad@openjdk.org> URL: https://git.openjdk.java.net/jdk/commit/66b190e1e7d06f3fc59917b5346e94a128e9... Stats: 18 lines in 4 files changed: 8 ins; 2 del; 8 mod 8267612: Declare package-private VarHandle.AccessMode/AccessType counts Reviewed-by: mchung ------------- PR: https://git.openjdk.java.net/jdk/pull/4164
participants (2)
-
Claes Redestad
-
Mandy Chung