src/hotspot/share/jvmci/jvmciRuntime.cpp
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File open Sdiff src/hotspot/share/jvmci

src/hotspot/share/jvmci/jvmciRuntime.cpp

Print this page




 292       HandleRecord* handle = &(current->_handles)[index];
 293       Metadata* value = handle->handle();
 294       // traverse heap pointers only, not deleted handles or free list
 295       // pointers
 296       if (value != NULL && ((intptr_t) value & ptr_tag) == 0) {
 297         Klass* klass = NULL;
 298         if (value->is_klass()) {
 299           klass = (Klass*)value;
 300         } else if (value->is_method()) {
 301           Method* m = (Method*)value;
 302           klass = m->method_holder();
 303         } else if (value->is_constantPool()) {
 304           ConstantPool* cp = (ConstantPool*)value;
 305           klass = cp->pool_holder();
 306         } else {
 307           ShouldNotReachHere();
 308         }
 309         if (klass->class_loader_data()->is_unloading()) {
 310           // This needs to be marked so that it's no longer scanned
 311           // but can't be put on the free list yet. The
 312           // ReferenceCleaner will set this to NULL and
 313           // put it on the free list.
 314           jlong old_value = Atomic::cmpxchg((jlong) (ptr_tag), (jlong*)handle, (jlong) value);
 315           if (old_value == (jlong) value) {
 316             // Success
 317           } else {
 318             guarantee(old_value == 0, "only other possible value");
 319           }
 320         }
 321       }
 322     }
 323     // the next handle block is valid only if current block is full
 324     if (current->_top < block_size_in_handles) {
 325       break;
 326     }
 327   }
 328 }
 329 
 330 JNIHandleBlock* JVMCI::_object_handles = NULL;
 331 MetadataHandleBlock* JVMCI::_metadata_handles = NULL;
 332 JVMCIRuntime* JVMCI::_compiler_runtime = NULL;




 292       HandleRecord* handle = &(current->_handles)[index];
 293       Metadata* value = handle->handle();
 294       // traverse heap pointers only, not deleted handles or free list
 295       // pointers
 296       if (value != NULL && ((intptr_t) value & ptr_tag) == 0) {
 297         Klass* klass = NULL;
 298         if (value->is_klass()) {
 299           klass = (Klass*)value;
 300         } else if (value->is_method()) {
 301           Method* m = (Method*)value;
 302           klass = m->method_holder();
 303         } else if (value->is_constantPool()) {
 304           ConstantPool* cp = (ConstantPool*)value;
 305           klass = cp->pool_holder();
 306         } else {
 307           ShouldNotReachHere();
 308         }
 309         if (klass->class_loader_data()->is_unloading()) {
 310           // This needs to be marked so that it's no longer scanned
 311           // but can't be put on the free list yet. The
 312           // HandleCleaner will set this to NULL and
 313           // put it on the free list.
 314           jlong old_value = Atomic::cmpxchg((jlong) (ptr_tag), (jlong*)handle, (jlong) value);
 315           if (old_value == (jlong) value) {
 316             // Success
 317           } else {
 318             guarantee(old_value == 0, "only other possible value");
 319           }
 320         }
 321       }
 322     }
 323     // the next handle block is valid only if current block is full
 324     if (current->_top < block_size_in_handles) {
 325       break;
 326     }
 327   }
 328 }
 329 
 330 JNIHandleBlock* JVMCI::_object_handles = NULL;
 331 MetadataHandleBlock* JVMCI::_metadata_handles = NULL;
 332 JVMCIRuntime* JVMCI::_compiler_runtime = NULL;


src/hotspot/share/jvmci/jvmciRuntime.cpp
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File