import {InstructionFactory} from 'jvm/lib/core/jvm/instructions/InstructionFactory.js'
InstructionFactory
Factory class for creating an instruction by its opcode and instruction index inside a Code attribute.
Static Method Summary
Static Public Methods | ||
public static |
of(methodInfo: MethodInfo, idx: Number, opcode: Number, wide: Boolean): AbstractInstruction Creates instructions based on pre-defined configurations allowing the complex process of building instructions to be simplified into a 3 parameter method. |
Constructor Summary
Private Constructor | ||
private |
constructor(methodInfo: MethodInfo, idx: Number, opcode: Number, wide: Boolean) |
Member Summary
Private Members | ||
private |
|
|
private |
instruction: AbstractInstruction |
|
private get |
Flag for if the instruction is wide. |
|
private |
|
|
private |
|
|
private get |
shouldWrap: Boolean: * Flag for if the instruction should be wrapped by an InstructionWrapper object. |
|
private |
|
|
private get |
wrapType: InstructionWrapper | null: * Gets the type of wrapper that should be applied when creating the instruction. |
Method Summary
Private Methods | ||
private |
build(): AbstractInstruction Creates an instance of the instruction and wraps it with an InstructionWrapper if necessary. |
|
private |
createInstance(): AbstractInstruction |
Static Public Methods
public static of(methodInfo: MethodInfo, idx: Number, opcode: Number, wide: Boolean): AbstractInstruction source
Creates instructions based on pre-defined configurations allowing the complex process of building instructions to be simplified into a 3 parameter method.
Params:
Name | Type | Attribute | Description |
methodInfo | MethodInfo | The method the given instruction is in |
|
idx | Number | instruction index |
|
opcode | Number | opcode identifier |
|
wide | Boolean | wide instruction flag |
Return:
AbstractInstruction |
Private Constructors
private constructor(methodInfo: MethodInfo, idx: Number, opcode: Number, wide: Boolean) source
Params:
Name | Type | Attribute | Description |
methodInfo | MethodInfo | The method the given instruction is in |
|
idx | Number | instruction index |
|
opcode | Number | opcode identifier |
|
wide | Boolean | wide instruction flag |
Private Members
private instruction: AbstractInstruction source
private methodInfo: MethodInfo source
private get shouldWrap: Boolean: * source
Flag for if the instruction should be wrapped by an InstructionWrapper object.
private get wrapType: InstructionWrapper | null: * source
Gets the type of wrapper that should be applied when creating the instruction.
Private Methods
private build(): AbstractInstruction source
Creates an instance of the instruction and wraps it with an InstructionWrapper if necessary.
Return:
AbstractInstruction |