< prev index next >

src/hotspot/share/code/compiledIC.cpp

Print this page




 235     assert(k->verify_itable_index(itable_index), "sanity check");
 236 #endif //ASSERT
 237     CompiledICHolder* holder = new CompiledICHolder(call_info->resolved_method()->method_holder(),
 238                                                     call_info->resolved_klass(), false);
 239     holder->claim();
 240     InlineCacheBuffer::create_transition_stub(this, holder, entry);
 241   } else {
 242     assert(call_info->call_kind() == CallInfo::vtable_call, "either itable or vtable");
 243     // Can be different than selected_method->vtable_index(), due to package-private etc.
 244     int vtable_index = call_info->vtable_index();
 245     assert(call_info->resolved_klass()->verify_vtable_index(vtable_index), "sanity check");
 246     entry = VtableStubs::find_vtable_stub(vtable_index);
 247     if (entry == NULL) {
 248       return false;
 249     }
 250     InlineCacheBuffer::create_transition_stub(this, NULL, entry);
 251   }
 252 
 253   if (TraceICs) {
 254     ResourceMark rm;

 255     tty->print_cr ("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT,
 256                    p2i(instruction_address()), call_info->selected_method()->print_value_string(), p2i(entry));
 257   }
 258 
 259   // We can't check this anymore. With lazy deopt we could have already
 260   // cleaned this IC entry before we even return. This is possible if
 261   // we ran out of space in the inline cache buffer trying to do the
 262   // set_next and we safepointed to free up space. This is a benign
 263   // race because the IC entry was complete when we safepointed so
 264   // cleaning it immediately is harmless.
 265   // assert(is_megamorphic(), "sanity check");
 266   return true;
 267 }
 268 
 269 
 270 // true if destination is megamorphic stub
 271 bool CompiledIC::is_megamorphic() const {
 272   assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");
 273   assert(!is_optimized(), "an optimized call cannot be megamorphic");
 274 




 235     assert(k->verify_itable_index(itable_index), "sanity check");
 236 #endif //ASSERT
 237     CompiledICHolder* holder = new CompiledICHolder(call_info->resolved_method()->method_holder(),
 238                                                     call_info->resolved_klass(), false);
 239     holder->claim();
 240     InlineCacheBuffer::create_transition_stub(this, holder, entry);
 241   } else {
 242     assert(call_info->call_kind() == CallInfo::vtable_call, "either itable or vtable");
 243     // Can be different than selected_method->vtable_index(), due to package-private etc.
 244     int vtable_index = call_info->vtable_index();
 245     assert(call_info->resolved_klass()->verify_vtable_index(vtable_index), "sanity check");
 246     entry = VtableStubs::find_vtable_stub(vtable_index);
 247     if (entry == NULL) {
 248       return false;
 249     }
 250     InlineCacheBuffer::create_transition_stub(this, NULL, entry);
 251   }
 252 
 253   if (TraceICs) {
 254     ResourceMark rm;
 255     assert(!call_info->selected_method().is_null(), "Unexpected null selected method");
 256     tty->print_cr ("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT,
 257                    p2i(instruction_address()), call_info->selected_method()->print_value_string(), p2i(entry));
 258   }
 259 
 260   // We can't check this anymore. With lazy deopt we could have already
 261   // cleaned this IC entry before we even return. This is possible if
 262   // we ran out of space in the inline cache buffer trying to do the
 263   // set_next and we safepointed to free up space. This is a benign
 264   // race because the IC entry was complete when we safepointed so
 265   // cleaning it immediately is harmless.
 266   // assert(is_megamorphic(), "sanity check");
 267   return true;
 268 }
 269 
 270 
 271 // true if destination is megamorphic stub
 272 bool CompiledIC::is_megamorphic() const {
 273   assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");
 274   assert(!is_optimized(), "an optimized call cannot be megamorphic");
 275 


< prev index next >