< prev index next >

src/hotspot/share/code/nmethod.cpp

Print this page
rev 56098 : imported patch 8226705-8221734-baseline
rev 56099 : imported patch 8226705-rebase


1263       } else {
1264         xtty->begin_elem("make_not_entrant thread='" UINTX_FORMAT "'%s",
1265                          os::current_thread_id(),
1266                          (_state == zombie ? " zombie='1'" : ""));
1267       }
1268       log_identity(xtty);
1269       xtty->stamp();
1270       xtty->end_elem();
1271     }
1272   }
1273 
1274   const char *state_msg = _state == zombie ? "made zombie" : "made not entrant";
1275   CompileTask::print_ul(this, state_msg);
1276   if (PrintCompilation && _state != unloaded) {
1277     print_on(tty, state_msg);
1278   }
1279 }
1280 
1281 void nmethod::unlink_from_method() {
1282   if (method() != NULL) {
1283     method()->unlink_code();
1284   }
1285 }
1286 
1287 /**
1288  * Common functionality for both make_not_entrant and make_zombie
1289  */
1290 bool nmethod::make_not_entrant_or_zombie(int state) {
1291   assert(state == zombie || state == not_entrant, "must be zombie or not_entrant");
1292   assert(!is_zombie(), "should not already be a zombie");
1293 
1294   if (Atomic::load(&_state) >= state) {
1295     // Avoid taking the lock if already in required state.
1296     // This is safe from races because the state is an end-state,
1297     // which the nmethod cannot back out of once entered.
1298     // No need for fencing either.
1299     return false;
1300   }
1301 
1302   // Make sure neither the nmethod nor the method is flushed in case of a safepoint in code below.
1303   nmethodLocker nml(this);




1263       } else {
1264         xtty->begin_elem("make_not_entrant thread='" UINTX_FORMAT "'%s",
1265                          os::current_thread_id(),
1266                          (_state == zombie ? " zombie='1'" : ""));
1267       }
1268       log_identity(xtty);
1269       xtty->stamp();
1270       xtty->end_elem();
1271     }
1272   }
1273 
1274   const char *state_msg = _state == zombie ? "made zombie" : "made not entrant";
1275   CompileTask::print_ul(this, state_msg);
1276   if (PrintCompilation && _state != unloaded) {
1277     print_on(tty, state_msg);
1278   }
1279 }
1280 
1281 void nmethod::unlink_from_method() {
1282   if (method() != NULL) {
1283     method()->unlink_code(this);
1284   }
1285 }
1286 
1287 /**
1288  * Common functionality for both make_not_entrant and make_zombie
1289  */
1290 bool nmethod::make_not_entrant_or_zombie(int state) {
1291   assert(state == zombie || state == not_entrant, "must be zombie or not_entrant");
1292   assert(!is_zombie(), "should not already be a zombie");
1293 
1294   if (Atomic::load(&_state) >= state) {
1295     // Avoid taking the lock if already in required state.
1296     // This is safe from races because the state is an end-state,
1297     // which the nmethod cannot back out of once entered.
1298     // No need for fencing either.
1299     return false;
1300   }
1301 
1302   // Make sure neither the nmethod nor the method is flushed in case of a safepoint in code below.
1303   nmethodLocker nml(this);


< prev index next >