RFR/RFC calling convention change for value types in compiled code

Roland Westrelin rwestrel at redhat.com
Tue Dec 13 08:44:49 UTC 2016

Hi Tobias,

> Zoltan recently pushed a change that removed the dependencies on the value factory method (which is not there for a DVT):
> http://hg.openjdk.java.net/valhalla/valhalla/hotspot/rev/4be6e6ebc443
> I think you need to rebase your changes accordingly.

Here it is rebased:


I also had to make the fix below to collect all value type fields at
a safepoint.


diff --git a/src/share/vm/opto/valuetypenode.cpp b/src/share/vm/opto/valuetypenode.cpp
--- a/src/share/vm/opto/valuetypenode.cpp
+++ b/src/share/vm/opto/valuetypenode.cpp
@@ -298,7 +298,7 @@
 void ValueTypeNode::make_scalar_in_safepoints(Compile* C) {
   const TypeValueTypePtr* res_type = TypeValueTypePtr::make(bottom_type()->isa_valuetype(), TypePtr::NotNull);
   ciValueKlass* vk = value_klass();
-  uint nfields = vk->field_count();
+  uint nfields = vk->flattened_field_count();
   for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {
     Node* u = fast_out(i);
     if (u->is_SafePoint() && (!u->is_Call() || u->as_Call()->has_debug_use(this))) {

More information about the valhalla-dev mailing list