public class

RoutineIOSlot

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.units.code.asm.type.RoutineIOSlot

Class Overview

Representation of a storage (input/output) entry used by routines.

Currently, only 3 types of elements are supported:
- stack entries (any slot count)
- platform register (single slot)
- pairs of platform registers (double slot)

Those objects are immutable.

Summary

Nested Classes
enum RoutineIOSlot.TransformationRule  
enum RoutineIOSlot.Type  
Public Methods
static RoutineIOSlot createComposite(RoutineIOSlot... items)
Create a composite storage entry.
static RoutineIOSlot createComposite(Collection<RoutineIOSlot> items)
Create a composite storage entry.
static RoutineIOSlot createRegister(long regId)
Create a single-register storage entry.
static RoutineIOSlot createRegisterPair(long regId1, long regId2)
Create a double-register storage entry.
static RoutineIOSlot createRegisterPairEndianDep(long regId1, long regId2)
Create a double-register storage entry.
static RoutineIOSlot createRegisterQuad(long regId1, long regId2, long regId3, long regId4)
static RoutineIOSlot createRegisterQuadEndianDep(long regId1, long regId2, long regId3, long regId4)
static RoutineIOSlot createStackEntry(long slotIndex, int slotCount)
Create a stack storage entry.
static RoutineIOSlot createStackSlot(long slotIndex)
Create a single-slot stack storage entry.
boolean equals(Object obj)
String formatLong(IRegisterBank rbl)
String formatParseable(IRegisterBank rbl)
RoutineIOSlot getCompositeItem(int index)
List<RoutineIOSlot> getCompositeItems()
Collection<Long> getRegisters()
int getSlotCount()
RoutineIOSlot.Type getType()
long getValue()
Get the slot index or native register id, depending on the type of this object.
long getValue(Endianness endian)
Get the slot index or native register id, depending on the type of this object.
long getValue2()
For register pairs, retrieve the native register id of the second register of the pair.
long getValue2(Endianness endian)
For register pairs, retrieve the native register id of the second register of the pair.
long getValue3()
For register quads, retrieve the native register id of the third register.
long getValue4()
For register quads, retrieve the native register id of the fourth register.
int getValueAsStackIndex()
int hashCode()
boolean isRegisterBased()
boolean isStackBased()
int nextSlotIndex(int index, int requestedSlotCount)
Calculate the next slot index given the current slot index.
RoutineIOSlot nextStackEntry(int slotcount, int slotalign)
RoutineIOSlot nextStackEntry(int slotcount)
String toString()
RoutineIOSlot withCount(int count)
Duplicate this STACK entry, and set a custom slot count.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static RoutineIOSlot createComposite (RoutineIOSlot... items)

Create a composite storage entry.

Parameters
items a 2+ items list of one or more #REGISTER entries, followed by an optional #STACK entry.

public static RoutineIOSlot createComposite (Collection<RoutineIOSlot> items)

Create a composite storage entry.

Parameters
items a 2+ items list of one or more #REGISTER entries, followed by an optional #STACK entry.

public static RoutineIOSlot createRegister (long regId)

Create a single-register storage entry.

Parameters
regId register id (refer to register banks)

public static RoutineIOSlot createRegisterPair (long regId1, long regId2)

Create a double-register storage entry.

Parameters
regId1 low register id (refer to register banks)
regId2 high register id (refer to register banks)

public static RoutineIOSlot createRegisterPairEndianDep (long regId1, long regId2)

Create a double-register storage entry. Register order (which one stores the LSB, which one stores the MSB) depends on external parameters.

Parameters
regId1 first register id (refer to register banks)
regId2 second register id (refer to register banks)

public static RoutineIOSlot createRegisterQuad (long regId1, long regId2, long regId3, long regId4)

public static RoutineIOSlot createRegisterQuadEndianDep (long regId1, long regId2, long regId3, long regId4)

public static RoutineIOSlot createStackEntry (long slotIndex, int slotCount)

Create a stack storage entry. Stack entries are relative to the stack pointer at the called routine entry-point.

public static RoutineIOSlot createStackSlot (long slotIndex)

Create a single-slot stack storage entry. Stack entries are relative to the stack pointer at the called routine entry-point.

public boolean equals (Object obj)

public String formatLong (IRegisterBank rbl)

public String formatParseable (IRegisterBank rbl)

public RoutineIOSlot getCompositeItem (int index)

public List<RoutineIOSlot> getCompositeItems ()

public Collection<Long> getRegisters ()

public int getSlotCount ()

public RoutineIOSlot.Type getType ()

public long getValue ()

Get the slot index or native register id, depending on the type of this object.

public long getValue (Endianness endian)

Get the slot index or native register id, depending on the type of this object. To be used for REGISTER_PAIR over getValue() which may return the wrong slot index.

public long getValue2 ()

For register pairs, retrieve the native register id of the second register of the pair.

public long getValue2 (Endianness endian)

For register pairs, retrieve the native register id of the second register of the pair.

public long getValue3 ()

For register quads, retrieve the native register id of the third register.

public long getValue4 ()

For register quads, retrieve the native register id of the fourth register.

public int getValueAsStackIndex ()

public int hashCode ()

public boolean isRegisterBased ()

public boolean isStackBased ()

public int nextSlotIndex (int index, int requestedSlotCount)

Calculate the next slot index given the current slot index.

Parameters
index slot index provided when the request for storage was made
requestedSlotCount the amount of slots that were requested to accommodate a value of some type
Returns
  • the next available slot for storage

public RoutineIOSlot nextStackEntry (int slotcount, int slotalign)

public RoutineIOSlot nextStackEntry (int slotcount)

public String toString ()

public RoutineIOSlot withCount (int count)

Duplicate this STACK entry, and set a custom slot count.