--- old/src/share/vm/ci/ciValueKlass.cpp 2016-12-08 10:58:26.378538935 +0100 +++ new/src/share/vm/ci/ciValueKlass.cpp 2016-12-08 10:58:26.318539051 +0100 @@ -92,3 +92,19 @@ valueKlassHandle vklass_h(ValueKlass::cast(get_Klass())); return vklass_h()->first_field_offset(); } + +// When passing field's fields as arguments, count the number of extra +// argument slots that are needed +int ciValueKlass::extra_value_args() { + // -1 because we count the number of extra args + int vt_extra = nof_nonstatic_fields() - 1; + for (int j = 0; j < nof_nonstatic_fields(); j++) { + ciField* f = nonstatic_field_at(j); + BasicType bt = f->type()->basic_type(); + assert(bt != T_VALUETYPE, "embedded"); + if (bt == T_LONG || bt == T_DOUBLE) { + vt_extra++; + } + } + return vt_extra; +}