--- old/src/share/vm/runtime/sharedRuntime.hpp 2016-11-24 11:13:32.141552391 +0100 +++ new/src/share/vm/runtime/sharedRuntime.hpp 2016-11-24 11:13:32.076552765 +0100 @@ -38,6 +38,48 @@ class AdapterFingerPrint; class vframeStream; +// 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 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, ""); + 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; + } +}; + + // Runtime is the base class for various runtime interfaces // (InterpreterRuntime, CompilerRuntime, etc.). It provides // shared functionality such as exception forwarding (C++ to @@ -431,16 +473,15 @@ // handshaking path with compiled code to keep the stack walking correct. static AdapterHandlerEntry* generate_i2c2i_adapters(MacroAssembler *_masm, - int total_args_passed, - int max_arg, - const BasicType *sig_bt, + int comp_args_on_stack, + const GrowableArray& sig, const VMRegPair *regs, - AdapterFingerPrint* fingerprint); + AdapterFingerPrint* fingerprint, + AdapterBlob*& new_adapter); static void gen_i2c_adapter(MacroAssembler *_masm, - int total_args_passed, int comp_args_on_stack, - const BasicType *sig_bt, + const GrowableArray& sig, const VMRegPair *regs); // OSR support @@ -522,6 +563,7 @@ static address handle_wrong_method(JavaThread* thread); static address handle_wrong_method_abstract(JavaThread* thread); static address handle_wrong_method_ic_miss(JavaThread* thread); + static void allocate_value_types(JavaThread* thread); #ifndef PRODUCT