< prev index next >

src/hotspot/cpu/x86/vtableStubs_x86_32.cpp

Print this page
rev 49011 : 8197405: Improve messages of AbstractMethodErrors and IncompatibleClassChangeErrors.
Reviewed-by: coleenp, dholmes


 195 
 196   // method (rbx): Method*
 197   // rcx: receiver
 198 
 199 #ifdef ASSERT
 200   if (DebugVtables) {
 201       Label L1;
 202       __ cmpptr(method, (int32_t)NULL_WORD);
 203       __ jcc(Assembler::equal, L1);
 204       __ cmpptr(Address(method, Method::from_compiled_offset()), (int32_t)NULL_WORD);
 205       __ jcc(Assembler::notZero, L1);
 206       __ stop("Method* is null");
 207       __ bind(L1);
 208     }
 209 #endif // ASSERT
 210 
 211   address ame_addr = __ pc();
 212   __ jmp(Address(method, Method::from_compiled_offset()));
 213 
 214   __ bind(L_no_such_interface);
 215   __ jump(RuntimeAddress(StubRoutines::throw_IncompatibleClassChangeError_entry()));





 216 
 217   __ flush();
 218 
 219   if (PrintMiscellaneous && (WizardMode || Verbose)) {
 220     tty->print_cr("itable #%d at " PTR_FORMAT "[%d] left over: %d",
 221                   itable_index, p2i(s->entry_point()),
 222                   (int)(s->code_end() - s->entry_point()),
 223                   (int)(s->code_end() - __ pc()));
 224   }
 225   guarantee(__ pc() <= s->code_end(), "overflowed buffer");
 226   // shut the door on sizing bugs
 227   int slop = 3;  // 32-bit offset is this much larger than an 8-bit one
 228   assert(itable_index > 10 || __ pc() + slop <= s->code_end(), "room for 32-bit offset");
 229 
 230   s->set_exception_points(npe_addr, ame_addr);
 231   return s;
 232 }
 233 
 234 
 235 




 195 
 196   // method (rbx): Method*
 197   // rcx: receiver
 198 
 199 #ifdef ASSERT
 200   if (DebugVtables) {
 201       Label L1;
 202       __ cmpptr(method, (int32_t)NULL_WORD);
 203       __ jcc(Assembler::equal, L1);
 204       __ cmpptr(Address(method, Method::from_compiled_offset()), (int32_t)NULL_WORD);
 205       __ jcc(Assembler::notZero, L1);
 206       __ stop("Method* is null");
 207       __ bind(L1);
 208     }
 209 #endif // ASSERT
 210 
 211   address ame_addr = __ pc();
 212   __ jmp(Address(method, Method::from_compiled_offset()));
 213 
 214   __ bind(L_no_such_interface);
 215   // Handle IncompatibleClassChangeError in itable stubs.
 216   // More detailed error message.
 217   // We force resolving of the call site by jumping to the "handle
 218   // wrong method" stub, and so let the interpreter runtime do all the
 219   // dirty work.
 220   __ jump(RuntimeAddress( SharedRuntime::get_handle_wrong_method_stub( ) ));
 221 
 222   __ flush();
 223 
 224   if (PrintMiscellaneous && (WizardMode || Verbose)) {
 225     tty->print_cr("itable #%d at " PTR_FORMAT "[%d] left over: %d",
 226                   itable_index, p2i(s->entry_point()),
 227                   (int)(s->code_end() - s->entry_point()),
 228                   (int)(s->code_end() - __ pc()));
 229   }
 230   guarantee(__ pc() <= s->code_end(), "overflowed buffer");
 231   // shut the door on sizing bugs
 232   int slop = 3;  // 32-bit offset is this much larger than an 8-bit one
 233   assert(itable_index > 10 || __ pc() + slop <= s->code_end(), "room for 32-bit offset");
 234 
 235   s->set_exception_points(npe_addr, ame_addr);
 236   return s;
 237 }
 238 
 239 
 240 


< prev index next >