001    /*
002     *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003     *
004     *  This file is licensed to You under the Eclipse Public License (EPL);
005     *  You may not use this file except in compliance with the License. You
006     *  may obtain a copy of the License at
007     *
008     *      http://www.opensource.org/licenses/eclipse-1.0.php
009     *
010     *  See the COPYRIGHT.txt file distributed with this work for information
011     *  regarding copyright ownership.
012     */
013    package org.mmtk.utility.deque;
014    
015    import org.mmtk.policy.RawPageSpace;
016    import org.mmtk.vm.VM;
017    
018    import org.vmmagic.unboxed.*;
019    import org.vmmagic.pragma.*;
020    
021    /**
022     * This class specializes SortSharedQueue to sort objects according to
023     * their time of death (TOD).
024     */
025    @Uninterruptible
026    public final class SortTODSharedDeque extends SortSharedDeque {
027    
028      /**
029       * Constructor
030       *
031       * @param rps The space from which the instance should obtain buffers.
032       * @param arity The arity of the data to be enqueued
033       */
034      public SortTODSharedDeque(String name, RawPageSpace rps, int arity) {
035        super(name, rps, arity);
036      }
037    
038      @Override
039      protected Word getKey(Address obj) {
040        return VM.traceInterface.getDeathTime(obj.toObjectReference());
041      }
042    }