Mercurial > hg > truffle
comparison src/cpu/x86/vm/templateInterpreter_x86_64.cpp @ 11230:5c153c59ba62
fixed bug in java.util.zip.CRC32.updateBytes interpreter entry stub
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 06 Aug 2013 21:40:09 +0200 |
parents | e28663a9f5ef |
children | 84589a49d184 |
comparison
equal
deleted
inserted
replaced
11229:78da293f6efa | 11230:5c153c59ba62 |
---|---|
993 | 993 |
994 // Load parameters | 994 // Load parameters |
995 const Register crc = c_rarg0; // crc | 995 const Register crc = c_rarg0; // crc |
996 const Register buf = c_rarg1; // source java byte array address | 996 const Register buf = c_rarg1; // source java byte array address |
997 const Register len = c_rarg2; // length | 997 const Register len = c_rarg2; // length |
998 const Register off = len; // offset (never overlaps with 'len') | |
998 | 999 |
999 // Arguments are reversed on java expression stack | 1000 // Arguments are reversed on java expression stack |
1000 __ movl(len, Address(rsp, wordSize)); // Length | |
1001 // Calculate address of start element | 1001 // Calculate address of start element |
1002 if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) { | 1002 if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) { |
1003 __ movptr(buf, Address(rsp, 3*wordSize)); // long buf | 1003 __ movptr(buf, Address(rsp, 3*wordSize)); // long buf |
1004 __ addptr(buf, Address(rsp, 2*wordSize)); // + offset | 1004 __ movl(len, Address(rsp, 2*wordSize)); // offset |
1005 __ addq(buf, len); // + offset | |
1005 __ movl(crc, Address(rsp, 5*wordSize)); // Initial CRC | 1006 __ movl(crc, Address(rsp, 5*wordSize)); // Initial CRC |
1006 } else { | 1007 } else { |
1007 __ movptr(buf, Address(rsp, 3*wordSize)); // byte[] array | 1008 __ movptr(buf, Address(rsp, 3*wordSize)); // byte[] array |
1008 __ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size | 1009 __ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size |
1009 __ addptr(buf, Address(rsp, 2*wordSize)); // + offset | 1010 __ movl(len, Address(rsp, 2*wordSize)); // offset |
1011 __ addq(buf, len); // + offset | |
1010 __ movl(crc, Address(rsp, 4*wordSize)); // Initial CRC | 1012 __ movl(crc, Address(rsp, 4*wordSize)); // Initial CRC |
1011 } | 1013 } |
1014 // Can now load 'len' since we're finished with 'off' | |
1015 __ movl(len, Address(rsp, wordSize)); // Length | |
1012 | 1016 |
1013 __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32()), crc, buf, len); | 1017 __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32()), crc, buf, len); |
1014 // result in rax | 1018 // result in rax |
1015 | 1019 |
1016 // _areturn | 1020 // _areturn |