org.jikesrvm.adaptive.util
Class CompilerAdviceAttribute

java.lang.Object
  extended by org.jikesrvm.adaptive.util.CompilerAdviceAttribute

public class CompilerAdviceAttribute
extends Object

Defines an attribute for compiler advice, and maintains a map allowing attributes to be retrieved by method and bytecode offset.

Each attribute encodes an compiler site and the advice for that site:

See Also:
CompilerAdvice, CompilerAdviceInfoReader

Field Summary
private static HashMap<CompilerAdviceAttribute,CompilerAdviceAttribute> attribMap
           
private  Atom className
           
private  int compiler
           
private static CompilerAdviceAttribute defaultAttr
           
private static boolean hasAdvice
           
private  Atom methodName
           
private  Atom methodSig
           
private  int optLevel
           
private static CompilerAdviceAttribute tempAttr
           
 
Constructor Summary
CompilerAdviceAttribute(Atom className, Atom methodName, Atom methodSig, int compiler)
          Constructor
CompilerAdviceAttribute(Atom className, Atom methodName, Atom methodSig, int compiler, int optLevel)
          Constructor
 
Method Summary
 boolean equals(Object obj)
           
 Atom getClassName()
          Getter method for class name
 int getCompiler()
          Getter method for compiler ID
static CompilerAdviceAttribute getCompilerAdviceInfo(RVMMethod method)
          Given a method and bytecode offset, return an compiler advice attribute or null if none is found for that method and offset.
 Atom getMethodName()
          Getter method for method name
 Atom getMethodSig()
          Getter method for method signature
 int getOptLevel()
          Getter method for optimization level
static boolean hasAdvice()
           
 int hashCode()
           
static void postBoot()
          Initialization of key compiler advice data structure.
static void registerCompilerAdvice(List<CompilerAdviceAttribute> compilerAdviceList)
          Use a list of compiler advice attributes to create an advice map keyed on RVMMethod instances.
 String toString()
          Stringify this instance
static Collection<CompilerAdviceAttribute> values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

attribMap

private static HashMap<CompilerAdviceAttribute,CompilerAdviceAttribute> attribMap

defaultAttr

private static CompilerAdviceAttribute defaultAttr

tempAttr

private static CompilerAdviceAttribute tempAttr

hasAdvice

private static boolean hasAdvice

className

private Atom className

methodName

private Atom methodName

methodSig

private Atom methodSig

compiler

private int compiler

optLevel

private int optLevel
Constructor Detail

CompilerAdviceAttribute

public CompilerAdviceAttribute(Atom className,
                               Atom methodName,
                               Atom methodSig,
                               int compiler)
Constructor

Parameters:
className - The name of the class for the compiler site
methodName - The name of the method for the compiler site
methodSig - The signature of the method for the compiler site
compiler - The ID of the compiler to use for this method
See Also:
CompilerAdviceInfoReader

CompilerAdviceAttribute

public CompilerAdviceAttribute(Atom className,
                               Atom methodName,
                               Atom methodSig,
                               int compiler,
                               int optLevel)
Constructor

Parameters:
className - The name of the class for the compiler site
methodName - The name of the method for the compiler site
methodSig - The signature of the method for the compiler site
compiler - The ID of the compiler to use for this method
optLevel - The optimization level if using Opt compiler
See Also:
CompilerAdviceInfoReader
Method Detail

postBoot

public static void postBoot()
Initialization of key compiler advice data structure.


getClassName

public Atom getClassName()
Getter method for class name

Returns:
the class name for this attribute

getMethodName

public Atom getMethodName()
Getter method for method name

Returns:
the method name for this attribute

getMethodSig

public Atom getMethodSig()
Getter method for method signature

Returns:
the method signature for this attribute

getCompiler

public int getCompiler()
Getter method for compiler ID

Returns:
the compiler ID for this attribute

getOptLevel

public int getOptLevel()
Getter method for optimization level

Returns:
the optimization level for this attribute

toString

public String toString()
Stringify this instance

Overrides:
toString in class Object
Returns:
The state of this instance expressed as a string

registerCompilerAdvice

public static void registerCompilerAdvice(List<CompilerAdviceAttribute> compilerAdviceList)
Use a list of compiler advice attributes to create an advice map keyed on RVMMethod instances. This map is used by getCompilerAdviceInfo().

Parameters:
compilerAdviceList - A list of compiler advice attributes
See Also:
getCompilerAdviceInfo(org.jikesrvm.classloader.RVMMethod)

getCompilerAdviceInfo

public static CompilerAdviceAttribute getCompilerAdviceInfo(RVMMethod method)
Given a method and bytecode offset, return an compiler advice attribute or null if none is found for that method and offset.

Parameters:
method - The method containing the site in question
Returns:
Attribute advice for that site or null if none is found.

values

public static Collection<CompilerAdviceAttribute> values()

hasAdvice

public static boolean hasAdvice()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object