Home Reference Source
import {InstructionFactory} from 'jvm/lib/core/jvm/instructions/InstructionFactory.js'
public class | source

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

Flag for if the instruction should be wrapped by an InstructionWrapper object.

private
private get

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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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 idx: Number source

private instruction: AbstractInstruction source

private get isWide: Boolean: * source

Flag for if the instruction is wide.

Return:

Boolean

private methodInfo: MethodInfo source

private opcode: Number source

private get shouldWrap: Boolean: * source

Flag for if the instruction should be wrapped by an InstructionWrapper object.

Return:

Boolean

private wide: Boolean source

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

private createInstance(): AbstractInstruction source

Return:

AbstractInstruction