|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.Quads.TypeInfo
public class TypeInfo
TypeInfo
is a simple type analysis tool for quad-ssi form.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface harpoon.Analysis.Maps.ExactTypeMap |
---|
ExactTypeMap.ExactType |
Nested classes/interfaces inherited from interface harpoon.Analysis.Maps.TypeMap |
---|
TypeMap.TypeNotKnownException |
Constructor Summary | |
---|---|
TypeInfo(Code hc)
Creates a TypeInfo analyzer for the specified
HCode , which must be in quad-ssi form. |
|
TypeInfo(Code hc,
UseDefMap<Quad> usedef)
Creates a TypeInfo analyzer for the specified
HCode , which must be in quad-ssi form. |
|
TypeInfo(Code hc,
UseDefMap<Quad> usedef,
boolean vBehavior)
Creates a TypeInfo analyzer for the specified
HCode , which must be in quad-ssi form. |
Method Summary | |
---|---|
boolean |
isExactType(Quad hce,
Temp t)
Returns true if temporary t defined at
definition point hce contains an object of the
type returned by typeMap(hce, t) and not
a subtype of that type. |
HClass |
typeMap(Quad hce,
Temp t)
Return the type of a given temporary t , as defined
at the definition point hce . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TypeInfo(Code hc, UseDefMap<Quad> usedef)
TypeInfo
analyzer for the specified
HCode
, which must be in quad-ssi form.
public TypeInfo(Code hc, UseDefMap<Quad> usedef, boolean vBehavior)
TypeInfo
analyzer for the specified
HCode
, which must be in quad-ssi form.
If vBehavior
is true, the TypeInfo pass's IQ drops
to the same level as a typical bytecode verifier; i.e. it gathers
no information from instanceof's and such. Because of the IQ
drop, the verifier sometimes can't determine that the operand
of an AGET is really an array; with vBehaviour
true
the TypeInfo
handles this case gracefully, rather than
failing an assertion.
public TypeInfo(Code hc)
TypeInfo
analyzer for the specified
HCode
, which must be in quad-ssi form.
Method Detail |
---|
public HClass typeMap(Quad hce, Temp t) throws TypeMap.TypeNotKnownException
TypeMap
t
, as defined
at the definition point hce
. Iff the type of the
temporary is not known, or if hce
does not define
t
, throws TypeNotKnownException
. If
the temporary represents a derived pointer, null
should be returned; in which case the Derivation
must return a non-null
value. Obviously,
TypeMap
s for high-level representations without
derived pointers should never return null
. As a
special case, HClass.Void
may be returned in
low-level IRs to indicate an opaque pointer value which does
not correspond to a java object pointer or some
derivation thereof --- for example, a pointer into a method
dispatch table. The only other time HClass.Void
should be returned is for known-null
pointer values.
typeMap
in interface TypeMap<Quad>
hce
- The HCodeElement
defining t
.t
- The temporary to examine.
t
.
TypeMap.TypeNotKnownException
- if the TypeMap
does
not have any information about t
as defined
at hc
.public boolean isExactType(Quad hce, Temp t) throws TypeMap.TypeNotKnownException
ExactTypeMap
true
if temporary t
defined at
definition point hce
contains an object of the
type returned by typeMap(hce, t)
and not
a subtype of that type. Returns false
if
the object in t
can be a subtype of the type returned
by typeMap(hce, t)
.
If typeMap()
returns a primitive type, then
isExactType()
should return true
.
isExactType
in interface ExactTypeMap<Quad>
hce
- The HCodeElement
defining t
for
this request.t
- The Temp
to examine.
true
if t
's type is exact,
false
otherwise.
TypeMap.TypeNotKnownException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |