239 __ safepoint_poll(slow_path, r15_thread, rscratch1);
240
241 // We don't generate local frame and don't align stack because
242 // we call stub code and there is no safepoint on this path.
243
244 // Load parameters
245 const Register crc = c_rarg0; // crc
246 const Register buf = c_rarg1; // source java byte array address
247 const Register len = c_rarg2; // length
248 const Register off = len; // offset (never overlaps with 'len')
249
250 // Arguments are reversed on java expression stack
251 // Calculate address of start element
252 if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) {
253 __ movptr(buf, Address(rsp, 3*wordSize)); // long buf
254 __ movl2ptr(off, Address(rsp, 2*wordSize)); // offset
255 __ addq(buf, off); // + offset
256 __ movl(crc, Address(rsp, 5*wordSize)); // Initial CRC
257 } else {
258 __ movptr(buf, Address(rsp, 3*wordSize)); // byte[] array
259 __ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
260 __ movl2ptr(off, Address(rsp, 2*wordSize)); // offset
261 __ addq(buf, off); // + offset
262 __ movl(crc, Address(rsp, 4*wordSize)); // Initial CRC
263 }
264 // Can now load 'len' since we're finished with 'off'
265 __ movl(len, Address(rsp, wordSize)); // Length
266
267 __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32()), crc, buf, len);
268 // result in rax
269
270 // _areturn
271 __ pop(rdi); // get return address
272 __ mov(rsp, r13); // set sp to sender sp
273 __ jmp(rdi);
274
275 // generate a vanilla native entry as the slow path
276 __ bind(slow_path);
277 __ jump_to_entry(Interpreter::entry_for_kind(Interpreter::native));
278 return entry;
294 const Register len = c_rarg2;
295 const Register off = c_rarg3; // offset
296 const Register end = len;
297
298 // Arguments are reversed on java expression stack
299 // Calculate address of start element
300 if (kind == Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer) {
301 __ movptr(buf, Address(rsp, 3 * wordSize)); // long address
302 __ movl2ptr(off, Address(rsp, 2 * wordSize)); // offset
303 __ addq(buf, off); // + offset
304 __ movl(crc, Address(rsp, 5 * wordSize)); // Initial CRC
305 // Note on 5 * wordSize vs. 4 * wordSize:
306 // * int java.util.zip.CRC32C.updateByteBuffer(int crc, long address, int off, int end)
307 // 4 2,3 1 0
308 // end starts at SP + 8
309 // The Java(R) Virtual Machine Specification Java SE 7 Edition
310 // 4.10.2.3. Values of Types long and double
311 // "When calculating operand stack length, values of type long and double have length two."
312 } else {
313 __ movptr(buf, Address(rsp, 3 * wordSize)); // byte[] array
314 __ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
315 __ movl2ptr(off, Address(rsp, 2 * wordSize)); // offset
316 __ addq(buf, off); // + offset
317 __ movl(crc, Address(rsp, 4 * wordSize)); // Initial CRC
318 }
319 __ movl(end, Address(rsp, wordSize)); // end
320 __ subl(end, off); // end - off
321 __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32C()), crc, buf, len);
322 // result in rax
323 // _areturn
324 __ pop(rdi); // get return address
325 __ mov(rsp, r13); // set sp to sender sp
326 __ jmp(rdi);
327
328 return entry;
329 }
330
331 return NULL;
332 }
333
|
239 __ safepoint_poll(slow_path, r15_thread, rscratch1);
240
241 // We don't generate local frame and don't align stack because
242 // we call stub code and there is no safepoint on this path.
243
244 // Load parameters
245 const Register crc = c_rarg0; // crc
246 const Register buf = c_rarg1; // source java byte array address
247 const Register len = c_rarg2; // length
248 const Register off = len; // offset (never overlaps with 'len')
249
250 // Arguments are reversed on java expression stack
251 // Calculate address of start element
252 if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) {
253 __ movptr(buf, Address(rsp, 3*wordSize)); // long buf
254 __ movl2ptr(off, Address(rsp, 2*wordSize)); // offset
255 __ addq(buf, off); // + offset
256 __ movl(crc, Address(rsp, 5*wordSize)); // Initial CRC
257 } else {
258 __ movptr(buf, Address(rsp, 3*wordSize)); // byte[] array
259 __ resolve_for_read(OOP_NOT_NULL, buf);
260 __ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
261 __ movl2ptr(off, Address(rsp, 2*wordSize)); // offset
262 __ addq(buf, off); // + offset
263 __ movl(crc, Address(rsp, 4*wordSize)); // Initial CRC
264 }
265 // Can now load 'len' since we're finished with 'off'
266 __ movl(len, Address(rsp, wordSize)); // Length
267
268 __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32()), crc, buf, len);
269 // result in rax
270
271 // _areturn
272 __ pop(rdi); // get return address
273 __ mov(rsp, r13); // set sp to sender sp
274 __ jmp(rdi);
275
276 // generate a vanilla native entry as the slow path
277 __ bind(slow_path);
278 __ jump_to_entry(Interpreter::entry_for_kind(Interpreter::native));
279 return entry;
295 const Register len = c_rarg2;
296 const Register off = c_rarg3; // offset
297 const Register end = len;
298
299 // Arguments are reversed on java expression stack
300 // Calculate address of start element
301 if (kind == Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer) {
302 __ movptr(buf, Address(rsp, 3 * wordSize)); // long address
303 __ movl2ptr(off, Address(rsp, 2 * wordSize)); // offset
304 __ addq(buf, off); // + offset
305 __ movl(crc, Address(rsp, 5 * wordSize)); // Initial CRC
306 // Note on 5 * wordSize vs. 4 * wordSize:
307 // * int java.util.zip.CRC32C.updateByteBuffer(int crc, long address, int off, int end)
308 // 4 2,3 1 0
309 // end starts at SP + 8
310 // The Java(R) Virtual Machine Specification Java SE 7 Edition
311 // 4.10.2.3. Values of Types long and double
312 // "When calculating operand stack length, values of type long and double have length two."
313 } else {
314 __ movptr(buf, Address(rsp, 3 * wordSize)); // byte[] array
315 __ resolve_for_read(OOP_NOT_NULL, buf);
316 __ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
317 __ movl2ptr(off, Address(rsp, 2 * wordSize)); // offset
318 __ addq(buf, off); // + offset
319 __ movl(crc, Address(rsp, 4 * wordSize)); // Initial CRC
320 }
321 __ movl(end, Address(rsp, wordSize)); // end
322 __ subl(end, off); // end - off
323 __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32C()), crc, buf, len);
324 // result in rax
325 // _areturn
326 __ pop(rdi); // get return address
327 __ mov(rsp, r13); // set sp to sender sp
328 __ jmp(rdi);
329
330 return entry;
331 }
332
333 return NULL;
334 }
335
|