src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java
changeset 50858 2d3e99a72541
parent 47216 71c04702a3d5
child 51420 6bb7b8d0da76
equal deleted inserted replaced
50857:a9938374a9f4 50858:2d3e99a72541
    42  * completes the wrapper object is registered here and will be scanned during metadata scanning. The
    42  * completes the wrapper object is registered here and will be scanned during metadata scanning. The
    43  * weakness of the reference to the wrapper object allows them to be reclaimed when they are no
    43  * weakness of the reference to the wrapper object allows them to be reclaimed when they are no
    44  * longer used.
    44  * longer used.
    45  *
    45  *
    46  */
    46  */
    47 public class HotSpotJVMCIMetaAccessContext {
    47 class HotSpotJVMCIMetaAccessContext {
    48 
    48 
    49     /**
    49     /**
    50      * The set of currently live contexts used for tracking of live metadata. Examined from the VM
    50      * The set of currently live contexts used for tracking of live metadata. Examined from the VM
    51      * during garbage collection.
    51      * during garbage collection.
    52      */
    52      */
   205 
   205 
   206         Object[] getHead() {
   206         Object[] getHead() {
   207             return head;
   207             return head;
   208         }
   208         }
   209 
   209 
       
   210         @Override
   210         public Iterator<T> iterator() {
   211         public Iterator<T> iterator() {
   211             return new ChunkIterator<>();
   212             return new ChunkIterator<>();
   212         }
   213         }
   213 
   214 
   214         int size() {
   215         int size() {
   242                     result = (V) currentChunk[currentIndex];
   243                     result = (V) currentChunk[currentIndex];
   243                 } while (result == null);
   244                 } while (result == null);
   244                 return result;
   245                 return result;
   245             }
   246             }
   246 
   247 
       
   248             @Override
   247             public boolean hasNext() {
   249             public boolean hasNext() {
   248                 return next != null;
   250                 return next != null;
   249             }
   251             }
   250 
   252 
       
   253             @Override
   251             public V next() {
   254             public V next() {
   252                 V result = next;
   255                 V result = next;
   253                 next = findNext();
   256                 next = findNext();
   254                 return result;
   257                 return result;
   255             }
   258             }