org.jikesrvm.compilers.baseline
Class SwitchBranchProfile

java.lang.Object
  extended by org.jikesrvm.compilers.baseline.BranchProfile
      extended by org.jikesrvm.compilers.baseline.SwitchBranchProfile

public final class SwitchBranchProfile
extends BranchProfile

Profile data for a branch instruction.


Field Summary
(package private)  float[] counts
          The number of times that the different arms of a switch were taken.
 
Fields inherited from class org.jikesrvm.compilers.baseline.BranchProfile
bci, freq
 
Constructor Summary
SwitchBranchProfile(int _bci, int[] cs, int start, int numEntries)
           
 
Method Summary
 float getCaseProbability(int n)
           
 float getDefaultProbability()
           
(package private)  float getProbability(int n)
           
private static float sumCounts(int[] counts, int start, int numEntries)
           
 String toString()
           
 
Methods inherited from class org.jikesrvm.compilers.baseline.BranchProfile
getBytecodeIndex, getFrequency
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

counts

final float[] counts
The number of times that the different arms of a switch were taken. By convention, the default case is the last entry.

Constructor Detail

SwitchBranchProfile

SwitchBranchProfile(int _bci,
                    int[] cs,
                    int start,
                    int numEntries)
Parameters:
_bci - the bytecode index of the source branch instruction
cs - counts
start - idx of first entry in cs
numEntries - number of entries in cs for this switch
Method Detail

getDefaultProbability

public float getDefaultProbability()

getCaseProbability

public float getCaseProbability(int n)

getProbability

float getProbability(int n)

toString

public String toString()
Overrides:
toString in class Object

sumCounts

private static float sumCounts(int[] counts,
                               int start,
                               int numEntries)