com.android.dx.ssa
Class NormalSsaInsn

java.lang.Object
  extended by com.android.dx.ssa.SsaInsn
      extended by com.android.dx.ssa.NormalSsaInsn
All Implemented Interfaces:
ToHuman, Cloneable

public final class NormalSsaInsn
extends SsaInsn
implements Cloneable

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


Nested Class Summary
 
Nested classes/interfaces inherited from class com.android.dx.ssa.SsaInsn
SsaInsn.Visitor
 
Method Summary
 void accept(SsaInsn.Visitor v)
          Accepts a visitor.
 boolean canThrow()
          
 void changeOneSource(int index, RegisterSpec newSpec)
          Changes one of the insn's sources.
 NormalSsaInsn clone()
          
 RegisterSpec getLocalAssignment()
          Gets the spec of a local variable assignment that occurs at this instruction, or null if no local variable assignment occurs.
 Rop getOpcode()
          Returns the Rop opcode for this insn, or null if this is a phi insn.
 Insn getOriginalRopInsn()
          Returns the original Rop insn for this insn, or null if this is a phi insn.
 RegisterSpecList getSources()
          Like rop.Insn.getSources().
 boolean hasSideEffect()
          Returns true if this insn is considered to have a side effect beyond that of assigning to the result reg.
 boolean isMoveException()
          
 boolean isNormalMoveInsn()
           
 boolean isPhiOrMove()
          
 void mapSourceRegisters(RegisterMapper mapper)
          Maps only source registers.
 void setNewSources(RegisterSpecList newSources)
          Changes the source list of the insn.
 String toHuman()
          Return the "human" string form of this instance.
 Insn toRopInsn()
          Transform back to ROP form.
 void upgradeToLiteral()
          Upgrades this insn to a version that represents the constant source literally.
 
Methods inherited from class com.android.dx.ssa.SsaInsn
changeResultReg, getBlock, getResult, isRegASource, isResultReg, makeFromRop, mapRegisters, setResult, setResultLocal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

mapSourceRegisters

public final void mapSourceRegisters(RegisterMapper mapper)
Maps only source registers.

Specified by:
mapSourceRegisters in class SsaInsn
Parameters:
mapper - new mapping

changeOneSource

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 - >=0; index of source to change
newSpec - spec for new source

setNewSources

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 - non-null new sources list.

clone

public NormalSsaInsn clone()

Overrides:
clone in class SsaInsn

getSources

public RegisterSpecList getSources()
Like rop.Insn.getSources().

Specified by:
getSources in class SsaInsn
Returns:
null-ok; sources list

toHuman

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

Specified by:
toHuman in interface ToHuman
Returns:
non-null; the human string form

toRopInsn

public Insn toRopInsn()
Transform back to ROP form. TODO: Move this up into NormalSsaInsn.

Specified by:
toRopInsn in class SsaInsn
Returns:
non-null; a ROP representation of this instruction, with updated registers.

getOpcode

public Rop getOpcode()
Description copied from class: SsaInsn
Returns the Rop opcode for this insn, or null if this is a phi insn. TODO: Move this up into NormalSsaInsn.

Specified by:
getOpcode in class SsaInsn
Returns:
the Rop opcode for this insn

getOriginalRopInsn

public Insn getOriginalRopInsn()
Returns the original Rop insn for this insn, or null if this is a phi insn. TODO: Move this up into NormalSsaInsn.

Specified by:
getOriginalRopInsn in class SsaInsn
Returns:
null-ok; Rop insn if there is one.

getLocalAssignment

public RegisterSpec 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.

Overrides:
getLocalAssignment in class SsaInsn
Returns:
null-ok; a local-associated register spec or null
See Also:
Insn.getLocalAssignment()

upgradeToLiteral

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()

isNormalMoveInsn

public boolean isNormalMoveInsn()
Overrides:
isNormalMoveInsn in class SsaInsn
Returns:
true if this is a move (but not a move-operand) instruction

isMoveException

public boolean isMoveException()

Overrides:
isMoveException in class SsaInsn
Returns:
true if this is a move-exception instruction. These instructions must immediately follow a preceeding invoke*

canThrow

public boolean canThrow()

Specified by:
canThrow in class SsaInsn
Returns:
true if this instruction can throw.

accept

public void accept(SsaInsn.Visitor v)
Accepts a visitor.

Specified by:
accept in class SsaInsn
Parameters:
v - non-null the visitor

isPhiOrMove

public boolean isPhiOrMove()

Specified by:
isPhiOrMove in class SsaInsn
Returns:
true if this is a PhiInsn or a normal move insn

hasSideEffect

public boolean 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.

Specified by:
hasSideEffect in class SsaInsn
Returns:
true if this insn is considered to have a side effect beyond that of assigning to the result reg.


Copyright © 2013. All Rights Reserved.