44 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), rbx, rdi, rcx);
45 __ ret(0);
46 return entry;
47 }
48
49 /**
50 * Method entry for static native methods:
51 * int java.util.zip.CRC32.update(int crc, int b)
52 */
53 address TemplateInterpreterGenerator::generate_CRC32_update_entry() {
54 if (UseCRC32Intrinsics) {
55 address entry = __ pc();
56
57 // rbx: Method*
58 // rsi: senderSP must preserved for slow path, set SP to it on fast path
59 // rdx: scratch
60 // rdi: scratch
61
62 Label slow_path;
63 // If we need a safepoint check, generate full interpreter entry.
64 ExternalAddress state(SafepointSynchronize::address_of_state());
65 __ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()),
66 SafepointSynchronize::_not_synchronized);
67 __ jcc(Assembler::notEqual, slow_path);
68
69 // We don't generate local frame and don't align stack because
70 // we call stub code and there is no safepoint on this path.
71
72 // Load parameters
73 const Register crc = rax; // crc
74 const Register val = rdx; // source java byte value
75 const Register tbl = rdi; // scratch
76
77 // Arguments are reversed on java expression stack
78 __ movl(val, Address(rsp, wordSize)); // byte value
79 __ movl(crc, Address(rsp, 2*wordSize)); // Initial CRC
80
81 __ lea(tbl, ExternalAddress(StubRoutines::crc_table_addr()));
82 __ notl(crc); // ~crc
83 __ update_byte_crc32(crc, val, tbl);
84 __ notl(crc); // ~crc
85 // result in rax
86
87 // _areturn
96 }
97 return NULL;
98 }
99
100 /**
101 * Method entry for static native methods:
102 * int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len)
103 * int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len)
104 */
105 address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) {
106 if (UseCRC32Intrinsics) {
107 address entry = __ pc();
108
109 // rbx,: Method*
110 // rsi: senderSP must preserved for slow path, set SP to it on fast path
111 // rdx: scratch
112 // rdi: scratch
113
114 Label slow_path;
115 // If we need a safepoint check, generate full interpreter entry.
116 ExternalAddress state(SafepointSynchronize::address_of_state());
117 __ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()),
118 SafepointSynchronize::_not_synchronized);
119 __ jcc(Assembler::notEqual, slow_path);
120
121 // We don't generate local frame and don't align stack because
122 // we call stub code and there is no safepoint on this path.
123
124 // Load parameters
125 const Register crc = rax; // crc
126 const Register buf = rdx; // source java byte array address
127 const Register len = rdi; // length
128
129 // value x86_32
130 // interp. arg ptr ESP + 4
131 // int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len)
132 // 3 2 1 0
133 // int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len)
134 // 4 2,3 1 0
135
136 // Arguments are reversed on java expression stack
137 __ movl(len, Address(rsp, 4 + 0)); // Length
138 // Calculate address of start element
139 if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) {
|
44 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), rbx, rdi, rcx);
45 __ ret(0);
46 return entry;
47 }
48
49 /**
50 * Method entry for static native methods:
51 * int java.util.zip.CRC32.update(int crc, int b)
52 */
53 address TemplateInterpreterGenerator::generate_CRC32_update_entry() {
54 if (UseCRC32Intrinsics) {
55 address entry = __ pc();
56
57 // rbx: Method*
58 // rsi: senderSP must preserved for slow path, set SP to it on fast path
59 // rdx: scratch
60 // rdi: scratch
61
62 Label slow_path;
63 // If we need a safepoint check, generate full interpreter entry.
64 __ safepoint_poll(slow_path, noreg, rdi);
65
66 // We don't generate local frame and don't align stack because
67 // we call stub code and there is no safepoint on this path.
68
69 // Load parameters
70 const Register crc = rax; // crc
71 const Register val = rdx; // source java byte value
72 const Register tbl = rdi; // scratch
73
74 // Arguments are reversed on java expression stack
75 __ movl(val, Address(rsp, wordSize)); // byte value
76 __ movl(crc, Address(rsp, 2*wordSize)); // Initial CRC
77
78 __ lea(tbl, ExternalAddress(StubRoutines::crc_table_addr()));
79 __ notl(crc); // ~crc
80 __ update_byte_crc32(crc, val, tbl);
81 __ notl(crc); // ~crc
82 // result in rax
83
84 // _areturn
93 }
94 return NULL;
95 }
96
97 /**
98 * Method entry for static native methods:
99 * int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len)
100 * int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len)
101 */
102 address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) {
103 if (UseCRC32Intrinsics) {
104 address entry = __ pc();
105
106 // rbx,: Method*
107 // rsi: senderSP must preserved for slow path, set SP to it on fast path
108 // rdx: scratch
109 // rdi: scratch
110
111 Label slow_path;
112 // If we need a safepoint check, generate full interpreter entry.
113 __ safepoint_poll(slow_path, noreg, rdi);
114
115 // We don't generate local frame and don't align stack because
116 // we call stub code and there is no safepoint on this path.
117
118 // Load parameters
119 const Register crc = rax; // crc
120 const Register buf = rdx; // source java byte array address
121 const Register len = rdi; // length
122
123 // value x86_32
124 // interp. arg ptr ESP + 4
125 // int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len)
126 // 3 2 1 0
127 // int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len)
128 // 4 2,3 1 0
129
130 // Arguments are reversed on java expression stack
131 __ movl(len, Address(rsp, 4 + 0)); // Length
132 // Calculate address of start element
133 if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) {
|