[lworld] RFR: 8244519: [lworld] C2 compilation fails with 'monitors must always exist for synchronized methods'

Tobias Hartmann thartmann at openjdk.java.net
Wed May 6 16:14:59 UTC 2020


C2 incorrectly assumes that the receiver of a synchronized method of an abstract class can be an inline type and
therefore adds a runtime check to the locking code (see 'can_be_value_type' check in
PhaseMacroExpand::expand_lock_node). While processing the JVMState of an uncommon trap emitted for that runtime check,
we assert because there is no monitor (yet) although the method is synchronized.

I've modified ciInstanceKlass::can_be_value_klass accordingly and added an to catch similar problems earlier. I've also
removed some dead code.

This fix includes the is_vanilla_constructor() fix from JDK-8243204.

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

Commit messages:
 - Including is_vanilla_constructor fix
 - 8244519: [lworld] C2 compilation fails with 'monitors must always exist for synchronized methods'

Changes: https://git.openjdk.java.net/valhalla/pull/36/files
 Webrev: https://webrevs.openjdk.java.net/valhalla/36/webrev.00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8244519
  Stats: 45 lines in 4 files changed: 32 ins; 11 del; 2 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/36.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/36/head:pull/36

PR: https://git.openjdk.java.net/valhalla/pull/36


More information about the valhalla-dev mailing list