< prev index next >
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java
Print this page
*** 55,65 ****
@Fold
static long crcTableAddress(@InjectedParameter GraalHotSpotVMConfig config) {
return config.crcTableAddress;
}
! @MethodSubstitution
static int update(int crc, int b) {
final long crcTableRawAddress = GraalHotSpotVMConfigNode.crcTableAddress();
int c = ~crc;
int index = (b ^ c) & 0xFF;
--- 55,65 ----
@Fold
static long crcTableAddress(@InjectedParameter GraalHotSpotVMConfig config) {
return config.crcTableAddress;
}
! @MethodSubstitution(optional = true)
static int update(int crc, int b) {
final long crcTableRawAddress = GraalHotSpotVMConfigNode.crcTableAddress();
int c = ~crc;
int index = (b ^ c) & 0xFF;
*** 67,77 ****
int result = Word.unsigned(crcTableRawAddress).readInt(offset);
result = result ^ (c >>> 8);
return ~result;
}
! @MethodSubstitution
static int updateBytes(int crc, byte[] buf, int off, int len) {
Word bufAddr = Word.unsigned(ComputeObjectAddressNode.get(buf, arrayBaseOffset(JavaKind.Byte) + off));
return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
}
--- 67,77 ----
int result = Word.unsigned(crcTableRawAddress).readInt(offset);
result = result ^ (c >>> 8);
return ~result;
}
! @MethodSubstitution(optional = true)
static int updateBytes(int crc, byte[] buf, int off, int len) {
Word bufAddr = Word.unsigned(ComputeObjectAddressNode.get(buf, arrayBaseOffset(JavaKind.Byte) + off));
return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
}
*** 82,92 ****
static int updateBytes0(int crc, byte[] buf, int off, int len) {
Word bufAddr = Word.unsigned(ComputeObjectAddressNode.get(buf, arrayBaseOffset(JavaKind.Byte) + off));
return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
}
! @MethodSubstitution
static int updateByteBuffer(int crc, long addr, int off, int len) {
Word bufAddr = Word.unsigned(addr).add(off);
return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
}
--- 82,92 ----
static int updateBytes0(int crc, byte[] buf, int off, int len) {
Word bufAddr = Word.unsigned(ComputeObjectAddressNode.get(buf, arrayBaseOffset(JavaKind.Byte) + off));
return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
}
! @MethodSubstitution(optional = true)
static int updateByteBuffer(int crc, long addr, int off, int len) {
Word bufAddr = Word.unsigned(addr).add(off);
return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
}
< prev index next >