org.jikesrvm.compilers.opt
Class FieldAnalysis

java.lang.Object
  extended by org.jikesrvm.compilers.opt.driver.CompilerPhase
      extended by org.jikesrvm.compilers.opt.FieldAnalysis

public final class FieldAnalysis
extends CompilerPhase

Flow-insensitive, context-insensitive, interprocedural analysis of fields.


Field Summary
private static FieldDatabase db
          The backing store
private static boolean DEBUG
           
 
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase
container
 
Constructor Summary
FieldAnalysis()
           
 
Method Summary
static TypeReference getConcreteType(RVMField f)
          Have we determined a single concrete type for a field?
 String getName()
           
private static boolean isCandidate(TypeReference tref)
          Is a type a candidate for type analysis?
private static boolean isTrouble(RVMField f)
          For some special classes, the flow-insensitive summaries are INCORRECT due to using the wrong implementation during boot image writing.
 CompilerPhase newExecution(IR ir)
          Return this instance of this phase.
 void perform(IR ir)
          Record field analysis information for an IR.
private static void recordBottom(RVMMethod m, RVMField f)
          Record that a method writes an unknown concrete type to a field.
private static void recordConcreteType(RVMMethod m, RVMField f, TypeReference t)
          Record that a method stores an object of a particular concrete type to a field.
 boolean shouldPerform(OptOptions options)
          This method determines if the phase should be run, based on the Options object it is passed.
 
Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase
dumpIR, dumpIR, getClassConstructor, getCompilerPhaseConstructor, getCompilerPhaseConstructor, performPhase, printingEnabled, reportAdditionalStats, setContainer, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

db

private static final FieldDatabase db
The backing store

Constructor Detail

FieldAnalysis

public FieldAnalysis()
Method Detail

newExecution

public CompilerPhase newExecution(IR ir)
Return this instance of this phase. This phase contains no per-compilation instance fields.

Overrides:
newExecution in class CompilerPhase
Parameters:
ir - not used
Returns:
this

shouldPerform

public boolean shouldPerform(OptOptions options)
Description copied from class: CompilerPhase
This method determines if the phase should be run, based on the Options object it is passed. By default, phases are always performed. Subclasses should override this method if they only want to be performed conditionally.

Overrides:
shouldPerform in class CompilerPhase
Parameters:
options - the compiler options for the compilation
Returns:
true if the phase should be performed

getName

public String getName()
Specified by:
getName in class CompilerPhase
Returns:
a String which is the name of the phase.

isCandidate

private static boolean isCandidate(TypeReference tref)
Is a type a candidate for type analysis?

NO iff:


getConcreteType

public static TypeReference getConcreteType(RVMField f)
Have we determined a single concrete type for a field? If so, return the concrete type. Else, return null.


perform

public void perform(IR ir)
Record field analysis information for an IR.

Specified by:
perform in class CompilerPhase
Parameters:
ir - the governing IR

recordBottom

private static void recordBottom(RVMMethod m,
                                 RVMField f)
Record that a method writes an unknown concrete type to a field.


recordConcreteType

private static void recordConcreteType(RVMMethod m,
                                       RVMField f,
                                       TypeReference t)
Record that a method stores an object of a particular concrete type to a field.


isTrouble

private static boolean isTrouble(RVMField f)
For some special classes, the flow-insensitive summaries are INCORRECT due to using the wrong implementation during boot image writing. For these special cases, give up. TODO: work around this by recomputing the summary at runtime?