Top Description Inners Fields Constructors Methods
javassist.bytecode.stackmap

public Class BasicBlock

extends Object
Class Inheritance
Known Direct Subclasses
javassist.bytecode.stackmap.TypedBlock, javassist.bytecode.analysis.ControlFlow.Block
Imports
java.util.ArrayList, .Arrays, .HashMap, .List, .Map, javassist.bytecode.BadBytecode, .CodeAttribute, .CodeIterator, .ExceptionTable, .MethodInfo, .Opcode

A basic block is a sequence of bytecode that does not contain jump/branch instructions except at the last bytecode. Since Java7 or later does not allow JSR, this class throws an exception when it finds JSR.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
pack-priv static class
public static class
pack-priv static class
BasicBlock.Mark

A Mark indicates the position of a branch instruction or a branch target.

Field Summary

Modifier and TypeField and Description
protected BasicBlock[]
protected int
protected int
protected int
protected boolean
protected BasicBlock.Catch

Constructor Summary

AccessConstructor and Description
protected
BasicBlock(int pos)

Method Summary

Modifier and TypeMethod and Description
public static BasicBlock
find(BasicBlock[] blocks, int pos)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

protected void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

exitback to summary
protected BasicBlock[] exit
incomingback to summary
protected int incoming
lengthback to summary
protected int length
positionback to summary
protected int position
stopback to summary
protected boolean stop
toCatchback to summary
protected BasicBlock.Catch toCatch

Constructor Detail

BasicBlockback to summary
protected BasicBlock(int pos)

Method Detail

findback to summary
public static BasicBlock find(BasicBlock[] blocks, int pos) throws BadBytecode
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
toString2back to summary
protected void toString2(StringBuilder sbuf)
javassist.bytecode.stackmap back to summary

public Class BasicBlock.Catch

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
public BasicBlock
public BasicBlock.Catch
public int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bodyback to summary
public BasicBlock body
nextback to summary
public BasicBlock.Catch next
typeIndexback to summary
public int typeIndex

Constructor Detail

Catchback to summary
pack-priv Catch(BasicBlock b, int i, BasicBlock.Catch c)
javassist.bytecode.stackmap back to summary

pack-priv Class BasicBlock.JsrBytecode

extends BadBytecode
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javassist.bytecode.BadBytecode.serialVersionUID.

default serialVersionUID

Constructor Detail

JsrBytecodeback to summary
pack-priv JsrBytecode()
javassist.bytecode.stackmap back to summary

public Class BasicBlock.Maker

extends Object
Class Inheritance
Known Direct Subclasses
javassist.bytecode.stackmap.TypedBlock.Maker

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private static BasicBlock
public BasicBlock[]
public BasicBlock[]
make(CodeIterator ci, int begin, int end, ExceptionTable et)

protected BasicBlock[]
makeArray(int size)

private BasicBlock[]
private BasicBlock[]
protected BasicBlock
makeBlock(int pos)

private BasicBlock[]
private void
makeGoto(Map<Integer, BasicBlock.Mark> marks, int pos, int target, int size)

protected void
makeJsr(Map<Integer, BasicBlock.Mark> marks, int pos, int target, int size)

private BasicBlock.Mark
makeMark(Map<Integer, BasicBlock.Mark> table, int pos)

private BasicBlock.Mark
makeMark(Map<Integer, BasicBlock.Mark> table, int pos, BasicBlock[] jump, int size, boolean always)

private BasicBlock.Mark
makeMark0(Map<Integer, BasicBlock.Mark> table, int pos, boolean isBlockBegin, boolean isTarget)

private Map<Integer, BasicBlock.Mark>
makeMarks(CodeIterator ci, int begin, int end, ExceptionTable et)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Makerback to summary
public Maker()

Method Detail

addCatchersback to summary
private void addCatchers(BasicBlock[] blocks, ExceptionTable et) throws BadBytecode
getBBlockback to summary
private static BasicBlock getBBlock(BasicBlock.Mark m)
makeback to summary
public BasicBlock[] make(MethodInfo minfo) throws BadBytecode
makeback to summary
public BasicBlock[] make(CodeIterator ci, int begin, int end, ExceptionTable et) throws BadBytecode
makeArrayback to summary
protected BasicBlock[] makeArray(int size)
makeArrayback to summary
private BasicBlock[] makeArray(BasicBlock b)
makeArrayback to summary
private BasicBlock[] makeArray(BasicBlock b1, BasicBlock b2)
makeBlockback to summary
protected BasicBlock makeBlock(int pos)
makeBlocksback to summary
private BasicBlock[] makeBlocks(Map<Integer, BasicBlock.Mark> markTable)
makeGotoback to summary
private void makeGoto(Map<Integer, BasicBlock.Mark> marks, int pos, int target, int size)
makeJsrback to summary
protected void makeJsr(Map<Integer, BasicBlock.Mark> marks, int pos, int target, int size) throws BadBytecode
makeMarkback to summary
private BasicBlock.Mark makeMark(Map<Integer, BasicBlock.Mark> table, int pos)
makeMarkback to summary
private BasicBlock.Mark makeMark(Map<Integer, BasicBlock.Mark> table, int pos, BasicBlock[] jump, int size, boolean always)
makeMark0back to summary
private BasicBlock.Mark makeMark0(Map<Integer, BasicBlock.Mark> table, int pos, boolean isBlockBegin, boolean isTarget)
makeMarksback to summary
private Map<Integer, BasicBlock.Mark> makeMarks(CodeIterator ci, int begin, int end, ExceptionTable et) throws BadBytecode
javassist.bytecode.stackmap back to summary

pack-priv Class BasicBlock.Mark

extends Object
implements Comparable<BasicBlock.Mark>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable

A Mark indicates the position of a branch instruction or a branch target.

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv BasicBlock
pack-priv BasicBlock.Catch
pack-priv BasicBlock[]
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
Mark(int p)

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(BasicBlock.Mark
the object to be compared.
obj
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

pack-priv void
setJump(BasicBlock[] bb, int s, boolean always)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

alwaysJmpback to summary
pack-priv boolean alwaysJmp
blockback to summary
pack-priv BasicBlock block
catcherback to summary
pack-priv BasicBlock.Catch catcher
jumpback to summary
pack-priv BasicBlock[] jump
positionback to summary
pack-priv int position
sizeback to summary
pack-priv int size

Constructor Detail

Markback to summary
pack-priv Mark(int p)

Method Detail

compareToback to summary
public int compareTo(BasicBlock.Mark obj)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
obj:BasicBlock.Mark

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
setJumpback to summary
pack-priv void setJump(BasicBlock[] bb, int s, boolean always)