--- old/src/share/vm/runtime/signature.hpp 2017-05-29 18:07:48.782020829 +0200 +++ new/src/share/vm/runtime/signature.hpp 2017-05-29 18:07:48.708020909 +0200 @@ -436,4 +436,47 @@ static bool invalid_name_char(char); }; +// Used for adapter generation. One SigEntry is used per element of +// the signature of the method. Value type arguments are treated +// specially. See comment for ValueKlass::collect_fields(). +class SigEntry VALUE_OBJ_CLASS_SPEC { + public: + BasicType _bt; + int _offset; + + SigEntry() + : _bt(T_ILLEGAL), _offset(-1) { + } + SigEntry(BasicType bt, int offset) + : _bt(bt), _offset(offset) {} + + SigEntry(BasicType bt) + : _bt(bt), _offset(-1) {} + + static int compare(SigEntry* e1, SigEntry* e2) { + if (e1->_offset != e2->_offset) { + return e1->_offset - e2->_offset; + } + assert((e1->_bt == T_LONG && (e2->_bt == T_LONG || e2->_bt == T_VOID)) || + (e1->_bt == T_DOUBLE && (e2->_bt == T_DOUBLE || e2->_bt == T_VOID)) || + e1->_bt == T_VALUETYPE || e2->_bt == T_VALUETYPE || e1->_bt == T_VOID || e2->_bt == T_VOID, "bad bt"); + if (e1->_bt == e2->_bt) { + assert(e1->_bt == T_VALUETYPE || e1->_bt == T_VOID, "only ones with duplicate offsets"); + return 0; + } + if (e1->_bt == T_VOID || + e2->_bt == T_VALUETYPE) { + return 1; + } + if (e1->_bt == T_VALUETYPE || + e2->_bt == T_VOID) { + return -1; + } + ShouldNotReachHere(); + return 0; + } + static int count_fields(const GrowableArray& sig_extended); + static void fill_sig_bt(const GrowableArray& sig_extended, BasicType* sig_bt_cc, int total_args_passed_cc, bool skip_vt); +}; + #endif // SHARE_VM_RUNTIME_SIGNATURE_HPP