> Hi, > > Reflective construction of value object triggers assert in C2 because it does > not follow the normal object construction pattern and is technically UB > because we try to return a larval object from a method. I was told that this > is required for the construction of hidden classes, but to me it seems like > we put those restrictions on ourselves and shoot ourselves in the foot by > using these `Unsafe` hacks. > > This PR tries to fix this issue by letting the compiler know of these methods > which can return or accept larval objects. Note that this is pretty fragile, > and seemingly harmless changes to the code shape generated by the > `MethodHandle` mechanism can break it, which is a usual symptom of undefined > behaviour. > > Please take a look and leave your review, thanks a lot.
Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: rename ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/2204/files - new: https://git.openjdk.org/valhalla/pull/2204/files/f9de2810..7659cd27 Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=2204&range=01 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=2204&range=00-01 Stats: 4 lines in 4 files changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/valhalla/pull/2204.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2204/head:pull/2204 PR: https://git.openjdk.org/valhalla/pull/2204
