Top Description Fields Constructors Methods
org.droidparts.dexmaker.dx.ssa

public final Class NormalSsaInsn

extends SsaInsn
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
org.droidparts.dexmaker.dx.rop.code.*

A "normal" (non-phi) instruction in SSA form. Always wraps a rop insn.

Field Summary

Modifier and TypeField and Description
private Insn
insn

non-null; rop insn that we're wrapping

Constructor Summary

AccessConstructor and Description
pack-priv
NormalSsaInsn(final Insn
Rop insn to wrap
insn
,
final SsaBasicBlock
block that contains this insn
block
)

Creates an instance.

Method Summary

Modifier and TypeMethod and Description
public void
accept(SsaInsn.Visitor
non-null the visitor
v
)

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.accept.

Accepts a visitor.
public boolean
public final void
changeOneSource(int
>=0; index of source to change
index
,
RegisterSpec
spec for new source
newSpec
)

Changes one of the insn's sources.

public NormalSsaInsn
clone()

Overrides org.droidparts.dexmaker.dx.ssa.SsaInsn.clone.

Creates and returns a copy of this object.
public RegisterSpec
getLocalAssignment()

Overrides org.droidparts.dexmaker.dx.ssa.SsaInsn.getLocalAssignment.

Gets the spec of a local variable assignment that occurs at this instruction, or null if no local variable assignment occurs.
public Rop

Returns:

the Rop opcode for this insn
getOpcode
()

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.getOpcode.

Returns the Rop opcode for this insn, or null if this is a phi insn.
public Insn
getOriginalRopInsn()

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.getOriginalRopInsn.

Returns the original Rop insn for this insn, or null if this is a phi insn.
public RegisterSpecList

Returns:

null-ok; sources list
getSources
()

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.getSources.

Like rop.Insn.getSources().
public boolean
hasSideEffect()

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.hasSideEffect.

Returns true if this insn is considered to have a side effect beyond that of assigning to the result reg.

Todo

Increase the scope of this.

public boolean
public boolean

Returns:

true if this is a move (but not a move-operand) instruction
isNormalMoveInsn
()

Overrides org.droidparts.dexmaker.dx.ssa.SsaInsn.isNormalMoveInsn.

public boolean
public final void
mapSourceRegisters(RegisterMapper
new mapping
mapper
)

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.mapSourceRegisters.

Maps only source registers.
public final void
setNewSources(RegisterSpecList
non-null new sources list.
newSources
)

Changes the source list of the insn.

public String
toHuman()

Implements org.droidparts.dexmaker.dx.util.ToHuman.toHuman.

Return the "human" string form of this instance.
public Insn
toRopInsn()

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.toRopInsn.

Transform back to ROP form.
public void
upgradeToLiteral()

Upgrades this insn to a version that represents the constant source literally.

Inherited from org.droidparts.dexmaker.dx.ssa.SsaInsn:
changeResultReggetBlockgetResultisRegASourceisResultRegmakeFromRopmapRegisterssetResultsetResultLocal

Field Detail

insnback to summary
private Insn insn

non-null; rop insn that we're wrapping

Constructor Detail

NormalSsaInsnback to summary
pack-priv NormalSsaInsn(final Insn insn, final SsaBasicBlock block)

Creates an instance.

Parameters
insn:Insn

Rop insn to wrap

block:SsaBasicBlock

block that contains this insn

Method Detail

acceptback to summary
public void accept(SsaInsn.Visitor v)

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.accept.

Doc from org.droidparts.dexmaker.dx.ssa.SsaInsn.accept.

Accepts a visitor.

Parameters
v:SsaInsn.Visitor

non-null the visitor

Annotations
@Override
canThrowback to summary
public boolean canThrow()

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.canThrow.

Returns:boolean

Doc from org.droidparts.dexmaker.dx.ssa.SsaInsn.canThrow.

true if this instruction can throw.

Annotations
@Override
changeOneSourceback to summary
public final void changeOneSource(int index, RegisterSpec newSpec)

Changes one of the insn's sources. New source should be of same type and category.

Parameters
index:int

>=0; index of source to change

newSpec:RegisterSpec

spec for new source

cloneback to summary
public NormalSsaInsn clone()

Overrides org.droidparts.dexmaker.dx.ssa.SsaInsn.clone.

Doc from org.droidparts.dexmaker.dx.ssa.SsaInsn.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:NormalSsaInsn

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
getLocalAssignmentback to summary
public RegisterSpec getLocalAssignment()

Overrides org.droidparts.dexmaker.dx.ssa.SsaInsn.getLocalAssignment.

Doc from org.droidparts.dexmaker.dx.ssa.SsaInsn.getLocalAssignment.

Gets the spec of a local variable assignment that occurs at this instruction, or null if no local variable assignment occurs. This may be the result register, or for mark-local insns it may be the source.

Returns:RegisterSpec

null-ok; a local-associated register spec or null

Annotations
@Override
getOpcodeback to summary
public Rop getOpcode()

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.getOpcode.

Doc from org.droidparts.dexmaker.dx.ssa.SsaInsn.getOpcode.

Returns the Rop opcode for this insn, or null if this is a phi insn.

Todo

Move this up into NormalSsaInsn.

Returns:Rop

the Rop opcode for this insn

Annotations
@Override
getOriginalRopInsnback to summary
public Insn getOriginalRopInsn()

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.getOriginalRopInsn.

Doc from org.droidparts.dexmaker.dx.ssa.SsaInsn.getOriginalRopInsn.

Returns the original Rop insn for this insn, or null if this is a phi insn.

Todo

Move this up into NormalSsaInsn.

Returns:Insn

null-ok; Rop insn if there is one.

Annotations
@Override
getSourcesback to summary
public RegisterSpecList getSources()

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.getSources.

Like rop.Insn.getSources().

Returns:RegisterSpecList

null-ok; sources list

Annotations
@Override
hasSideEffectback to summary
public boolean hasSideEffect()

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.hasSideEffect.

Doc from org.droidparts.dexmaker.dx.ssa.SsaInsn.hasSideEffect.

Returns true if this insn is considered to have a side effect beyond that of assigning to the result reg.

Todo

Increase the scope of this.

Returns:boolean

true if this insn is considered to have a side effect beyond that of assigning to the result reg.

Annotations
@Override
isMoveExceptionback to summary
public boolean isMoveException()

Overrides org.droidparts.dexmaker.dx.ssa.SsaInsn.isMoveException.

Returns:boolean

Doc from org.droidparts.dexmaker.dx.ssa.SsaInsn.isMoveException.

true if this is a move-exception instruction. These instructions must immediately follow a preceeding invoke*

Annotations
@Override
isNormalMoveInsnback to summary
public boolean isNormalMoveInsn()

Overrides org.droidparts.dexmaker.dx.ssa.SsaInsn.isNormalMoveInsn.

Returns:boolean

true if this is a move (but not a move-operand) instruction

Annotations
@Override
isPhiOrMoveback to summary
public boolean isPhiOrMove()

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.isPhiOrMove.

Returns:boolean

Doc from org.droidparts.dexmaker.dx.ssa.SsaInsn.isPhiOrMove.

true if this is a PhiInsn or a normal move insn

Annotations
@Override
mapSourceRegistersback to summary
public final void mapSourceRegisters(RegisterMapper mapper)

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.mapSourceRegisters.

Doc from org.droidparts.dexmaker.dx.ssa.SsaInsn.mapSourceRegisters.

Maps only source registers.

Parameters
mapper:RegisterMapper

new mapping

Annotations
@Override
setNewSourcesback to summary
public final void setNewSources(RegisterSpecList newSources)

Changes the source list of the insn. New source list should be the same size and consist of sources of identical types.

Parameters
newSources:RegisterSpecList

non-null new sources list.

toHumanback to summary
public String toHuman()

Implements org.droidparts.dexmaker.dx.util.ToHuman.toHuman.

Doc from org.droidparts.dexmaker.dx.util.ToHuman.toHuman.

Return the "human" string form of this instance. This is generally less "debuggy" than toString().

Returns:String

non-null; the human string form

toRopInsnback to summary
public Insn toRopInsn()

Implements abstract org.droidparts.dexmaker.dx.ssa.SsaInsn.toRopInsn.

Doc from org.droidparts.dexmaker.dx.ssa.SsaInsn.toRopInsn.

Transform back to ROP form.

Todo

Move this up into NormalSsaInsn.

Returns:Insn

non-null; a ROP representation of this instruction, with updated registers.

Annotations
@Override
upgradeToLiteralback to summary
public void upgradeToLiteral()

Upgrades this insn to a version that represents the constant source literally. If the upgrade is not possible, this does nothing.

See Also
Insn#withSourceLiteral