--- old/src/share/vm/ci/ciField.cpp 2016-11-16 09:06:09.270498500 +0100 +++ new/src/share/vm/ci/ciField.cpp 2016-11-16 09:06:09.198498498 +0100 @@ -198,6 +198,26 @@ "bootstrap classes must not create & cache unshared fields"); } +// Special copy constructor used to flatten value type fields by +// copying the fields of the value type to a new holder klass. +ciField::ciField(ciField* field, ciInstanceKlass* holder, int offset, bool is_final) { + assert(field->holder()->is_valuetype(), "should only be used for value type field flattening"); + // Set the is_final flag + jint final = is_final ? JVM_ACC_FINAL : ~JVM_ACC_FINAL; + AccessFlags flags(field->flags().as_int() & final); + _flags = ciFlags(flags); + _holder = holder; + _offset = offset; + // Copy remaining fields + _name = field->_name; + _signature = field->_signature; + _type = field->_type; + _is_constant = field->_is_constant; + _known_to_link_with_put = field->_known_to_link_with_put; + _known_to_link_with_get = field->_known_to_link_with_get; + _constant_value = field->_constant_value; +} + static bool trust_final_non_static_fields(ciInstanceKlass* holder) { if (holder == NULL) return false;