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 */
013package org.mmtk.utility.deque;
014
015import org.mmtk.policy.RawPageSpace;
016import org.mmtk.vm.VM;
017
018import org.vmmagic.unboxed.*;
019import org.vmmagic.pragma.*;
020
021/**
022 * This class specializes SortSharedQueue to sort objects according to
023 * their time of death (TOD).
024 */
025@Uninterruptible
026public final class SortTODSharedDeque extends SortSharedDeque {
027
028  /**
029   * @param name human-readable name of the queue
030   * @param rps The space from which the instance should obtain buffers.
031   * @param arity The arity of the data to be enqueued
032   */
033  public SortTODSharedDeque(String name, RawPageSpace rps, int arity) {
034    super(name, rps, arity);
035  }
036
037  @Override
038  protected Word getKey(Address obj) {
039    return VM.traceInterface.getDeathTime(obj.toObjectReference());
040  }
041}