RFR: 8293976: Use unsigned integers in Assembler/CodeBuffer::emit_int*
Quan Anh Mai
duke at openjdk.org
Sun Sep 18 20:06:22 UTC 2022
Assembler/CodeBuffer::emit_int* accept signed int arguments.
- Since we are trying to emit some bit patterns into the code buffer instead of doing integer arithmetics, it makes more sense to use unsigned parameters.
- It makes usage with constants become inconvenient, as an integer literal is positive, a 0xC0 does not fit into an int8_t, resulting in the compiler complaining about lossy implicit conversions, the current solution is manual casting of the constants to unsigned char, which can be converted to int8_t without complaints.
Please have a look and leave some reviews. Thanks very much.
-------------
Commit messages:
- change signature
Changes: https://git.openjdk.org/jdk/pull/10325/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10325&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8293976
Stats: 29 lines in 2 files changed: 0 ins; 0 del; 29 mod
Patch: https://git.openjdk.org/jdk/pull/10325.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/10325/head:pull/10325
PR: https://git.openjdk.org/jdk/pull/10325
More information about the hotspot-compiler-dev
mailing list