javassist.bytecode

Class StackMapTable.Writer

public static class StackMapTable.Writer extends Object

A writer of stack map tables.
Constructor Summary
Writer(int size)
Constructs a writer.
Method Summary
voidappendFrame(int offsetDelta, int[] tags, int[] data)
Writes a append_frame.
voidchopFrame(int offsetDelta, int k)
Writes a chop_frame.
voidfullFrame(int offsetDelta, int[] localTags, int[] localData, int[] stackTags, int[] stackData)
Writes a full_frame.
voidsameFrame(int offsetDelta)
Writes a same_frame or a same_frame_extended.
voidsameLocals(int offsetDelta, int tag, int data)
Writes a same_locals_1_stack_item or a same_locals_1_stack_item_extended.
byte[]toByteArray()
Returns the stack map table written out.

Constructor Detail

Writer

public Writer(int size)
Constructs a writer.

Parameters: size the initial buffer size.

Method Detail

appendFrame

public void appendFrame(int offsetDelta, int[] tags, int[] data)
Writes a append_frame.

Parameters: tag locals[].tag. The length of this array must be either 1, 2, or 3. data locals[].cpool_index if the tag is OBJECT, or locals[].offset if the tag is UNINIT. Otherwise, this parameter is not used.

chopFrame

public void chopFrame(int offsetDelta, int k)
Writes a chop_frame.

Parameters: k the number of absent locals. 1, 2, or 3.

fullFrame

public void fullFrame(int offsetDelta, int[] localTags, int[] localData, int[] stackTags, int[] stackData)
Writes a full_frame.

Parameters: localTags locals[].tag. localData locals[].cpool_index if the tag is OBJECT, or locals[].offset if the tag is UNINIT. Otherwise, this parameter is not used. stackTags stack[].tag. stackData stack[].cpool_index if the tag is OBJECT, or stack[].offset if the tag is UNINIT. Otherwise, this parameter is not used.

sameFrame

public void sameFrame(int offsetDelta)
Writes a same_frame or a same_frame_extended.

sameLocals

public void sameLocals(int offsetDelta, int tag, int data)
Writes a same_locals_1_stack_item or a same_locals_1_stack_item_extended.

Parameters: tag stack[0].tag. data stack[0].cpool_index if the tag is OBJECT, or stack[0].offset if the tag is UNINIT. Otherwise, this parameter is not used.

toByteArray

public byte[] toByteArray()
Returns the stack map table written out.
Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.