org.jacoco.core.internal.flow
Class LabelInfo

java.lang.Object
  extended by org.jacoco.core.internal.flow.LabelInfo

public final class LabelInfo
extends Object

Data container that is attached to Label.info objects to store flow and instrumentation specific information. The information is only valid locally in specific contexts.


Field Summary
static int NO_PROBE
          Reserved ID for "no probe".
 
Method Summary
static Instruction getInstruction(org.objectweb.asm.Label label)
          Returns the corresponding instruction for the given label if one has been defined.
static org.objectweb.asm.Label getIntermediateLabel(org.objectweb.asm.Label label)
          Returns the intermediate label for the given label if one has been defined.
static int getProbeId(org.objectweb.asm.Label label)
          Returns the assigned probe id.
static boolean isDone(org.objectweb.asm.Label label)
          Checks whether this label is marked as done.
static boolean isMultiTarget(org.objectweb.asm.Label label)
          Checks whether multiple control paths lead to a label.
static boolean isSuccessor(org.objectweb.asm.Label label)
          Checks whether this label is the possible successor of the previous instruction in the method.
static void resetDone(org.objectweb.asm.Label label)
          Resets the "done" status of a given label.
static void resetDone(org.objectweb.asm.Label[] labels)
          Resets the "done" status of all given labels.
static void setDone(org.objectweb.asm.Label label)
          Mark a given label as done.
static void setInstruction(org.objectweb.asm.Label label, Instruction instruction)
          Sets the instruction corresponding to this label.
static void setIntermediateLabel(org.objectweb.asm.Label label, org.objectweb.asm.Label intermediate)
          Defines an intermediate label for the given label.
static void setProbeId(org.objectweb.asm.Label label, int id)
          Sets the given probe id to the given label.
static void setSuccessor(org.objectweb.asm.Label label)
          Defines that the given label is the possible successor of the previous instruction in the method.
static void setTarget(org.objectweb.asm.Label label)
          Defines that the given label is a jump target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_PROBE

public static final int NO_PROBE
Reserved ID for "no probe".

See Also:
Constant Field Values
Method Detail

setTarget

public static void setTarget(org.objectweb.asm.Label label)
Defines that the given label is a jump target.

Parameters:
label - label to define

setSuccessor

public static void setSuccessor(org.objectweb.asm.Label label)
Defines that the given label is the possible successor of the previous instruction in the method.

Parameters:
label - label to define

isMultiTarget

public static boolean isMultiTarget(org.objectweb.asm.Label label)
Checks whether multiple control paths lead to a label. Control flow path to a certain label are: jump targets, exception handlers and normal control flow from its predecessor instruction (unless this a unconditional jump or method exit).

Parameters:
label - label to check
Returns:
true if the given multiple control paths lead to the given label

isSuccessor

public static boolean isSuccessor(org.objectweb.asm.Label label)
Checks whether this label is the possible successor of the previous instruction in the method. This is the case if the predecessor isn't a unconditional jump or method exit instruction.

Parameters:
label - label to check
Returns:
true if the label is a possible instruction successor

setDone

public static void setDone(org.objectweb.asm.Label label)
Mark a given label as done.

Parameters:
label - label to mark

resetDone

public static void resetDone(org.objectweb.asm.Label label)
Resets the "done" status of a given label.

Parameters:
label - label to reset

resetDone

public static void resetDone(org.objectweb.asm.Label[] labels)
Resets the "done" status of all given labels.

Parameters:
labels - labels to reset

isDone

public static boolean isDone(org.objectweb.asm.Label label)
Checks whether this label is marked as done.

Parameters:
label - label to check
Returns:
true if this label is marked as done

setProbeId

public static void setProbeId(org.objectweb.asm.Label label,
                              int id)
Sets the given probe id to the given label.

Parameters:
label - label to assign a probe to
id - id of the probe

getProbeId

public static int getProbeId(org.objectweb.asm.Label label)
Returns the assigned probe id.

Parameters:
label - label to check
Returns:
probe id or NO_PROBE if no probe is assigned to the label

setIntermediateLabel

public static void setIntermediateLabel(org.objectweb.asm.Label label,
                                        org.objectweb.asm.Label intermediate)
Defines an intermediate label for the given label. Such intermediate labels are required during instrumentation to add probes to jump targets.

Parameters:
label - label to define for
intermediate - intermediate label

getIntermediateLabel

public static org.objectweb.asm.Label getIntermediateLabel(org.objectweb.asm.Label label)
Returns the intermediate label for the given label if one has been defined.

Parameters:
label - label to look for
Returns:
intermediate label or null

setInstruction

public static void setInstruction(org.objectweb.asm.Label label,
                                  Instruction instruction)
Sets the instruction corresponding to this label.

Parameters:
label - label to set the instruction for
instruction - corresponding instruction

getInstruction

public static Instruction getInstruction(org.objectweb.asm.Label label)
Returns the corresponding instruction for the given label if one has been defined.

Parameters:
label - label to look for
Returns:
corresponding instruction or null


Copyright © 2009-2011 Mountainminds GmbH & Co. KG. All Rights Reserved.