@@ -181,7 +181,7 @@ CompileTask* CompileTask::select_for_compilation() {
181
181
}
182
182
183
183
// Capture method holder by strong handle to avoid unloading during compilation.
184
- if (!_method_unload_blocker_weak.is_null ()) {
184
+ if (!_method_unload_blocker_weak.is_empty ()) {
185
185
assert (_method_unload_blocker_weak.peek () != nullptr , " Should not be cleared" );
186
186
assert (_method->method_holder ()->is_loader_alive (), " Should be alive" );
187
187
assert (_method_unload_blocker_strong.is_empty (), " Should be empty" );
@@ -190,7 +190,7 @@ CompileTask* CompileTask::select_for_compilation() {
190
190
191
191
// See if hot method holder is still alive. If so, capture it by strong handle.
192
192
// If not, reset it to nullptr, so downstream logging code does not crash.
193
- if (!_hot_method_unload_blocker_weak.is_null ()) {
193
+ if (!_hot_method_unload_blocker_weak.is_empty ()) {
194
194
if (_hot_method_unload_blocker_weak.peek () != nullptr ) {
195
195
assert (_hot_method->method_holder ()->is_loader_alive (), " Should be alive" );
196
196
assert (_hot_method_unload_blocker_strong.is_empty (), " Should be empty" );
@@ -216,7 +216,7 @@ void CompileTask::mark_on_stack() {
216
216
217
217
bool CompileTask::is_unloaded () const {
218
218
// Unloaded if weakly referenced blocker was set, but now had been cleared by GC.
219
- return !_method_unload_blocker_weak.is_null () && _method_unload_blocker_weak.peek () == nullptr ;
219
+ return !_method_unload_blocker_weak.is_empty () && _method_unload_blocker_weak.peek () == nullptr ;
220
220
}
221
221
222
222
// RedefineClasses support
0 commit comments