< prev index next >

src/share/vm/c1/c1_Runtime1.cpp

Print this page
rev 13280 : imported patch CollectedHeap_register_nmethod


1206             relocInfo::change_reloc_info_for_address(&iter2, (address) instr_pc2,
1207                                                      relocInfo::none, rtype);
1208           }
1209 #endif
1210           }
1211 
1212         } else {
1213           ICache::invalidate_range(copy_buff, *byte_count);
1214           NativeGeneralJump::insert_unconditional(instr_pc, being_initialized_entry);
1215         }
1216       }
1217     }
1218   }
1219 
1220   // If we are patching in a non-perm oop, make sure the nmethod
1221   // is on the right list.
1222   if (ScavengeRootsInCode) {
1223     MutexLockerEx ml_code (CodeCache_lock, Mutex::_no_safepoint_check_flag);
1224     nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
1225     guarantee(nm != NULL, "only nmethods can contain non-perm oops");
1226     if (!nm->on_scavenge_root_list() &&
1227         ((mirror.not_null() && mirror()->is_scavengable()) ||
1228          (appendix.not_null() && appendix->is_scavengable()))) {
1229       CodeCache::add_scavenge_root_nmethod(nm);
1230     }
1231 
1232     // Since we've patched some oops in the nmethod,
1233     // (re)register it with the heap.
1234     Universe::heap()->register_nmethod(nm);
1235   }
1236 JRT_END
1237 
1238 #else // DEOPTIMIZE_WHEN_PATCHING
1239 
1240 JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_id ))
1241   RegisterMap reg_map(thread, false);
1242 
1243   NOT_PRODUCT(_patch_code_slowcase_cnt++;)
1244   if (TracePatching) {
1245     tty->print_cr("Deoptimizing because patch is needed");
1246   }
1247 
1248   frame runtime_frame = thread->last_frame();
1249   frame caller_frame = runtime_frame.sender(&reg_map);
1250 




1206             relocInfo::change_reloc_info_for_address(&iter2, (address) instr_pc2,
1207                                                      relocInfo::none, rtype);
1208           }
1209 #endif
1210           }
1211 
1212         } else {
1213           ICache::invalidate_range(copy_buff, *byte_count);
1214           NativeGeneralJump::insert_unconditional(instr_pc, being_initialized_entry);
1215         }
1216       }
1217     }
1218   }
1219 
1220   // If we are patching in a non-perm oop, make sure the nmethod
1221   // is on the right list.
1222   if (ScavengeRootsInCode) {
1223     MutexLockerEx ml_code (CodeCache_lock, Mutex::_no_safepoint_check_flag);
1224     nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
1225     guarantee(nm != NULL, "only nmethods can contain non-perm oops");





1226 
1227     // Since we've patched some oops in the nmethod,
1228     // (re)register it with the heap.
1229     Universe::heap()->register_nmethod(nm);
1230   }
1231 JRT_END
1232 
1233 #else // DEOPTIMIZE_WHEN_PATCHING
1234 
1235 JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_id ))
1236   RegisterMap reg_map(thread, false);
1237 
1238   NOT_PRODUCT(_patch_code_slowcase_cnt++;)
1239   if (TracePatching) {
1240     tty->print_cr("Deoptimizing because patch is needed");
1241   }
1242 
1243   frame runtime_frame = thread->last_frame();
1244   frame caller_frame = runtime_frame.sender(&reg_map);
1245 


< prev index next >