< prev index next >

src/hotspot/cpu/x86/vtableStubs_x86_64.cpp

Print this page

201                              L_no_such_interface,
202                              /*return_method=*/false);
203 
204   const ptrdiff_t  typecheckSize = __ pc() - start_pc;
205   start_pc = __ pc();
206 
207   // Get selected method from declaring class and itable index
208   const Register method = rbx;
209   __ load_klass(recv_klass_reg, j_rarg0, temp_reg);   // restore recv_klass_reg
210   __ lookup_interface_method(// inputs: rec. class, interface, itable index
211                              recv_klass_reg, holder_klass_reg, itable_index,
212                              // outputs: method, scan temp. reg
213                              method, temp_reg,
214                              L_no_such_interface);
215 
216   const ptrdiff_t  lookupSize = __ pc() - start_pc;
217 
218   // We expect we need index_dependent_slop extra bytes. Reason:
219   // The emitted code in lookup_interface_method changes when itable_index exceeds 15.
220   // For linux, a very narrow estimate would be 112, but Solaris requires some more space (130).
221   const ptrdiff_t estimate = 136;

222   const ptrdiff_t codesize = typecheckSize + lookupSize + index_dependent_slop;
223   slop_delta  = (int)(estimate - codesize);
224   slop_bytes += slop_delta;
225   assert(slop_delta >= 0, "itable #%d: Code size estimate (%d) for lookup_interface_method too small, required: %d", itable_index, (int)estimate, (int)codesize);
226 
227   // If we take a trap while this arg is on the stack we will not
228   // be able to walk the stack properly. This is not an issue except
229   // when there are mistakes in this assembly code that could generate
230   // a spurious fault. Ask me how I know...
231 
232   // method (rbx): Method*
233   // j_rarg0: receiver
234 
235 #ifdef ASSERT
236   if (DebugVtables) {
237     Label L2;
238     __ cmpptr(method, (int32_t)NULL_WORD);
239     __ jcc(Assembler::equal, L2);
240     __ cmpptr(Address(method, Method::from_compiled_offset()), (int32_t)NULL_WORD);
241     __ jcc(Assembler::notZero, L2);

201                              L_no_such_interface,
202                              /*return_method=*/false);
203 
204   const ptrdiff_t  typecheckSize = __ pc() - start_pc;
205   start_pc = __ pc();
206 
207   // Get selected method from declaring class and itable index
208   const Register method = rbx;
209   __ load_klass(recv_klass_reg, j_rarg0, temp_reg);   // restore recv_klass_reg
210   __ lookup_interface_method(// inputs: rec. class, interface, itable index
211                              recv_klass_reg, holder_klass_reg, itable_index,
212                              // outputs: method, scan temp. reg
213                              method, temp_reg,
214                              L_no_such_interface);
215 
216   const ptrdiff_t  lookupSize = __ pc() - start_pc;
217 
218   // We expect we need index_dependent_slop extra bytes. Reason:
219   // The emitted code in lookup_interface_method changes when itable_index exceeds 15.
220   // For linux, a very narrow estimate would be 112, but Solaris requires some more space (130).
221   // Lilliput: expanded since load_klass is significantly and decode_klass somewhat larger.
222   const ptrdiff_t estimate = 155;
223   const ptrdiff_t codesize = typecheckSize + lookupSize + index_dependent_slop;
224   slop_delta  = (int)(estimate - codesize);
225   slop_bytes += slop_delta;
226   assert(slop_delta >= 0, "itable #%d: Code size estimate (%d) for lookup_interface_method too small, required: %d", itable_index, (int)estimate, (int)codesize);
227 
228   // If we take a trap while this arg is on the stack we will not
229   // be able to walk the stack properly. This is not an issue except
230   // when there are mistakes in this assembly code that could generate
231   // a spurious fault. Ask me how I know...
232 
233   // method (rbx): Method*
234   // j_rarg0: receiver
235 
236 #ifdef ASSERT
237   if (DebugVtables) {
238     Label L2;
239     __ cmpptr(method, (int32_t)NULL_WORD);
240     __ jcc(Assembler::equal, L2);
241     __ cmpptr(Address(method, Method::from_compiled_offset()), (int32_t)NULL_WORD);
242     __ jcc(Assembler::notZero, L2);
< prev index next >