RFR (M): Generate checks for vbox/vunbox; extend CI to include VCC-DVT mapping

Tobias Hartmann tobias.hartmann at oracle.com
Thu Mar 30 08:26:56 UTC 2017

Hi Zoltan,

On 28.03.2017 13:20, Zoltán Majó wrote:
> http://cr.openjdk.java.net/~zmajo/valhalla/03.vbox-vunbox-checks/webrev.00/
> The patch adds checks to vbox/vunbox that are missing in the current implementation. The patch enables C2 to generate code that includes null checks and type checks (where required). Other checks (e.g., checking if the source/target class of the bytecode instruction is loaded and if it is a value-capable-class/derived value type) are performed at compile-time. The patch also extends the CI to mirror the VCC-DVT mapping to the compiler.

Here are some comments/questions:
- I think it's sufficient to have the "// TODO: Check if updating flag works properly" in one place
- In graphKit.cpp, why do you set 'treat_throw_as_hot' to always true? Shouldn't the checks in line 549 be sufficient to set it (also for the vbox/vunbox bytecodes)?
- Since we don't support subtyping for value types, shouldn't we check for type equality instead of a subtype relation?
  - In vbox(), you can get the exact type of the ValueTypeNode via ValueTypeNode::value_klass() and you can check that for equality with the target_dvt_klass
  - In vunbox(), I would check for equality of the source_type and the target_vcc_klass


More information about the valhalla-dev mailing list