use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class ReferenceValue method processReference.
/**
* GC-time processing of the contained object.
* <p>
* Corresponds to the core of the processReference method of the MMTk ReferenceProcessor
* for the WEAK reference type.
*
* @param trace The MMTk trace
*/
public void processReference(TraceLocal trace) {
if (cleared)
return;
ObjectReference newRef = trace.getForwardedReferent(ref);
if (Trace.isEnabled(Item.REFERENCES)) {
Clock.stop();
Trace.trace(Item.REFERENCES, "Forwarded reference %x: %s reference (%s -> %s)", id, semantics, ObjectModel.getString(ref), ObjectModel.getString(newRef));
Clock.start();
}
ref = newRef;
}
use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class StackFrame method dumpRoots.
/**
* Debug printing support: dump this stack frame and return roots.
* @param width Output field width
* @return The collection of roots in this frame
*/
public Collection<ObjectReference> dumpRoots(int width) {
List<ObjectReference> roots = new ArrayList<ObjectReference>();
for (int i = 0; i < values.length; i++) {
Value value = get(i);
String name = method.getSlotName(i);
if (value != null && value instanceof ObjectValue) {
ObjectReference ref = ((ObjectValue) value).getObjectValue();
System.err.printf(" %s=%s", name, ObjectModel.formatObject(width, ref));
if (!ref.isNull())
roots.add(ref);
}
}
return roots;
}
use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class StackFrame method objectShadowMap.
/**
* @return The set of (variable,object-id) pairs
*/
@SuppressWarnings("unused")
private Map<String, Integer> objectShadowMap() {
Map<String, Integer> result = new HashMap<String, Integer>();
for (int i = 0; i < size; i++) {
if (values[i] != null && values[i] instanceof ObjectValue) {
ObjectReference obj = slotAddress(i).loadObjectReference();
result.put(method.getSlotName(i), obj.isNull() ? 0 : ObjectModel.getId(obj));
}
}
return result;
}
use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class StackFrame method objectMap.
/**
* @return The set of (variable,object-id) pairs
*/
@SuppressWarnings("unused")
private Map<String, Integer> objectMap() {
Map<String, Integer> result = new HashMap<String, Integer>();
for (int i = 0; i < size; i++) {
if (values[i] != null && values[i] instanceof ObjectValue) {
ObjectReference obj = values[i].getObjectValue();
result.put(method.getSlotName(i), obj.isNull() ? 0 : ObjectModel.getId(obj));
}
}
return result;
}
use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class Env method dumpThreadRoots.
/**
* Print the thread roots and add them to a stack for processing.
*/
@Override
public Collection<ObjectReference> dumpThreadRoots(int width) {
int frameId = 0;
List<ObjectReference> roots = new ArrayList<ObjectReference>();
for (StackFrame frame : stack) {
System.err.printf(" Frame %5d [", frameId++);
roots.addAll(frame.dumpRoots(width));
System.err.println(" ]");
}
System.err.println();
return roots;
}
Aggregations