com.android.dx.rop.code
Class PlainCstInsn

java.lang.Object
  extended by com.android.dx.rop.code.Insn
      extended by com.android.dx.rop.code.CstInsn
          extended by com.android.dx.rop.code.PlainCstInsn
All Implemented Interfaces:
ToHuman

public final class PlainCstInsn
extends CstInsn

Instruction which contains an explicit reference to a constant but which cannot throw an exception.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.android.dx.rop.code.Insn
Insn.BaseVisitor, Insn.Visitor
 
Constructor Summary
PlainCstInsn(Rop opcode, SourcePosition position, RegisterSpec result, RegisterSpecList sources, Constant cst)
          Constructs an instance.
 
Method Summary
 void accept(Insn.Visitor visitor)
          Calls the appropriate method on the given visitor, depending on the class of this instance.
 TypeList getCatches()
          Gets the list of possibly-caught exceptions.
 Insn withAddedCatch(Type type)
          Returns an instance that is just like this one, except that it has a catch list with the given item appended to the end.
 Insn withNewRegisters(RegisterSpec result, RegisterSpecList sources)
          Returns an instance that is just like this one, except with new result and source registers.
 Insn withRegisterOffset(int delta)
          Returns an instance that is just like this one, except that all register references have been offset by the given delta.
 
Methods inherited from class com.android.dx.rop.code.CstInsn
contentEquals, getConstant, getInlineString
 
Methods inherited from class com.android.dx.rop.code.Insn
canThrow, copy, equals, getLocalAssignment, getOpcode, getPosition, getResult, getSources, hashCode, toHuman, toHumanWithInline, toString, toStringWithInline, withSourceLiteral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlainCstInsn

public PlainCstInsn(Rop opcode,
                    SourcePosition position,
                    RegisterSpec result,
                    RegisterSpecList sources,
                    Constant cst)
Constructs an instance.

Parameters:
opcode - non-null; the opcode
position - non-null; source position
result - null-ok; spec for the result, if any
sources - non-null; specs for all the sources
cst - non-null; the constant
Method Detail

getCatches

public TypeList getCatches()
Gets the list of possibly-caught exceptions. This returns StdTypeList.EMPTY if this instruction has no handlers, which can be either if this instruction can't possibly throw or if it merely doesn't handle any of its possible exceptions. To determine whether this instruction can throw, use Insn.canThrow().

Specified by:
getCatches in class Insn
Returns:
non-null; the catches list

accept

public void accept(Insn.Visitor visitor)
Calls the appropriate method on the given visitor, depending on the class of this instance. Subclasses must override this.

Specified by:
accept in class Insn
Parameters:
visitor - non-null; the visitor to call on

withAddedCatch

public Insn withAddedCatch(Type type)
Returns an instance that is just like this one, except that it has a catch list with the given item appended to the end. This method throws an exception if this instance can't possibly throw. To determine whether this instruction can throw, use Insn.canThrow().

Specified by:
withAddedCatch in class Insn
Parameters:
type - non-null; type to append to the catch list
Returns:
non-null; an appropriately-constructed instance

withRegisterOffset

public Insn withRegisterOffset(int delta)
Returns an instance that is just like this one, except that all register references have been offset by the given delta.

Specified by:
withRegisterOffset in class Insn
Parameters:
delta - the amount to offset register references by
Returns:
non-null; an appropriately-constructed instance

withNewRegisters

public Insn withNewRegisters(RegisterSpec result,
                             RegisterSpecList sources)
Returns an instance that is just like this one, except with new result and source registers.

Specified by:
withNewRegisters in class Insn
Parameters:
result - null-ok; new result register
sources - non-null; new sources registers
Returns:
non-null; an appropriately-constructed instance


Copyright © 2013. All Rights Reserved.