|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.SizeOpt.ConstructorClassifier
public class ConstructorClassifier
The ConstructorClassifier
class takes a look at
constructor invocations and determines whether we can do one
of several 'mostly-zero field' transformations.
Constructor Summary | |
---|---|
ConstructorClassifier(HCodeFactory hcf,
ClassHierarchy ch)
Creates a ConstructorClassifier . |
Method Summary | |
---|---|
Object |
constantValue(HMethod constructor,
HField hf)
Returns the constant value which field hf is
set to whenever the given constructor is executed. |
boolean |
isConstant(HMethod constructor,
HField hf)
Returns true iff the given field hf
is always set to a constant value when the given constructor
is executed. |
boolean |
isGood(HField hf)
Returns true iff the given field is 'subclass-final'
and there is at least one callable constructor where the field's
content can be predicted. |
boolean |
isGood(HMethod constructor)
Returns true iff there is at least one field whose
value can be predicted when this constructor is called. |
boolean |
isParam(HMethod constructor,
HField hf)
Returns true iff the given field hf
is always set to the same value as one of the constructor's
parameters whenever it is executed. |
int |
paramNumber(HMethod constructor,
HField hf)
Returns the number of the parameter (starting at 0) which holds the value which hf will be set to whenever
the given constructor is executed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConstructorClassifier(HCodeFactory hcf, ClassHierarchy ch)
ConstructorClassifier
.
Method Detail |
---|
public boolean isGood(HField hf)
true
iff the given field is 'subclass-final'
and there is at least one callable constructor where the field's
content can be predicted.
public boolean isGood(HMethod constructor)
true
iff there is at least one field whose
value can be predicted when this constructor is called.
public boolean isConstant(HMethod constructor, HField hf)
true
iff the given field hf
is always set to a constant value when the given constructor
is executed.
public Object constantValue(HMethod constructor, HField hf)
hf
is
set to whenever the given constructor is executed. Requires
that isConstant(constructor,hf)
be true
.
public boolean isParam(HMethod constructor, HField hf)
true
iff the given field hf
is always set to the same value as one of the constructor's
parameters whenever it is executed.
public int paramNumber(HMethod constructor, HField hf)
hf
will be set to whenever
the given constructor is executed. Requires that
isParam(constructor, hf
be true
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |