public class LinearSpaceDriver extends AbstractDriver
This class implements a simple driver for contiguous MMTk spaces such as CopySpace and ImmortalSpace.
Modifier and Type | Field and Description |
---|---|
protected int |
allTileNum |
protected ShortStream |
arrayObjectsStream |
protected ShortStream |
arrayPrimitiveStream |
protected IntStream |
arrayUsedSpaceStream |
private static boolean |
DEBUG |
protected Address |
lastAddress |
protected int |
lastSize |
protected ShortStream |
refFromImmortalStream |
protected ShortStream |
rootsStream |
protected ShortStream |
scalarObjectsStream |
protected IntStream |
scalarUsedSpaceStream |
private LinearScan |
scanner |
protected Subspace |
subspace |
protected int |
totalArrayObjects |
protected int |
totalArrayUsedSpace |
protected int |
totalPrimitives |
protected int |
totalRefFromImmortal |
protected int |
totalRoots |
protected int |
totalScalarObjects |
protected int |
totalScalarUsedSpace |
blockSize, changed, control, CONTROL_BACKGROUND, CONTROL_LINK, CONTROL_SEPARATOR, CONTROL_UNUSED, CONTROL_USED, maxTileNum, mmtkSpace, myClass, name, server, serverSpace, streams
Constructor and Description |
---|
LinearSpaceDriver(ServerInterpreter server,
String spaceName,
Space mmtkSpace,
int blockSize,
boolean mainSpace)
Create a new driver for a contiguous MMTk space.
|
Modifier and Type | Method and Description |
---|---|
private ShortStream |
createArrayObjectsStream() |
private ShortStream |
createArrayPrimitiveStream() |
private IntStream |
createArrayUsedSpaceStream() |
private ShortStream |
createRefFromImmortalStream() |
private ShortStream |
createRootsStream() |
private ShortStream |
createScalarObjectsStream() |
private IntStream |
createScalarUsedSpaceStream() |
protected String |
getDriverName()
Get the name of this driver type.
|
LinearScan |
getScanner()
BumpPointer.linearScan needs a LinearScan object, which we provide here.
|
boolean |
handleReferenceFromImmortalSpace(Address addr)
Handle a direct reference from the immortal space.
|
boolean |
handleRoot(Address addr)
Handle a root address
|
void |
resetData()
Reset the statistics for all the streams, including totals used for summaries
|
void |
resetRootsStream()
Reset the roots Stream
The roots Stream has to be reset separately because we do not
gather data in the usual way using
scan() . |
void |
scan(ObjectReference obj)
Update the tile statistics
|
void |
scan(ObjectReference obj,
boolean total)
Update the tile statistics
|
protected boolean |
scanCheckPrimitiveArray(ObjectReference obj,
int index,
boolean total,
int length)
Check if this Object is an array of primitives.
|
void |
setRange(Address start,
Address end)
Set the current address range of a contiguous space
|
protected void |
setupControlInfo()
Setup control info part of the
transmit method. |
protected void |
setupSummaries()
Setup summaries part of the
transmit method. |
void |
transmit(int event)
Transmit the data if this event is of interest to the client.
|
addControl, addStream, controlIsBackground, controlIsSeparator, controlIsUnused, controlIsUsed, controlValues, countTileNum, countTileNum, createServerSpace, createSubspace, getControl, getMaxTileNum, getServerSpace, initControl, initControls, isConnected, maxObjectsPerBlock, scan, scan, send, setControl, setRange, setSpaceInfo, setTilenames
protected IntStream scalarUsedSpaceStream
protected IntStream arrayUsedSpaceStream
protected ShortStream scalarObjectsStream
protected ShortStream arrayObjectsStream
protected ShortStream arrayPrimitiveStream
protected ShortStream rootsStream
protected ShortStream refFromImmortalStream
protected int allTileNum
protected int totalScalarObjects
protected int totalArrayObjects
protected int totalPrimitives
protected int totalScalarUsedSpace
protected int totalArrayUsedSpace
protected int totalRoots
protected int totalRefFromImmortal
private final LinearScan scanner
protected Address lastAddress
protected int lastSize
private static final boolean DEBUG
public LinearSpaceDriver(ServerInterpreter server, String spaceName, Space mmtkSpace, int blockSize, boolean mainSpace)
server
- The GCspy ServerInterpreterspaceName
- The name of this GCspy spacemmtkSpace
- The MMTk spaceblockSize
- The tile sizemainSpace
- Is this the main space?protected String getDriverName()
AbstractDriver
getDriverName
in class AbstractDriver
private IntStream createScalarUsedSpaceStream()
private IntStream createArrayUsedSpaceStream()
private ShortStream createScalarObjectsStream()
private ShortStream createArrayPrimitiveStream()
private ShortStream createArrayObjectsStream()
private ShortStream createRootsStream()
private ShortStream createRefFromImmortalStream()
public void resetData()
resetData
in class AbstractDriver
public LinearScan getScanner()
public void setRange(Address start, Address end)
setRange
in class AbstractDriver
start
- the start of the contiguous spaceend
- the end of the contiguous spacepublic void scan(ObjectReference obj)
scan
in class AbstractDriver
obj
- The current objectpublic void scan(ObjectReference obj, boolean total)
scan
in class AbstractDriver
obj
- The current objecttotal
- Whether to accumulate the valuesprotected boolean scanCheckPrimitiveArray(ObjectReference obj, int index, boolean total, int length)
obj
- The Object to checkindex
- Index of the tiletotal
- Increment summarylength
- Current size of the Object, will be added to array space summary.true
if this Object is an array of primitives.public void transmit(int event)
Implemented using the algorithm pattern, subclasses can override parts of it.
transmit
in class AbstractDriver
event
- The event, defined in the Planprotected void setupSummaries()
transmit
method.Override this method to setup summaries of additional streams in subclasses.
protected void setupControlInfo()
transmit
method.Override this method to change the controls for your own driver subclass.
public boolean handleRoot(Address addr)
addr
- Root Addresstrue
if the given Address is in this subspace.public void resetRootsStream()
scan()
.public boolean handleReferenceFromImmortalSpace(Address addr)
handleReferenceFromImmortalSpace
in class AbstractDriver
addr
- The Addresstrue
if the given Address is in this subspace.