1080 return entry; |
1080 return entry; |
1081 } |
1081 } |
1082 return NULL; |
1082 return NULL; |
1083 } |
1083 } |
1084 |
1084 |
1085 // Not supported |
1085 /** |
|
1086 * Method entry for intrinsic-candidate (non-native) methods: |
|
1087 * int java.util.zip.CRC32C.updateBytes(int crc, byte[] b, int off, int end) |
|
1088 * int java.util.zip.CRC32C.updateDirectByteBuffer(int crc, long buf, int off, int end) |
|
1089 * Unlike CRC32, CRC32C does not have any methods marked as native |
|
1090 * CRC32C also uses an "end" variable instead of the length variable CRC32 uses |
|
1091 */ |
1086 address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { |
1092 address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { |
|
1093 |
|
1094 if (UseCRC32CIntrinsics) { |
|
1095 address entry = __ pc(); |
|
1096 |
|
1097 // Load parameters from the stack |
|
1098 const Register crc = O0; // initial crc |
|
1099 const Register buf = O1; // source java byte array address |
|
1100 const Register offset = O2; // offset |
|
1101 const Register end = O3; // index of last element to process |
|
1102 const Register len = O2; // len argument to the kernel |
|
1103 const Register table = O3; // crc32c lookup table address |
|
1104 |
|
1105 // Arguments are reversed on java expression stack |
|
1106 // Calculate address of start element |
|
1107 if (kind == Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer) { |
|
1108 __ lduw(Gargs, 0, end); |
|
1109 __ lduw(Gargs, 8, offset); |
|
1110 __ ldx( Gargs, 16, buf); |
|
1111 __ lduw(Gargs, 32, crc); |
|
1112 __ add(buf, offset, buf); |
|
1113 __ sub(end, offset, len); |
|
1114 } else { |
|
1115 __ lduw(Gargs, 0, end); |
|
1116 __ lduw(Gargs, 8, offset); |
|
1117 __ ldx( Gargs, 16, buf); |
|
1118 __ lduw(Gargs, 24, crc); |
|
1119 __ add(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE), buf); // account for the header size |
|
1120 __ add(buf, offset, buf); |
|
1121 __ sub(end, offset, len); |
|
1122 } |
|
1123 |
|
1124 // Call the crc32c kernel |
|
1125 __ MacroAssembler::save_thread(L7_thread_cache); |
|
1126 __ kernel_crc32c(crc, buf, len, table); |
|
1127 __ MacroAssembler::restore_thread(L7_thread_cache); |
|
1128 |
|
1129 // result in O0 |
|
1130 __ retl(); |
|
1131 __ delayed()->nop(); |
|
1132 |
|
1133 return entry; |
|
1134 } |
1087 return NULL; |
1135 return NULL; |
1088 } |
1136 } |
1089 |
1137 |
1090 // Not supported |
1138 // Not supported |
1091 address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { |
1139 address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { |