comparison src/cpu/x86/vm/vtableStubs_x86_64.cpp @ 16:f8236e79048a

6664627: Merge changes made only in hotspot 11 forward to jdk 7 Reviewed-by: jcoomes
author dcubed
date Wed, 05 Dec 2007 09:00:00 -0800
parents a61af66fc99e
children ba764ed4b6f2
comparison
equal deleted inserted replaced
1:92489cdc94d1 16:f8236e79048a
151 151
152 if (HeapWordsPerLong > 1) { 152 if (HeapWordsPerLong > 1) {
153 // Round up to align_object_offset boundary 153 // Round up to align_object_offset boundary
154 __ round_to_q(rbx, BytesPerLong); 154 __ round_to_q(rbx, BytesPerLong);
155 } 155 }
156 Label hit, next, entry; 156 Label hit, next, entry, throw_icce;
157 157
158 __ jmpb(entry); 158 __ jmpb(entry);
159 159
160 __ bind(next); 160 __ bind(next);
161 __ addq(rbx, itableOffsetEntry::size() * wordSize); 161 __ addq(rbx, itableOffsetEntry::size() * wordSize);
162 162
163 __ bind(entry); 163 __ bind(entry);
164 164
165 #ifdef ASSERT 165 // If the entry is NULL then we've reached the end of the table
166 // Check that the entry is non-null 166 // without finding the expected interface, so throw an exception
167 if (DebugVtables) { 167 __ movq(j_rarg1, Address(rbx, itableOffsetEntry::interface_offset_in_bytes()));
168 Label L; 168 __ testq(j_rarg1, j_rarg1);
169 __ pushq(rbx); 169 __ jcc(Assembler::zero, throw_icce);
170 __ movq(rbx, Address(rbx, itableOffsetEntry::interface_offset_in_bytes())); 170 __ cmpq(rax, j_rarg1);
171 __ testq(rbx, rbx); 171 __ jccb(Assembler::notEqual, next);
172 __ jcc(Assembler::notZero, L);
173 __ stop("null entry point found in itable's offset table");
174 __ bind(L);
175 __ popq(rbx);
176 }
177 #endif
178
179 __ cmpq(rax, Address(rbx, itableOffsetEntry::interface_offset_in_bytes()));
180 __ jcc(Assembler::notEqual, next);
181 172
182 // We found a hit, move offset into j_rarg1 173 // We found a hit, move offset into j_rarg1
183 __ movl(j_rarg1, Address(rbx, itableOffsetEntry::offset_offset_in_bytes())); 174 __ movl(j_rarg1, Address(rbx, itableOffsetEntry::offset_offset_in_bytes()));
184 175
185 // Compute itableMethodEntry 176 // Compute itableMethodEntry
201 // method (rbx): methodOop 192 // method (rbx): methodOop
202 // j_rarg0: receiver 193 // j_rarg0: receiver
203 194
204 195
205 #ifdef ASSERT 196 #ifdef ASSERT
206 if (DebugVtables) { 197 if (DebugVtables) {
207 Label L2; 198 Label L2;
208 __ cmpq(method, (int)NULL); 199 __ cmpq(method, (int)NULL);
209 __ jcc(Assembler::equal, L2); 200 __ jcc(Assembler::equal, L2);
210 __ cmpq(Address(method, methodOopDesc::from_compiled_offset()), (int)NULL_WORD); 201 __ cmpq(Address(method, methodOopDesc::from_compiled_offset()), (int)NULL_WORD);
211 __ jcc(Assembler::notZero, L2); 202 __ jcc(Assembler::notZero, L2);
212 __ stop("compiler entrypoint is null"); 203 __ stop("compiler entrypoint is null");
213 __ bind(L2); 204 __ bind(L2);
214 } 205 }
215 #endif // ASSERT 206 #endif // ASSERT
216 207
217 // rbx: methodOop 208 // rbx: methodOop
218 // j_rarg0: receiver 209 // j_rarg0: receiver
219 address ame_addr = __ pc(); 210 address ame_addr = __ pc();
220 __ jmp(Address(method, methodOopDesc::from_compiled_offset())); 211 __ jmp(Address(method, methodOopDesc::from_compiled_offset()));
212
213 __ bind(throw_icce);
214 // Restore saved register
215 __ popq(j_rarg1);
216 __ jump(RuntimeAddress(StubRoutines::throw_IncompatibleClassChangeError_entry()));
221 217
222 __ flush(); 218 __ flush();
219
220 guarantee(__ pc() <= s->code_end(), "overflowed buffer");
221
223 s->set_exception_points(npe_addr, ame_addr); 222 s->set_exception_points(npe_addr, ame_addr);
224 return s; 223 return s;
225 } 224 }
226 225
227 int VtableStub::pd_code_size_limit(bool is_vtable_stub) { 226 int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
228 if (is_vtable_stub) { 227 if (is_vtable_stub) {
229 // Vtable stub size 228 // Vtable stub size
230 return (DebugVtables ? 512 : 24) + (CountCompiledCalls ? 13 : 0); 229 return (DebugVtables ? 512 : 24) + (CountCompiledCalls ? 13 : 0);
231 } else { 230 } else {
232 // Itable stub size 231 // Itable stub size
233 return (DebugVtables ? 636 : 64) + (CountCompiledCalls ? 13 : 0); 232 return (DebugVtables ? 636 : 72) + (CountCompiledCalls ? 13 : 0);
234 } 233 }
235 } 234 }
236 235
237 int VtableStub::pd_code_alignment() { 236 int VtableStub::pd_code_alignment() {
238 return wordSize; 237 return wordSize;