RFR: 8310297: assert(static_cast<T1>(result) == thing) with ctw

Coleen Phillimore coleenp at openjdk.org
Tue Jun 20 20:13:36 UTC 2023


checked_cast<> doesn't work with the initializers in classfiles because even though javac will complain like:

ByteFieldInitTest.java:32: error: incompatible types: possible lossy conversion from int to byte
    static byte b = 0x80;
                    ^
1 error

classfiles can have this value and we've always treated this as a negative signed value.  Removed the checked_cast for javaClasses static final initializers.

Tested with tier1 on all platforms and added a test.

-------------

Commit messages:
 - 8310297: assert(static_cast<T1>(result) == thing) with ctw

Changes: https://git.openjdk.org/jdk/pull/14571/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14571&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8310297
  Stats: 97 lines in 3 files changed: 93 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/14571.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14571/head:pull/14571

PR: https://git.openjdk.org/jdk/pull/14571


More information about the hotspot-runtime-dev mailing list