< prev index next >
src/share/vm/opto/runtime.cpp
Print this page
rev 8499 : 8086069: Adapt runtime calls to recent intrinsics to pass ints as long
*** 829,873 ****
return TypeFunc::make(domain, range);
}
/**
* int updateBytesCRC32(int crc, byte* b, int len)
*/
const TypeFunc* OptoRuntime::updateBytesCRC32_Type() {
// create input type (domain)
! int num_args = 3;
int argcnt = num_args;
- const Type** fields = TypeTuple::fields(argcnt);
int argp = TypeFunc::Parms;
fields[argp++] = TypeInt::INT; // crc
fields[argp++] = TypePtr::NOTNULL; // src
fields[argp++] = TypeInt::INT; // len
assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
// result type needed
fields = TypeTuple::fields(1);
fields[TypeFunc::Parms+0] = TypeInt::INT; // crc result
const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields);
return TypeFunc::make(domain, range);
}
! // for cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning int
const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() {
// create input type (domain)
! int num_args = 5;
if (Matcher::pass_original_key_for_aes()) {
! num_args = 6;
}
int argcnt = num_args;
- const Type** fields = TypeTuple::fields(argcnt);
int argp = TypeFunc::Parms;
fields[argp++] = TypePtr::NOTNULL; // src
fields[argp++] = TypePtr::NOTNULL; // dest
fields[argp++] = TypePtr::NOTNULL; // k array
fields[argp++] = TypePtr::NOTNULL; // r array
fields[argp++] = TypeInt::INT; // src len
if (Matcher::pass_original_key_for_aes()) {
fields[argp++] = TypePtr::NOTNULL; // original k array
}
assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
--- 829,898 ----
return TypeFunc::make(domain, range);
}
/**
* int updateBytesCRC32(int crc, byte* b, int len)
+ *
+ * If CCallingConventionRequiresIntsAsLongs is true, the platform ABI
+ * requires us to expand int arguments to long. The TypeTuple of an
+ * original int argument then consists of a TypeLong::LONG and a
+ * TypeLONG::HALF pair.
*/
const TypeFunc* OptoRuntime::updateBytesCRC32_Type() {
// create input type (domain)
! int num_args = CCallingConventionRequiresIntsAsLongs ? 5 : 3;
int argcnt = num_args;
int argp = TypeFunc::Parms;
+ const Type** fields = TypeTuple::fields(argcnt);
+ if (CCallingConventionRequiresIntsAsLongs) {
+ fields[argp++] = TypeLong::LONG; // crc
+ fields[argp++] = TypeLong::HALF; // placeholder
+ fields[argp++] = TypePtr::NOTNULL; // src
+ fields[argp++] = TypeLong::LONG; // len
+ fields[argp++] = TypeLong::HALF; // placeholder
+ } else {
fields[argp++] = TypeInt::INT; // crc
fields[argp++] = TypePtr::NOTNULL; // src
fields[argp++] = TypeInt::INT; // len
+ }
assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
// result type needed
fields = TypeTuple::fields(1);
fields[TypeFunc::Parms+0] = TypeInt::INT; // crc result
const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields);
return TypeFunc::make(domain, range);
}
! /*
! * For cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning int.
! *
! * If CCallingConventionRequiresIntsAsLongs is true, the platform ABI
! * requires us to expand int arguments to long. The TypeTuple of an
! * original int argument then consists of a TypeLong::LONG and a
! * TypeLONG::HALF pair.
! */
const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() {
// create input type (domain)
! int num_args = CCallingConventionRequiresIntsAsLongs ? 6 : 5;
if (Matcher::pass_original_key_for_aes()) {
! num_args += 1;
}
int argcnt = num_args;
int argp = TypeFunc::Parms;
+ const Type** fields = TypeTuple::fields(argcnt);
fields[argp++] = TypePtr::NOTNULL; // src
fields[argp++] = TypePtr::NOTNULL; // dest
fields[argp++] = TypePtr::NOTNULL; // k array
fields[argp++] = TypePtr::NOTNULL; // r array
+ if (CCallingConventionRequiresIntsAsLongs) {
+ fields[argp++] = TypeLong::LONG; // src len
+ fields[argp++] = TypeLong::HALF; // placeholder
+ } else {
fields[argp++] = TypeInt::INT; // src len
+ }
if (Matcher::pass_original_key_for_aes()) {
fields[argp++] = TypePtr::NOTNULL; // original k array
}
assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
*** 900,942 ****
return TypeFunc::make(domain, range);
}
/*
* int implCompressMultiBlock(byte[] b, int ofs, int limit)
*/
const TypeFunc* OptoRuntime::digestBase_implCompressMB_Type() {
// create input type (domain)
! int num_args = 4;
int argcnt = num_args;
- const Type** fields = TypeTuple::fields(argcnt);
int argp = TypeFunc::Parms;
fields[argp++] = TypePtr::NOTNULL; // buf
fields[argp++] = TypePtr::NOTNULL; // state
fields[argp++] = TypeInt::INT; // ofs
fields[argp++] = TypeInt::INT; // limit
assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
// returning ofs (int)
fields = TypeTuple::fields(1);
fields[TypeFunc::Parms+0] = TypeInt::INT; // ofs
const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields);
return TypeFunc::make(domain, range);
}
const TypeFunc* OptoRuntime::multiplyToLen_Type() {
// create input type (domain)
! int num_args = 6;
int argcnt = num_args;
- const Type** fields = TypeTuple::fields(argcnt);
int argp = TypeFunc::Parms;
fields[argp++] = TypePtr::NOTNULL; // x
fields[argp++] = TypeInt::INT; // xlen
fields[argp++] = TypePtr::NOTNULL; // y
fields[argp++] = TypeInt::INT; // ylen
fields[argp++] = TypePtr::NOTNULL; // z
fields[argp++] = TypeInt::INT; // zlen
assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
// no result type needed
fields = TypeTuple::fields(1);
--- 925,997 ----
return TypeFunc::make(domain, range);
}
/*
* int implCompressMultiBlock(byte[] b, int ofs, int limit)
+ *
+ * If CCallingConventionRequiresIntsAsLongs is true, the platform ABI
+ * requires us to expand int arguments to long. The TypeTuple of an
+ * original int argument then consists of a TypeLong::LONG and a
+ * TypeLONG::HALF pair.
*/
const TypeFunc* OptoRuntime::digestBase_implCompressMB_Type() {
// create input type (domain)
! int num_args = CCallingConventionRequiresIntsAsLongs ? 6 : 4;
int argcnt = num_args;
int argp = TypeFunc::Parms;
+ const Type** fields = TypeTuple::fields(argcnt);
fields[argp++] = TypePtr::NOTNULL; // buf
fields[argp++] = TypePtr::NOTNULL; // state
+ if (CCallingConventionRequiresIntsAsLongs) {
+ fields[argp++] = TypeLong::LONG; // ofs
+ fields[argp++] = TypeLong::HALF; // placeholder
+ fields[argp++] = TypeLong::LONG; // limit
+ fields[argp++] = TypeLong::HALF; // placeholder
+ } else {
fields[argp++] = TypeInt::INT; // ofs
fields[argp++] = TypeInt::INT; // limit
+ }
assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
// returning ofs (int)
fields = TypeTuple::fields(1);
fields[TypeFunc::Parms+0] = TypeInt::INT; // ofs
const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields);
return TypeFunc::make(domain, range);
}
+ /*
+ * If CCallingConventionRequiresIntsAsLongs is true, the platform ABI
+ * requires us to expand int arguments to long. The TypeTuple of an
+ * original int argument then consists of a TypeLong::LONG and a
+ * TypeLONG::HALF pair.
+ */
const TypeFunc* OptoRuntime::multiplyToLen_Type() {
// create input type (domain)
! int num_args = CCallingConventionRequiresIntsAsLongs ? 9 : 6;
int argcnt = num_args;
int argp = TypeFunc::Parms;
+ const Type** fields = TypeTuple::fields(argcnt);
+ if (CCallingConventionRequiresIntsAsLongs) {
+ fields[argp++] = TypePtr::NOTNULL; // x
+ fields[argp++] = TypeLong::LONG; // xlen
+ fields[argp++] = TypeLong::HALF; // placeholder
+ fields[argp++] = TypePtr::NOTNULL; // y
+ fields[argp++] = TypeLong::LONG; // ylen
+ fields[argp++] = TypeLong::HALF; // placeholder
+ fields[argp++] = TypePtr::NOTNULL; // z
+ fields[argp++] = TypeLong::LONG; // zlen
+ fields[argp++] = TypeLong::HALF; // placeholder
+ } else {
fields[argp++] = TypePtr::NOTNULL; // x
fields[argp++] = TypeInt::INT; // xlen
fields[argp++] = TypePtr::NOTNULL; // y
fields[argp++] = TypeInt::INT; // ylen
fields[argp++] = TypePtr::NOTNULL; // z
fields[argp++] = TypeInt::INT; // zlen
+ }
assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
// no result type needed
fields = TypeTuple::fields(1);
< prev index next >