Пример #1
0
 /**
  * Given a slot (ie the address of an ObjectReference), ensure that the referent will not move for
  * the rest of the GC. This is achieved by calling the precopyObject method.
  *
  * @param slot The slot to check
  */
 @Inline
 public final void processPrecopyEdge(Address slot) {
   ObjectReference child = slot.loadObjectReference();
   if (!child.isNull()) {
     child = precopyObject(child);
     slot.store(child);
   }
 }
Пример #2
0
 /**
  * Trace a reference during GC. This involves determining which collection policy applies and
  * calling the appropriate <code>trace</code> method.
  *
  * @param target The object the interior edge points within.
  * @param slot The location of the interior edge.
  * @param root True if this is a root edge.
  */
 public final void processInteriorEdge(ObjectReference target, Address slot, boolean root) {
   Address interiorRef = slot.loadAddress();
   Offset offset = interiorRef.diff(target.toAddress());
   ObjectReference newTarget = traceObject(target, root);
   if (VM.VERIFY_ASSERTIONS) {
     if (offset.sLT(Offset.zero()) || offset.sGT(Offset.fromIntSignExtend(1 << 24))) {
       // There is probably no object this large
       Log.writeln("ERROR: Suspiciously large delta to interior pointer");
       Log.write("       object base = ");
       Log.writeln(target);
       Log.write("       interior reference = ");
       Log.writeln(interiorRef);
       Log.write("       delta = ");
       Log.writeln(offset);
       VM.assertions._assert(false);
     }
   }
   slot.store(newTarget.toAddress().plus(offset));
 }
Пример #3
0
 /**
  * Trace a reference during GC. This involves determining which collection policy applies and
  * calling the appropriate <code>trace</code> method.
  *
  * @param source The source of the reference.
  * @param slot The location containing the object reference to be traced. The object reference is
  *     <i>NOT</i> an interior pointer.
  * @param root True if <code>objLoc</code> is within a root.
  */
 @Inline
 public final void processEdge(ObjectReference source, Address slot) {
   ObjectReference object = slot.loadObjectReference();
   ObjectReference newObject = traceObject(object, false);
   slot.store(newObject);
 }
Пример #4
0
 /**
  * Trace a reference during GC. This involves determining which collection policy applies and
  * calling the appropriate <code>trace</code> method.
  *
  * @param slot The location containing the object reference to be traced. The object reference is
  *     <i>NOT</i> an interior pointer.
  * @param root True if <code>objLoc</code> is within a root.
  */
 @Inline
 public final void processRootEdge(Address slot) {
   ObjectReference object = slot.loadObjectReference();
   ObjectReference newObject = traceObject(object, true);
   slot.store(newObject);
 }