1 /*
  2  * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "cds/archiveUtils.hpp"
 26 #include "cds/cdsConfig.hpp"
 27 #include "classfile/vmSymbols.hpp"
 28 #include "code/codeCache.hpp"
 29 #include "gc/shared/barrierSet.hpp"
 30 #include "gc/shared/collectedHeap.inline.hpp"
 31 #include "gc/shared/gcLocker.inline.hpp"
 32 #include "interpreter/interpreter.hpp"
 33 #include "logging/log.hpp"
 34 #include "memory/metadataFactory.hpp"
 35 #include "memory/metaspaceClosure.hpp"
 36 #include "oops/access.hpp"
 37 #include "oops/arrayKlass.hpp"
 38 #include "oops/compressedOops.inline.hpp"
 39 #include "oops/fieldStreams.inline.hpp"
 40 #include "oops/flatArrayKlass.hpp"
 41 #include "oops/inlineKlass.inline.hpp"
 42 #include "oops/instanceKlass.inline.hpp"
 43 #include "oops/layoutKind.hpp"
 44 #include "oops/method.hpp"
 45 #include "oops/objArrayKlass.hpp"
 46 #include "oops/oop.inline.hpp"
 47 #include "oops/oopsHierarchy.hpp"
 48 #include "oops/refArrayKlass.hpp"
 49 #include "runtime/fieldDescriptor.inline.hpp"
 50 #include "runtime/handles.inline.hpp"
 51 #include "runtime/interfaceSupport.inline.hpp"
 52 #include "runtime/registerMap.hpp"
 53 #include "runtime/safepointVerifiers.hpp"
 54 #include "runtime/sharedRuntime.hpp"
 55 #include "runtime/signature.hpp"
 56 #include "runtime/thread.inline.hpp"
 57 #include "utilities/copy.hpp"
 58 #include "utilities/stringUtils.hpp"
 59 
 60 InlineKlass::Members::Members()
 61   : _extended_sig(nullptr),
 62     _return_regs(nullptr),
 63     _pack_handler(nullptr),
 64     _pack_handler_jobject(nullptr),
 65     _unpack_handler(nullptr),
 66     _null_reset_value_offset(0),
 67     _payload_offset(-1),
 68     _payload_size_in_bytes(-1),
 69     _payload_alignment(-1),
 70     _null_free_non_atomic_size_in_bytes(-1),
 71     _null_free_non_atomic_alignment(-1),
 72     _null_free_atomic_size_in_bytes(-1),
 73     _nullable_atomic_size_in_bytes(-1),
 74     _nullable_non_atomic_size_in_bytes(-1),
 75     _null_marker_offset(-1),
 76     _fast_acmp_offset(-1),
 77     _fast_acmp_mask(0) {
 78 }
 79 
 80 InlineKlass::InlineKlass() {
 81   assert(CDSConfig::is_dumping_archive() || UseSharedSpaces, "only for CDS");
 82 }
 83 
 84 // Constructor
 85 InlineKlass::InlineKlass(const ClassFileParser& parser)
 86     : InstanceKlass(parser, InlineKlass::Kind, markWord::inline_type_prototype()) {
 87   assert(is_inline_klass(), "sanity");
 88   assert(prototype_header().is_inline_type(), "sanity");
 89 
 90   // Set up the offset to the members of this klass
 91   _adr_inline_klass_members = calculate_members_address();
 92 
 93   // Placement install the members
 94   new (_adr_inline_klass_members) Members();
 95 
 96   // Sanity check construction of the members
 97   assert(pack_handler() == nullptr, "pack handler not null");
 98 }
 99 
100 address InlineKlass::calculate_members_address() const {
101   // The members are placed after all other contents inherited from the InstanceKlass
102   return end_of_instance_klass();
103 }
104 
105 oop InlineKlass::null_reset_value() const {
106   assert(is_initialized() || is_being_initialized() || is_in_error_state(), "null reset value is set at the beginning of initialization");
107   oop val = java_mirror()->obj_field_acquire(null_reset_value_offset());
108   assert(val != nullptr, "Sanity check");
109   return val;
110 }
111 
112 void InlineKlass::set_null_reset_value(oop val) {
113   assert(val != nullptr, "Sanity check");
114   assert(oopDesc::is_oop(val), "Sanity check");
115   assert(val->is_inline_type(), "Sanity check");
116   assert(val->klass() == this, "sanity check");
117   java_mirror()->obj_field_put(null_reset_value_offset(), val);
118 }
119 
120 inlineOop InlineKlass::allocate_instance(TRAPS) {
121   inlineOop oop = (inlineOop)InstanceKlass::allocate_instance(CHECK_NULL);
122   assert(oop->mark().is_inline_type(), "Expected inline type");
123   return oop;
124 }
125 
126 int InlineKlass::nonstatic_oop_count() {
127   int oops = 0;
128   int map_count = nonstatic_oop_map_count();
129   OopMapBlock* block = start_of_nonstatic_oop_maps();
130   OopMapBlock* end = block + map_count;
131   while (block != end) {
132     oops += block->count();
133     block++;
134   }
135   return oops;
136 }
137 
138 // Arrays of...
139 
140 bool InlineKlass::maybe_flat_in_array() {
141   if (!UseArrayFlattening) {
142     return false;
143   }
144   // Too many embedded oops
145   if ((FlatArrayElementMaxOops >= 0) && (nonstatic_oop_count() > FlatArrayElementMaxOops)) {
146     return false;
147   }
148   // No flat layout?
149   if (!has_nullable_atomic_layout() && !has_null_free_atomic_layout() && !has_null_free_non_atomic_layout()) {
150     return false;
151   }
152   return true;
153 }
154 
155 // Inline type arguments are not passed by reference, instead each
156 // field of the inline type is passed as an argument. This helper
157 // function collects the flat field (recursively)
158 // in a list. Included with the field's type is
159 // the offset of each field in the inline type: i2c and c2i adapters
160 // need that to load or store fields. Finally, the list of fields is
161 // sorted in order of increasing offsets: the adapters and the
162 // compiled code need to agree upon the order of fields.
163 //
164 // The list of basic types that is returned starts with a T_METADATA
165 // and ends with an extra T_VOID. T_METADATA/T_VOID pairs are used as
166 // delimiters. Every entry between the two is a field of the inline
167 // type. If there's an embedded inline type in the list, it also starts
168 // with a T_METADATA and ends with a T_VOID. This is so we can
169 // generate a unique fingerprint for the method's adapters and we can
170 // generate the list of basic types from the interpreter point of view
171 // (inline types passed as reference: iterate on the list until a
172 // T_METADATA, drop everything until and including the closing
173 // T_VOID) or the compiler point of view (each field of the inline
174 // types is an argument: drop all T_METADATA/T_VOID from the list).
175 //
176 // Value classes could also have fields in abstract super value classes.
177 // Use a HierarchicalFieldStream to get them as well.
178 int InlineKlass::collect_fields(GrowableArray<SigEntry>* sig, int base_off, int null_marker_offset) {
179   int count = 0;
180   SigEntry::add_entry(sig, T_METADATA, name(), base_off);
181   for (TopDownHierarchicalNonStaticFieldStreamBase fs(this); !fs.done(); fs.next()) {
182     assert(!fs.access_flags().is_static(), "TopDownHierarchicalNonStaticFieldStreamBase should not let static fields pass.");
183     int offset = base_off + fs.offset() - (base_off > 0 ? payload_offset() : 0);
184     InstanceKlass* field_holder = fs.field_descriptor().field_holder();
185     if (fs.is_flat()) {
186       // Resolve klass of flat field and recursively collect fields
187       int field_null_marker_offset = -1;
188       if (!fs.is_null_free_inline_type()) {
189         field_null_marker_offset = base_off + fs.null_marker_offset() - (base_off > 0 ? payload_offset() : 0);
190       }
191       Klass* vk = field_holder->get_inline_type_field_klass(fs.index());
192       count += InlineKlass::cast(vk)->collect_fields(sig, offset, field_null_marker_offset);
193     } else {
194       BasicType bt = Signature::basic_type(fs.signature());
195       SigEntry::add_entry(sig, bt,  fs.name(), offset);
196       count += type2size[bt];
197     }
198   }
199   int offset = base_off + size_helper()*HeapWordSize - (base_off > 0 ? payload_offset() : 0);
200   // Null markers are no real fields, add them manually at the end (C2 relies on this) of the flat fields
201   if (null_marker_offset != -1) {
202     SigEntry::add_null_marker(sig, name(), null_marker_offset);
203     count++;
204   }
205   SigEntry::add_entry(sig, T_VOID, name(), offset);
206   assert(sig->at(0)._bt == T_METADATA && sig->at(sig->length()-1)._bt == T_VOID, "broken structure");
207   return count;
208 }
209 
210 // Support for the scalarized calling convention.
211 //
212 // For arguments, an inline type can be passed in scalarized form instead of as a single
213 // oop: the calling convention uses an optional buffer oop together with a null marker,
214 // followed by the field values, assigned to the normal argument registers and stack slots.
215 // See CompiledEntrySignature::compute_calling_conventions.
216 //
217 // For returns, an inline type is returned in scalarized form via multiple return registers:
218 // the first word is a tri-state value (null, tagged InlineKlass*, or oop) and the remaining
219 // registers carry the field values.
220 void InlineKlass::initialize_calling_convention(TRAPS) {
221   // Because the pack and unpack handler addresses need to be loadable from generated code,
222   // they are stored at a fixed offset in the klass metadata. Since inline type klasses do
223   // not have a vtable, the vtable offset is used to store these addresses.
224   if (InlineTypeReturnedAsFields || InlineTypePassFieldsAsArgs) {
225     ResourceMark rm;
226     GrowableArray<SigEntry> sig_vk;
227     int nb_fields = collect_fields(&sig_vk);
228     if (*PrintInlineKlassFields != '\0') {
229       const char* class_name_str = _name->as_C_string();
230       if (StringUtils::class_list_match(PrintInlineKlassFields, class_name_str)) {
231         ttyLocker ttyl;
232         tty->print_cr("Fields of InlineKlass: %s", class_name_str);
233         for (const SigEntry& entry : sig_vk) {
234           tty->print("  %s: %s+%d", entry._name->as_C_string(), type2name(entry._bt), entry._offset);
235           if (entry._null_marker) {
236             tty->print(" (null marker)");
237           }
238           if (entry._vt_oop) {
239             tty->print(" (VT OOP)");
240           }
241           tty->print_cr("");
242         }
243       }
244     }
245     Array<SigEntry>* extended_sig = MetadataFactory::new_array<SigEntry>(class_loader_data(), sig_vk.length(), CHECK);
246     set_extended_sig(extended_sig);
247     for (int i = 0; i < sig_vk.length(); i++) {
248       extended_sig->at_put(i, sig_vk.at(i));
249     }
250     if (can_be_returned_as_fields(/* init= */ true)) {
251       nb_fields++;
252       BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, nb_fields);
253       sig_bt[0] = T_METADATA;
254       SigEntry::fill_sig_bt(&sig_vk, sig_bt+1);
255       VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair, nb_fields);
256       int total = SharedRuntime::java_return_convention(sig_bt, regs, nb_fields);
257 
258       if (total > 0) {
259         Array<VMRegPair>* return_regs = MetadataFactory::new_array<VMRegPair>(class_loader_data(), nb_fields, CHECK);
260         set_return_regs(return_regs);
261         for (int i = 0; i < nb_fields; i++) {
262           return_regs->at_put(i, regs[i]);
263         }
264 
265         BufferedInlineTypeBlob* buffered_blob = SharedRuntime::generate_buffered_inline_type_adapter(this);
266         if (buffered_blob == nullptr) {
267           THROW_MSG(vmSymbols::java_lang_OutOfMemoryError(), "Out of space in CodeCache for adapters");
268         }
269         set_pack_handler(buffered_blob->pack_fields());
270         set_pack_handler_jobject(buffered_blob->pack_fields_jobject());
271         set_unpack_handler(buffered_blob->unpack_fields());
272         assert(CodeCache::find_blob(pack_handler()) == buffered_blob, "lost track of blob");
273         assert(can_be_returned_as_fields(), "sanity");
274       }
275     }
276     if (!can_be_returned_as_fields() && !can_be_passed_as_fields()) {
277       MetadataFactory::free_array<SigEntry>(class_loader_data(), extended_sig);
278       set_extended_sig(nullptr);
279       assert(return_regs() == nullptr, "sanity");
280     }
281   }
282 }
283 
284 void InlineKlass::deallocate_contents(ClassLoaderData* loader_data) {
285   if (extended_sig() != nullptr) {
286     MetadataFactory::free_array<SigEntry>(loader_data, members()._extended_sig);
287     set_extended_sig(nullptr);
288   }
289   if (return_regs() != nullptr) {
290     MetadataFactory::free_array<VMRegPair>(loader_data, members()._return_regs);
291     set_return_regs(nullptr);
292   }
293   cleanup_blobs();
294   InstanceKlass::deallocate_contents(loader_data);
295 }
296 
297 void InlineKlass::cleanup(InlineKlass* ik) {
298   ik->cleanup_blobs();
299 }
300 
301 void InlineKlass::cleanup_blobs() {
302   if (pack_handler() != nullptr) {
303     CodeBlob* buffered_blob = CodeCache::find_blob(pack_handler());
304     assert(buffered_blob->is_buffered_inline_type_blob(), "bad blob type");
305     BufferBlob::free((BufferBlob*)buffered_blob);
306     set_pack_handler(nullptr);
307     set_pack_handler_jobject(nullptr);
308     set_unpack_handler(nullptr);
309   }
310 }
311 
312 // Can this inline type be passed as multiple values?
313 bool InlineKlass::can_be_passed_as_fields() const {
314   return InlineTypePassFieldsAsArgs;
315 }
316 
317 // Can this inline type be returned as multiple values?
318 bool InlineKlass::can_be_returned_as_fields(bool init) const {
319   return InlineTypeReturnedAsFields && (init || return_regs() != nullptr);
320 }
321 
322 // Create handles for all oop fields returned in registers that are going to be live across a safepoint
323 void InlineKlass::save_oop_fields(const RegisterMap& reg_map, GrowableArray<Handle>& handles) const {
324   Thread* thread = Thread::current();
325   const Array<SigEntry>* sig_vk = extended_sig();
326   const Array<VMRegPair>* regs = return_regs();
327   int j = 1;
328 
329   for (int i = 0; i < sig_vk->length(); i++) {
330     BasicType bt = sig_vk->at(i)._bt;
331     if (bt == T_OBJECT || bt == T_ARRAY) {
332       VMRegPair pair = regs->at(j);
333       oop* loc = (oop*)reg_map.location(pair.first(), nullptr);
334       guarantee(loc != nullptr, "bad register save location");
335       oop o = *loc;
336       assert(oopDesc::is_oop_or_null(o), "Bad oop value: " PTR_FORMAT, p2i(o));
337       handles.push(Handle(thread, o));
338     }
339     if (bt == T_METADATA) {
340       continue;
341     }
342     if (bt == T_VOID &&
343         sig_vk->at(i-1)._bt != T_LONG &&
344         sig_vk->at(i-1)._bt != T_DOUBLE) {
345       continue;
346     }
347     j++;
348   }
349   assert(j == regs->length(), "missed a field?");
350 }
351 
352 // Update oop fields in registers from handles after a safepoint
353 void InlineKlass::restore_oop_results(RegisterMap& reg_map, GrowableArray<Handle>& handles) const {
354   assert(InlineTypeReturnedAsFields, "Inline types should never be returned as fields");
355   const Array<SigEntry>* sig_vk = extended_sig();
356   const Array<VMRegPair>* regs = return_regs();
357   assert(regs != nullptr, "inconsistent");
358 
359   int j = 1;
360   int k = 0;
361   for (int i = 0; i < sig_vk->length(); i++) {
362     BasicType bt = sig_vk->at(i)._bt;
363     if (bt == T_OBJECT || bt == T_ARRAY) {
364       VMRegPair pair = regs->at(j);
365       oop* loc = (oop*)reg_map.location(pair.first(), nullptr);
366       guarantee(loc != nullptr, "bad register save location");
367       *loc = handles.at(k++)();
368     }
369     if (bt == T_METADATA) {
370       continue;
371     }
372     if (bt == T_VOID &&
373         sig_vk->at(i-1)._bt != T_LONG &&
374         sig_vk->at(i-1)._bt != T_DOUBLE) {
375       continue;
376     }
377     j++;
378   }
379   assert(k == handles.length(), "missed a handle?");
380   assert(j == regs->length(), "missed a field?");
381 }
382 
383 // Fields are in registers. Create an instance of the inline type and
384 // initialize it with the values of the fields.
385 oop InlineKlass::realloc_result(const RegisterMap& reg_map, const GrowableArray<Handle>& handles, TRAPS) {
386   oop new_vt = allocate_instance(CHECK_NULL);
387   const Array<SigEntry>* sig_vk = extended_sig();
388   const Array<VMRegPair>* regs = return_regs();
389 
390   int j = 1;
391   int k = 0;
392   for (int i = 0; i < sig_vk->length(); i++) {
393     BasicType bt = sig_vk->at(i)._bt;
394     if (bt == T_METADATA) {
395       continue;
396     }
397     if (bt == T_VOID) {
398       if (sig_vk->at(i-1)._bt == T_LONG ||
399           sig_vk->at(i-1)._bt == T_DOUBLE) {
400         j++;
401       }
402       continue;
403     }
404     int off = sig_vk->at(i)._offset;
405     assert(off > 0, "offset in object should be positive");
406     VMRegPair pair = regs->at(j);
407     address loc = reg_map.location(pair.first(), nullptr);
408     guarantee(loc != nullptr, "bad register save location");
409     switch(bt) {
410     case T_BOOLEAN: {
411       new_vt->bool_field_put(off, *(jboolean*)loc);
412       break;
413     }
414     case T_CHAR: {
415       new_vt->char_field_put(off, *(jchar*)loc);
416       break;
417     }
418     case T_BYTE: {
419       new_vt->byte_field_put(off, *(jbyte*)loc);
420       break;
421     }
422     case T_SHORT: {
423       new_vt->short_field_put(off, *(jshort*)loc);
424       break;
425     }
426     case T_INT: {
427       new_vt->int_field_put(off, *(jint*)loc);
428       break;
429     }
430     case T_LONG: {
431       new_vt->long_field_put(off, *(jlong*)loc);
432       break;
433     }
434     case T_OBJECT:
435     case T_ARRAY: {
436       Handle handle = handles.at(k++);
437       new_vt->obj_field_put(off, handle());
438       break;
439     }
440     case T_FLOAT: {
441       new_vt->float_field_put(off, *(jfloat*)loc);
442       break;
443     }
444     case T_DOUBLE: {
445       new_vt->double_field_put(off, *(jdouble*)loc);
446       break;
447     }
448     default:
449       ShouldNotReachHere();
450     }
451     *(intptr_t*)loc = 0xDEAD;
452     j++;
453   }
454   assert(j == regs->length(), "missed a field?");
455   assert(k == handles.length(), "missed an oop?");
456   return new_vt;
457 }
458 
459 // Check if we return an inline type in scalarized form, i.e. check if either
460 // - The return value is a tagged InlineKlass pointer, or
461 // - The return value is an inline type oop that is also returned in scalarized form
462 InlineKlass* InlineKlass::returned_inline_klass(const RegisterMap& map, bool* return_oop, Method* method) {
463   BasicType bt = T_METADATA;
464   VMRegPair pair;
465   int nb = SharedRuntime::java_return_convention(&bt, &pair, 1);
466   assert(nb == 1, "broken");
467 
468   intptr_t* loc = (intptr_t*)map.location(pair.first(), nullptr);
469   guarantee(loc != nullptr, "bad register save location");
470   intptr_t ptr = *loc;
471   if (is_set_nth_bit(ptr, 0)) {
472     // Return value is tagged, must be an InlineKlass pointer
473     clear_nth_bit(ptr, 0);
474     assert(Metaspace::contains((void*)ptr), "should be klass");
475     InlineKlass* vk = (InlineKlass*)ptr;
476     assert(vk->can_be_returned_as_fields(), "must be able to return as fields");
477     if (return_oop != nullptr) {
478       // Not returning an oop
479       *return_oop = false;
480     }
481     return vk;
482   }
483   // Return value is not tagged, must be a valid oop
484   oop o = cast_to_oop(ptr);
485   assert(oopDesc::is_oop_or_null(o), "Bad oop return: " PTR_FORMAT, ptr);
486   if (return_oop != nullptr && o != nullptr && o->is_inline_type()) {
487     // Check if inline type is also returned in scalarized form
488     InlineKlass* vk_val = InlineKlass::cast(o->klass());
489     InlineKlass* vk_sig = method->returns_inline_type();
490     if (vk_val->can_be_returned_as_fields() && vk_sig != nullptr) {
491       assert(vk_val == vk_sig, "Unexpected return value");
492       return vk_val;
493     }
494   }
495   return nullptr;
496 }
497 
498 // CDS support
499 #if INCLUDE_CDS
500 
501 void InlineKlass::remove_unshareable_info() {
502   InstanceKlass::remove_unshareable_info();
503 
504   // update it to point to the "buffered" copy of this class.
505   _adr_inline_klass_members = calculate_members_address();
506   ArchivePtrMarker::mark_pointer(&_adr_inline_klass_members);
507 
508   set_extended_sig(nullptr);
509   set_return_regs(nullptr);
510   set_pack_handler(nullptr);
511   set_pack_handler_jobject(nullptr);
512   set_unpack_handler(nullptr);
513 
514   assert(pack_handler() == nullptr, "pack handler not null");
515 }
516 
517 #endif // CDS
518 
519 #define BULLET  " - "
520 
521 void InlineKlass::print_on(outputStream* st) const {
522   InstanceKlass::print_on(st);
523   members().print_on(st);
524   st->print_cr(BULLET"---- LayoutKinds:");
525   auto print_layout_kind = [&](LayoutKind lk) {
526     if (is_layout_supported(lk)) {
527       st->print_cr(BULLET"%s layout: %d/%d",
528                    LayoutKindHelper::layout_kind_as_string(lk),
529                    layout_size_in_bytes(lk), layout_alignment(lk));
530     } else {
531       st->print_cr(BULLET"%s layout: -/-",
532                    LayoutKindHelper::layout_kind_as_string(lk));
533     }
534   };
535   print_layout_kind(LayoutKind::BUFFERED);
536   print_layout_kind(LayoutKind::NULL_FREE_NON_ATOMIC_FLAT);
537   print_layout_kind(LayoutKind::NULL_FREE_ATOMIC_FLAT);
538   print_layout_kind(LayoutKind::NULLABLE_ATOMIC_FLAT);
539   print_layout_kind(LayoutKind::NULLABLE_NON_ATOMIC_FLAT);
540 }
541 
542 // Verification
543 
544 void InlineKlass::verify_on(outputStream* st) {
545   InstanceKlass::verify_on(st);
546   guarantee(prototype_header().is_inline_type(), "Prototype header is not inline type");
547 }
548 
549 void InlineKlass::oop_verify_on(oop obj, outputStream* st) {
550   InstanceKlass::oop_verify_on(obj, st);
551   guarantee(obj->mark().is_inline_type(), "Header is not inline type");
552 }
553 
554 void InlineKlass::Members::print_on(outputStream* st) const {
555   st->print_cr(BULLET"---- inline type members:");
556   st->print(BULLET"extended signature registers:      ");
557   InstanceKlass::print_array_on(st, _extended_sig, [](outputStream* ost, SigEntry pair){
558     pair.print_on(ost);
559   });
560   st->print(BULLET"return registers:                  ");
561   InstanceKlass::print_array_on(st, _return_regs, [](outputStream* ost, VMRegPair pair) {
562     pair.print_on(ost);
563   });
564   st->print_cr(BULLET"pack handler:                      " PTR_FORMAT, p2i(_pack_handler));
565   st->print_cr(BULLET"pack handler (jobject):            " PTR_FORMAT, p2i(_pack_handler_jobject));
566   st->print_cr(BULLET"unpack handler:                    " PTR_FORMAT, p2i(_unpack_handler));
567   st->print_cr(BULLET"null reset offset:                 %d", _null_reset_value_offset);
568   st->print_cr(BULLET"payload offset:                    %d", _payload_offset);
569   st->print_cr(BULLET"payload size (bytes):              %d", _payload_size_in_bytes);
570   st->print_cr(BULLET"payload alignment:                 %d", _payload_alignment);
571   st->print_cr(BULLET"null-free non-atomic size (bytes): %d", _null_free_non_atomic_size_in_bytes);
572   st->print_cr(BULLET"null-free non-atomic alignment:    %d", _null_free_non_atomic_alignment);
573   st->print_cr(BULLET"null-free atomic size (bytes):     %d", _null_free_atomic_size_in_bytes);
574   st->print_cr(BULLET"nullable atomic size (bytes):      %d", _nullable_atomic_size_in_bytes);
575   st->print_cr(BULLET"nullable non-atomic size (bytes):  %d", _nullable_non_atomic_size_in_bytes);
576   st->print_cr(BULLET"null marker offset:                %d", _null_marker_offset);
577   st->print_cr(BULLET"fast acmp offset:                  %d", _fast_acmp_offset);
578   st->print_cr(BULLET"fast acmp mask:                    " INT64_FORMAT_X_0, _fast_acmp_mask);
579 }
580 
581 #undef BULLET