< prev index next >

src/cpu/s390/vm/templateInterpreterGenerator_s390.cpp

Print this page

        

@@ -1931,12 +1931,15 @@
   BLOCK_COMMENT("} normal_entry");
 
   return entry_point;
 }
 
-// Method entry for static native methods:
-//   int java.util.zip.CRC32.update(int crc, int b)
+
+/**
+ * Method entry for static native methods:
+ *   int java.util.zip.CRC32.update(int crc, int b)
+ */
 address TemplateInterpreterGenerator::generate_CRC32_update_entry() {
 
   if (UseCRC32Intrinsics) {
     uint64_t entry_off = __ offset();
     Label    slow_path;

@@ -1981,13 +1984,15 @@
 
   return NULL;
 }
 
 
-// Method entry for static native methods:
-//   int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len)
-//   int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len)
+/**
+ * Method entry for static native methods:
+ *   int java.util.zip.CRC32.updateBytes(     int crc, byte[] b,  int off, int len)
+ *   int java.util.zip.CRC32.updateByteBuffer(int crc, long* buf, int off, int len)
+ */
 address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) {
 
   if (UseCRC32Intrinsics) {
     uint64_t entry_off = __ offset();
     Label    slow_path;

@@ -2059,13 +2064,17 @@
 
   return NULL;
 }
 
 
-// Method entry for static native methods:
-//   int java.util.zip.CRC32C.updateBytes(int crc, byte[] b, int off, int len)
-//   int java.util.zip.CRC32C.updateDirectByteBuffer(int crc, long buf, int off, int len)
+/**
+ * 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 (UseCRC32CIntrinsics) {
     uint64_t entry_off = __ offset();
 

@@ -2094,22 +2103,24 @@
       // data = buf + off
       BLOCK_COMMENT("CRC32C_updateDirectByteBuffer {");
       __ z_llgf(crc,    5*wordSize, argP);  // current crc state
       __ z_lg(data,     3*wordSize, argP);  // start of byte buffer
       __ z_agf(data,    2*wordSize, argP);  // Add byte buffer offset.
-      __ z_lgf(dataLen, 1*wordSize, argP);  // #bytes to process
+      __ z_lgf(dataLen, 1*wordSize, argP);  // #bytes to process, calculated as
+      __ z_sgf(dataLen, Address(argP, 2*wordSize));  // (end_index - offset)
     } else {                                                                // Used for "updateBytes update".
       // crc     @ (SP + 4W) (32bit)
       // buf     @ (SP + 3W) (64bit ptr to byte array)
       // off     @ (SP + 2W) (32bit)
       // dataLen @ (SP + 1W) (32bit)
       // data = buf + off + base_offset
       BLOCK_COMMENT("CRC32C_updateBytes {");
       __ z_llgf(crc,    4*wordSize, argP);  // current crc state
       __ z_lg(data,     3*wordSize, argP);  // start of byte buffer
       __ z_agf(data,    2*wordSize, argP);  // Add byte buffer offset.
-      __ z_lgf(dataLen, 1*wordSize, argP);  // #bytes to process
+      __ z_lgf(dataLen, 1*wordSize, argP);  // #bytes to process, calculated as
+      __ z_sgf(dataLen, Address(argP, 2*wordSize));  // (end_index - offset)
       __ z_aghi(data, arrayOopDesc::base_offset_in_bytes(T_BYTE));
     }
 
     StubRoutines::zarch::generate_load_crc32c_table_addr(_masm, table);
 
< prev index next >