com.android.dx.dex.code
Class LocalSnapshot

java.lang.Object
  extended by com.android.dx.dex.code.DalvInsn
      extended by com.android.dx.dex.code.ZeroSizeInsn
          extended by com.android.dx.dex.code.LocalSnapshot

public final class LocalSnapshot
extends ZeroSizeInsn

Pseudo-instruction which is used to hold a snapshot of the state of local variable name mappings that exists immediately after the instance in an instruction array.


Constructor Summary
LocalSnapshot(SourcePosition position, RegisterSpecSet locals)
          Constructs an instance.
 
Method Summary
protected  String argString()
          Gets the string form for any arguments to this instance.
 RegisterSpecSet getLocals()
          Gets the local state associated with this instance.
protected  String listingString0(boolean noteIndices)
          Helper for DalvInsn.listingString(java.lang.String, int, boolean), which returns the string form of this instance suitable for inclusion in a human-oriented listing dump, not including the instruction address and without respect for any output formatting.
 DalvInsn withMapper(RegisterMapper mapper)
          Returns an instance that is just like this one, except that the register list is mapped by using mapper.
 DalvInsn withRegisterOffset(int delta)
          Returns an instance that is just like this one, except that all register references have been offset by the given delta, and its address is reset.
 DalvInsn withRegisters(RegisterSpecList registers)
          Returns an instance that is just like this one, except that the register list is replaced by the given one, and its address is reset.
 
Methods inherited from class com.android.dx.dex.code.ZeroSizeInsn
codeSize, withOpcode, writeTo
 
Methods inherited from class com.android.dx.dex.code.DalvInsn
expandedPrefix, expandedSuffix, expandedVersion, getAddress, getLowRegVersion, getMinimumRegisterRequirement, getNextAddress, getOpcode, getPosition, getRegisters, hasAddress, hasResult, identifierString, listingString, makeMove, setAddress, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalSnapshot

public LocalSnapshot(SourcePosition position,
                     RegisterSpecSet locals)
Constructs an instance. The output address of this instance is initially unknown (-1).

Parameters:
position - non-null; source position
locals - non-null; associated local variable state
Method Detail

withRegisterOffset

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

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

withRegisters

public DalvInsn withRegisters(RegisterSpecList registers)
Returns an instance that is just like this one, except that the register list is replaced by the given one, and its address is reset.

Specified by:
withRegisters in class DalvInsn
Parameters:
registers - non-null; new register list
Returns:
non-null; an appropriately-constructed instance

getLocals

public RegisterSpecSet getLocals()
Gets the local state associated with this instance.

Returns:
non-null; the state

argString

protected String argString()
Gets the string form for any arguments to this instance. Subclasses must override this.

Specified by:
argString in class DalvInsn
Returns:
null-ok; the string version of any arguments or null if there are none

listingString0

protected String listingString0(boolean noteIndices)
Helper for DalvInsn.listingString(java.lang.String, int, boolean), which returns the string form of this instance suitable for inclusion in a human-oriented listing dump, not including the instruction address and without respect for any output formatting. This method should return null if this instance should not appear in a listing.

Specified by:
listingString0 in class DalvInsn
Parameters:
noteIndices - whether to include an explicit notation of constant pool indices
Returns:
null-ok; the listing string

withMapper

public DalvInsn withMapper(RegisterMapper mapper)
Returns an instance that is just like this one, except that the register list is mapped by using mapper.

Overrides:
withMapper in class DalvInsn
Parameters:
mapper - non-null; used to map registers
Returns:
non-null; an appropriately-constructed instance


Copyright © 2015. All rights reserved.