< prev index next >
src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
Print this page
*** 1059,1070 ****
return entry;
}
return NULL;
}
! // Not supported
address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) {
return NULL;
}
void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
// Bang each page in the shadow zone. We can't assume it's been done for
--- 1059,1106 ----
return entry;
}
return NULL;
}
! /**
! * Method entry for intrinsic-candidate (non-native) methods:
! * int java.util.zip.CRC32C.updateBytes(int crc, byte[] b, int off, int end)
! * int java.util.zip.CRC32C.updateDirectByteBuffer(int crc, long buf, int off, int end)
! * Unlike CRC32, CRC32C does not have any methods marked as native
! * CRC32C also uses an "end" variable instead of the length variable CRC32 uses
! */
address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) {
+ if (UseCRC32Intrinsics) {
+ address entry = __ pc();
+
+ // Prepare jump to stub using parameters from the stack
+ const Register crc = c_rarg0; // initial crc
+ const Register buf = c_rarg1; // source java byte array address
+ const Register len = c_rarg2; // len argument to the kernel
+
+ const Register end = len; // index of last element to process
+ const Register off = crc; // offset
+
+ __ ldrw(end, Address(esp)); // int end
+ __ ldrw(off, Address(esp, wordSize)); // int offset
+ __ sub(len, end, off);
+ __ ldr(buf, Address(esp, 2*wordSize)); // byte[] buf | long buf
+ __ add(buf, buf, off); // + offset
+ if (kind == Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer) {
+ __ ldrw(crc, Address(esp, 4*wordSize)); // long crc
+ } else {
+ __ add(buf, buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
+ __ ldrw(crc, Address(esp, 3*wordSize)); // long crc
+ }
+
+ __ andr(sp, r13, -16); // Restore the caller's SP
+
+ // Jump to the stub.
+ __ b(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32C()));
+
+ return entry;
+ }
return NULL;
}
void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
// Bang each page in the shadow zone. We can't assume it's been done for
< prev index next >