Top Description Fields Constructors Methods
org.apache.bcel.classfile

public final Class StackMapEntry

extends Object
implements Node, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, org.apache.bcel.classfile.Node
Imports
java.io.DataInput, .DataOutputStream, .IOException, java.util.Arrays, org.apache.bcel.Const

This class represents a stack map entry recording the types of local variables and the of stack items at a given byte code offset. See CLDC specification 5.3.1.2. See also https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.4
union stack_map_frame {
  same_frame;
  same_locals_1_stack_item_frame;
  same_locals_1_stack_item_frame_extended;
  chop_frame;
  same_frame_extended;
  append_frame;
  full_frame;
}
See Also
StackMap, StackMapType

Field Summary

Modifier and TypeField and Description
private int
private ConstantPool
pack-priv static final StackMapEntry[]
private int
private StackMapType[]
private StackMapType[]

Constructor Summary

AccessConstructor and Description
pack-priv
StackMapEntry(final DataInput
Input stream
dataInput
,
final ConstantPool constantPool)

Constructs object from input stream.

public
StackMapEntry(final int byteCodeOffset, final int
NOT USED
numberOfLocals
,
final StackMapType[]
array of StackMapTypes of locals
typesOfLocals
,
final int
NOT USED
numberOfStackItems
,
final StackMapType[]
array ot StackMapTypes of stack items
typesOfStackItems
,
final ConstantPool
the constant pool
constantPool
)

DO NOT USE
public
StackMapEntry(final int
the frameType to use
tag
,
final int byteCodeOffset, final StackMapType[]
array of StackMapTypes of locals
typesOfLocals
,
final StackMapType[]
array ot StackMapTypes of stack items
typesOfStackItems
,
final ConstantPool
the constant pool
constantPool
)

Create an instance

Method Summary

Modifier and TypeMethod and Description
public void
accept(final Visitor
Visitor object
v
)

Implements org.apache.bcel.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.
public StackMapEntry

Returns:

deep copy of this object
copy
()

public void
dump(final DataOutputStream
Output file stream
file
)

Dump stack map entry

public int
public ConstantPool

Returns:

Constant pool used by this object.
getConstantPool
()

public int
pack-priv int
getMapEntrySize()

Calculate stack map entry size

public int
public int
public StackMapType[]
public StackMapType[]
private boolean
invalidFrameType(final int f)

public void
setByteCodeOffset(final int newOffset)

public void
setConstantPool(final ConstantPool
Constant pool to be used for this object.
constantPool
)

public void
setFrameType(final int ft)

public void
setNumberOfLocals(final int n)

Deprecated since 6.0
public void
setNumberOfStackItems(final int n)

Deprecated since 6.0
public void
public void
public String

Returns:

String representation.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
updateByteCodeOffset(final int
offset delta
delta
)

Update the distance (as an offset delta) from this StackMap entry to the next.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

byteCodeOffsetback to summary
private int byteCodeOffset
constantPoolback to summary
private ConstantPool constantPool
EMPTY_ARRAYback to summary
pack-priv static final StackMapEntry[] EMPTY_ARRAY
frameTypeback to summary
private int frameType
typesOfLocalsback to summary
private StackMapType[] typesOfLocals
typesOfStackItemsback to summary
private StackMapType[] typesOfStackItems

Constructor Detail

StackMapEntryback to summary
pack-priv StackMapEntry(final DataInput dataInput, final ConstantPool constantPool) throws IOException

Constructs object from input stream.

Parameters
dataInput:DataInput

Input stream

Exceptions
IOException:
if an I/O error occurs.
StackMapEntryback to summary
public StackMapEntry(final int byteCodeOffset, final int numberOfLocals, final StackMapType[] typesOfLocals, final int numberOfStackItems, final StackMapType[] typesOfStackItems, final ConstantPool constantPool)

DO NOT USE

Parameters
numberOfLocals:int

NOT USED

typesOfLocals:StackMapType[]

array of StackMapTypes of locals

numberOfStackItems:int

NOT USED

typesOfStackItems:StackMapType[]

array ot StackMapTypes of stack items

constantPool:ConstantPool

the constant pool

Annotations
@Deprecated
StackMapEntryback to summary
public StackMapEntry(final int tag, final int byteCodeOffset, final StackMapType[] typesOfLocals, final StackMapType[] typesOfStackItems, final ConstantPool constantPool)

Create an instance

Parameters
tag:int

the frameType to use

typesOfLocals:StackMapType[]

array of StackMapTypes of locals

typesOfStackItems:StackMapType[]

array ot StackMapTypes of stack items

constantPool:ConstantPool

the constant pool

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements org.apache.bcel.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters
v:Visitor

Visitor object

Annotations
@Override
copyback to summary
public StackMapEntry copy()
Returns:StackMapEntry

deep copy of this object

dumpback to summary
public void dump(final DataOutputStream file) throws IOException

Dump stack map entry

Parameters
file:DataOutputStream

Output file stream

Exceptions
IOException:
if an I/O error occurs.
getByteCodeOffsetback to summary
public int getByteCodeOffset()
getConstantPoolback to summary
public ConstantPool getConstantPool()
Returns:ConstantPool

Constant pool used by this object.

getFrameTypeback to summary
public int getFrameType()
getMapEntrySizeback to summary
pack-priv int getMapEntrySize()

Calculate stack map entry size

getNumberOfLocalsback to summary
public int getNumberOfLocals()
getNumberOfStackItemsback to summary
public int getNumberOfStackItems()
getTypesOfLocalsback to summary
public StackMapType[] getTypesOfLocals()
getTypesOfStackItemsback to summary
public StackMapType[] getTypesOfStackItems()
invalidFrameTypeback to summary
private boolean invalidFrameType(final int f)
setByteCodeOffsetback to summary
public void setByteCodeOffset(final int newOffset)
setConstantPoolback to summary
public void setConstantPool(final ConstantPool constantPool)
Parameters
constantPool:ConstantPool

Constant pool to be used for this object.

setFrameTypeback to summary
public void setFrameType(final int ft)
setNumberOfLocalsback to summary
public void setNumberOfLocals(final int n)

Deprecated

since 6.0

Annotations
@Deprecated
setNumberOfStackItemsback to summary
public void setNumberOfStackItems(final int n)

Deprecated

since 6.0

Annotations
@Deprecated
setTypesOfLocalsback to summary
public void setTypesOfLocals(final StackMapType[] types)
setTypesOfStackItemsback to summary
public void setTypesOfStackItems(final StackMapType[] types)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

String representation.

Annotations
@Override
updateByteCodeOffsetback to summary
public void updateByteCodeOffset(final int delta)

Update the distance (as an offset delta) from this StackMap entry to the next. Note that this might cause the frame type to change. Note also that delta may be negative.

Parameters
delta:int

offset delta