public class SwitchTouchPointDescriptor extends TouchPointDescriptor
A SWITCH touch-point uses one more counter then distinct number destination labels (getCountersForLabelsCnt()
).
One 'internal' counterId (counterId
) is a special identifier of SWITCH statement (used in runtime), but in fact we don't expect any
incrementation of the counter. We implemented this to use a counterId because we are storing the value inside 'internal variable' and we need to be sure
that the value is connected to the last seen SWITCH statement.
We also storing a #methodName
and a #methodSignature
(consider to move this fields into TouchPointDescriptor
).
Those fields are needed to properly create instance of LineData
.
Constructor and Description |
---|
SwitchTouchPointDescriptor(int eventId,
int currentLine,
org.objectweb.asm.Label def,
org.objectweb.asm.Label[] labels,
String enum_type)
Creates o new switch-touch point.
|
Modifier and Type | Method and Description |
---|---|
int |
assignCounters(AtomicInteger idGenerator)
Every touch-point will have assigned some counters.
|
Integer |
getCounterId() |
Integer |
getCounterIdForLabel(org.objectweb.asm.Label label) |
Collection<Integer> |
getCountersForLabels() |
int |
getCountersForLabelsCnt()
Works before calling 'assignCounters'
|
String |
getEnumType() |
void |
setCounterId(Integer counterId) |
getEventId, getLineNumber, setEventId, setLineNumber
public SwitchTouchPointDescriptor(int eventId, int currentLine, org.objectweb.asm.Label def, org.objectweb.asm.Label[] labels, String enum_type)
eventId
- - eventId connected to the SWITCH instructioncurrentLine
- - line number of the switchdef
- - internal identifier of a default destination labellabels
- - table of other destination labels for different values (duplicates allowed)public Integer getCounterId()
public void setCounterId(Integer counterId)
public int assignCounters(AtomicInteger idGenerator)
TouchPointDescriptor
assignCounters
in class TouchPointDescriptor
public Integer getCounterIdForLabel(org.objectweb.asm.Label label)
public Collection<Integer> getCountersForLabels()
public int getCountersForLabelsCnt()
Works before calling 'assignCounters'
public String getEnumType()
Copyright © 2013. All Rights Reserved.