--- old/src/share/vm/opto/library_call.cpp 2017-02-22 15:14:59.077268000 +0100 +++ new/src/share/vm/opto/library_call.cpp 2017-02-22 15:14:58.935242000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -5831,9 +5831,19 @@ address stubAddr = StubRoutines::updateBytesCRC32C(); const char *stubName = "updateBytesCRC32C"; - Node* call = make_runtime_call(RC_LEAF, OptoRuntime::updateBytesCRC32C_Type(), - stubAddr, stubName, TypePtr::BOTTOM, - crc, src_start, length, table_start); + // OpenJDK 8175370: ABI adaptation. + Node* call = NULL; + if (CCallingConventionRequiresIntsAsLongs) { + Node* crc_I2L = ConvI2L(crc); + Node* length_I2L = ConvI2L(length); + call = make_runtime_call(RC_LEAF, OptoRuntime::updateBytesCRC32C_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + crc_I2L XTOP, src_start, length_I2L XTOP, table_start); + } else { + call = make_runtime_call(RC_LEAF, OptoRuntime::updateBytesCRC32C_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + crc, src_start, length, table_start); + } Node* result = _gvn.transform(new ProjNode(call, TypeFunc::Parms)); set_result(result); return true; @@ -5871,9 +5881,19 @@ address stubAddr = StubRoutines::updateBytesCRC32C(); const char *stubName = "updateBytesCRC32C"; - Node* call = make_runtime_call(RC_LEAF, OptoRuntime::updateBytesCRC32C_Type(), - stubAddr, stubName, TypePtr::BOTTOM, - crc, src_start, length, table_start); + // OpenJDK 8175370: ABI adaptation. + Node* call = NULL; + if (CCallingConventionRequiresIntsAsLongs) { + Node* crc_I2L = ConvI2L(crc); + Node* length_I2L = ConvI2L(length); + call = make_runtime_call(RC_LEAF, OptoRuntime::updateBytesCRC32C_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + crc_I2L XTOP, src_start, length_I2L XTOP, table_start); + } else { + call = make_runtime_call(RC_LEAF, OptoRuntime::updateBytesCRC32C_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + crc, src_start, length, table_start); + } Node* result = _gvn.transform(new ProjNode(call, TypeFunc::Parms)); set_result(result); return true; @@ -5917,9 +5937,19 @@ address stubAddr = StubRoutines::updateBytesAdler32(); const char *stubName = "updateBytesAdler32"; - Node* call = make_runtime_call(RC_LEAF, OptoRuntime::updateBytesAdler32_Type(), - stubAddr, stubName, TypePtr::BOTTOM, - crc, src_start, length); + // OpenJDK 8175370: ABI adaptation. + Node* call = NULL; + if (CCallingConventionRequiresIntsAsLongs) { + Node* crc_I2L = ConvI2L(crc); + Node* length_I2L = ConvI2L(length); + call = make_runtime_call(RC_LEAF, OptoRuntime::updateBytesAdler32_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + crc_I2L XTOP, src_start, length_I2L XTOP); + } else { + call = make_runtime_call(RC_LEAF, OptoRuntime::updateBytesAdler32_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + crc, src_start, length); + } Node* result = _gvn.transform(new ProjNode(call, TypeFunc::Parms)); set_result(result); return true; @@ -5951,10 +5981,19 @@ address stubAddr = StubRoutines::updateBytesAdler32(); const char *stubName = "updateBytesAdler32"; - Node* call = make_runtime_call(RC_LEAF, OptoRuntime::updateBytesAdler32_Type(), - stubAddr, stubName, TypePtr::BOTTOM, - crc, src_start, length); - + // OpenJDK 8175370: ABI adaptation. + Node* call = NULL; + if (CCallingConventionRequiresIntsAsLongs) { + Node* crc_I2L = ConvI2L(crc); + Node* length_I2L = ConvI2L(length); + call = make_runtime_call(RC_LEAF, OptoRuntime::updateBytesAdler32_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + crc_I2L XTOP, src_start, length_I2L XTOP); + } else { + call = make_runtime_call(RC_LEAF, OptoRuntime::updateBytesAdler32_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + crc, src_start, length); + } Node* result = _gvn.transform(new ProjNode(call, TypeFunc::Parms)); set_result(result); return true;