# Class: com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry

Representation of an immutable storage entry \(input/output\) for sub\-routine calls. Used to define [ICallingConvention](ICallingConvention) objects. 

 Types of storage entries: 
 
- stack entries \(any slot count\)
 
- platform register \(single slot\)
 
- pair of platform registers \(double slot\)
 
- double\-pair of platform registers \(quad slot\)
 
- a mixed entry, made up of registers and stack slots \(any slot count\)

## Method: collectRegisters
- parameter: `sink`, type: `java.util.Set<java.lang.Long>`

Description: Add all referenced registers to a sink.
parameter: sink: register\-id sink

## Method: equals
- parameter: `obj`, type: `java.lang.Object`
- return type: `boolean`


## Method: formatLong
- parameter: `rbl`, type: `com.pnfsoftware.jeb.core.units.code.asm.processor.IRegisterBank`
- return type: `java.lang.String`

Description: Format this storage entry using register names.
parameter: rbl: register bank layout
return: formatted storage entry

## Method: formatParseable
- parameter: `rbl`, type: `com.pnfsoftware.jeb.core.units.code.asm.processor.IRegisterBank`
- return type: `java.lang.String`

Description: Format this storage entry in a parseable form.
parameter: rbl: register bank layout
return: parseable storage entry

## Method: getMixedItem
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry`

Description: Retrieve an item of a mixed storage entry.
parameter: index: item index
return: mixed storage item

## Method: getMixedItems
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry>`

Description: Retrieve the items of a mixed storage entry.
return: mixed storage items

## Method: getRegisters
- return type: `java.util.Collection<java.lang.Long>`

Description: Retrieve all registers referenced by this storage entry.
return: register ids

## Method: getSlotCount
- return type: `int`

Description: Retrieve the number of storage slots used by this entry.
return: slot count

## Method: getType
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry.Type`

Description: Retrieve the storage entry type.
return: storage entry type

## Method: getValue
- return type: `long`

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

## Method: getValue
- parameter: `endian`, type: `com.pnfsoftware.jeb.util.io.Endianness`
- return type: `long`

Description: Get the slot index or native register id, depending on the type of this object. To be used for [Type#REGISTER_PAIR](Type#REGISTER_PAIR) over [#getValue()](#getValue()) which may return the wrong slot index.
parameter: endian: byte order used for endian\-dependent register pairs
return: slot index or register id

## Method: getValue2
- return type: `long`

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

## Method: getValue2
- parameter: `endian`, type: `com.pnfsoftware.jeb.util.io.Endianness`
- return type: `long`

Description: For register pairs, retrieve the native register id of the second register of the pair.
parameter: endian: byte order used for endian\-dependent register pairs
return: second register id

## Method: getValue3
- return type: `long`

Description: For register quads, retrieve the native register id of the third register.
return: third register id

## Method: getValue4
- return type: `long`

Description: For register quads, retrieve the native register id of the fourth register.
return: fourth register id

## Method: getValueAsStackIndex
- return type: `int`

Description: Retrieve this stack entry's slot index.
return: stack slot index

## Method: hashCode
- return type: `int`


## Method: isRegisterBased
- return type: `boolean`

Description: Determine whether this storage entry uses register storage.
return: true if register\-based

## Method: isStackBased
- return type: `boolean`

Description: Determine whether this storage entry uses stack storage.
return: true if stack\-based

## Method: nextSlotIndex
- parameter: `currentSlotIndex`, type: `int`
- parameter: `requestedSlotCount`, type: `int`
- return type: `int`

Description: Calculate the next slot index given the slot index of the current storage entry.
parameter: currentSlotIndex: slot index of this storage entry
parameter: requestedSlotCount: the amount of slots used to accommodate this entry, unless it was a            register\-based entry
return: the next available slot for storage

## Method: nextStackEntry
- parameter: `slotcount`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry`

Description: Create the next stack entry after this entry.
parameter: slotcount: number of slots in the next entry
return: next stack entry

## Method: nextStackEntry
- parameter: `slotcount`, type: `int`
- parameter: `slotalign`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry`

Description: Create the next aligned stack entry after this entry.
parameter: slotcount: number of slots in the next entry
parameter: slotalign: stack slot alignment
return: next stack entry

## Method: toString
- return type: `java.lang.String`


## Method: withCount
- parameter: `count`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry`

Description: Duplicate this STACK entry, and set a custom slot count.
parameter: count: slot count
return: duplicated stack entry

## Static Method: createMixed
- parameter: `items`, type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry[]`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry`

Description: Create a mixed storage entry.
parameter: items: a 2\+ items list of one or more [Type#REGISTER](Type#REGISTER) entries, followed by an            optional [Type#STACK](Type#STACK) entry.
return: mixed storage entry

## Static Method: createMixed
- parameter: `items`, type: `java.util.Collection<com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry>`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry`

Description: Create a mixed storage entry.
parameter: items: a 2\+ items list of one or more [Type#REGISTER](Type#REGISTER) entries, followed by an            optional [Type#STACK](Type#STACK) entry.
return: mixed storage entry

## Static Method: createRegister
- parameter: `regId`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry`

Description: Create a single\-register storage entry.
parameter: regId: register id \(refer to register banks\)
return: register storage entry

## Static Method: createRegisterPair
- parameter: `regId1`, type: `long`
- parameter: `regId2`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry`

Description: Create a double\-register storage entry.
parameter: regId1: low register id \(refer to register banks\)
parameter: regId2: high register id \(refer to register banks\)
return: register\-pair storage entry

## Static Method: createRegisterPairEndianDep
- parameter: `regId1`, type: `long`
- parameter: `regId2`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry`

Description: Create a double\-register storage entry. Register order \(which one stores the LSB, which one stores the MSB\) depends on external parameters.
parameter: regId1: first register id \(refer to register banks\)
parameter: regId2: second register id \(refer to register banks\)
return: endian\-dependent register\-pair storage entry

## Static Method: createRegisterQuad
- parameter: `regId1`, type: `long`
- parameter: `regId2`, type: `long`
- parameter: `regId3`, type: `long`
- parameter: `regId4`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry`

Description: Create a quad\-register storage entry.
parameter: regId1: first register id
parameter: regId2: second register id
parameter: regId3: third register id
parameter: regId4: fourth register id
return: quad\-register storage entry

## Static Method: createRegisterQuadEndianDep
- parameter: `regId1`, type: `long`
- parameter: `regId2`, type: `long`
- parameter: `regId3`, type: `long`
- parameter: `regId4`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry`

Description: Create an endian\-dependent quad\-register storage entry.
parameter: regId1: first register id
parameter: regId2: second register id
parameter: regId3: third register id
parameter: regId4: fourth register id
return: endian\-dependent quad\-register storage entry

## Static Method: createStackEntry
- parameter: `slotIndex`, type: `long`
- parameter: `slotCount`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry`

Description: Create a stack storage entry. Stack entries are relative to the stack pointer at the called routine entry\-point.
parameter: slotIndex: stack slot index
parameter: slotCount: number of stack slots
return: stack storage entry

## Static Method: createStackSlot
- parameter: `slotIndex`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.StorageEntry`

Description: Create a single\-slot stack storage entry. Stack entries are relative to the stack pointer at the called routine entry\-point.
parameter: slotIndex: stack slot index
return: stack storage entry

