1052
1053 // We are frameless so we can just jump to the stub.
1054 __ b(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32()));
1055
1056 // generate a vanilla native entry as the slow path
1057 __ bind(slow_path);
1058 __ jump_to_entry(Interpreter::entry_for_kind(Interpreter::native));
1059 return entry;
1060 }
1061 return NULL;
1062 }
1063
1064 /**
1065 * Method entry for intrinsic-candidate (non-native) methods:
1066 * int java.util.zip.CRC32C.updateBytes(int crc, byte[] b, int off, int end)
1067 * int java.util.zip.CRC32C.updateDirectByteBuffer(int crc, long buf, int off, int end)
1068 * Unlike CRC32, CRC32C does not have any methods marked as native
1069 * CRC32C also uses an "end" variable instead of the length variable CRC32 uses
1070 */
1071 address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) {
1072 if (UseCRC32Intrinsics) {
1073 address entry = __ pc();
1074
1075 // Prepare jump to stub using parameters from the stack
1076 const Register crc = c_rarg0; // initial crc
1077 const Register buf = c_rarg1; // source java byte array address
1078 const Register len = c_rarg2; // len argument to the kernel
1079
1080 const Register end = len; // index of last element to process
1081 const Register off = crc; // offset
1082
1083 __ ldrw(end, Address(esp)); // int end
1084 __ ldrw(off, Address(esp, wordSize)); // int offset
1085 __ sub(len, end, off);
1086 __ ldr(buf, Address(esp, 2*wordSize)); // byte[] buf | long buf
1087 __ add(buf, buf, off); // + offset
1088 if (kind == Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer) {
1089 __ ldrw(crc, Address(esp, 4*wordSize)); // long crc
1090 } else {
1091 __ add(buf, buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
1092 __ ldrw(crc, Address(esp, 3*wordSize)); // long crc
|
1052
1053 // We are frameless so we can just jump to the stub.
1054 __ b(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32()));
1055
1056 // generate a vanilla native entry as the slow path
1057 __ bind(slow_path);
1058 __ jump_to_entry(Interpreter::entry_for_kind(Interpreter::native));
1059 return entry;
1060 }
1061 return NULL;
1062 }
1063
1064 /**
1065 * Method entry for intrinsic-candidate (non-native) methods:
1066 * int java.util.zip.CRC32C.updateBytes(int crc, byte[] b, int off, int end)
1067 * int java.util.zip.CRC32C.updateDirectByteBuffer(int crc, long buf, int off, int end)
1068 * Unlike CRC32, CRC32C does not have any methods marked as native
1069 * CRC32C also uses an "end" variable instead of the length variable CRC32 uses
1070 */
1071 address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) {
1072 if (UseCRC32CIntrinsics) {
1073 address entry = __ pc();
1074
1075 // Prepare jump to stub using parameters from the stack
1076 const Register crc = c_rarg0; // initial crc
1077 const Register buf = c_rarg1; // source java byte array address
1078 const Register len = c_rarg2; // len argument to the kernel
1079
1080 const Register end = len; // index of last element to process
1081 const Register off = crc; // offset
1082
1083 __ ldrw(end, Address(esp)); // int end
1084 __ ldrw(off, Address(esp, wordSize)); // int offset
1085 __ sub(len, end, off);
1086 __ ldr(buf, Address(esp, 2*wordSize)); // byte[] buf | long buf
1087 __ add(buf, buf, off); // + offset
1088 if (kind == Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer) {
1089 __ ldrw(crc, Address(esp, 4*wordSize)); // long crc
1090 } else {
1091 __ add(buf, buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
1092 __ ldrw(crc, Address(esp, 3*wordSize)); // long crc
|