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

InstructionMajorVersionVerifier

Utility class for verifying that all methods for a given class do not use instructions that are not available in their Java SE runtime.

Constructor Summary

Public Constructor
public

constructor(classInfo: ClassInfo)

Member Summary

Private Members
private
private

Method Summary

Public Methods
public

Finds the intersection between the unusable opcodes and the opcodes present in MethodInfo.instructions.

public

Finds all opcodes with a version higher than the ClassInfo object being verified.

public

Determines if the ClassInfo object only has opcodes that are usable for the given Java SE runtime.

Public Constructors

public constructor(classInfo: ClassInfo) source

Params:

NameTypeAttributeDescription
classInfo ClassInfo

Private Members

private classInfo: ClassInfo source

private unusableOpcodes: Array<Number> source

Public Methods

public findInvalidMethodOpcodes(method: MethodInfo): Array<Number> source

Finds the intersection between the unusable opcodes and the opcodes present in MethodInfo.instructions.

Params:

NameTypeAttributeDescription
method MethodInfo

Return:

Array<Number>

public findUnusableOpcodes(): Array<Number> source

Finds all opcodes with a version higher than the ClassInfo object being verified.

Checks against Opcodes.OPCODE_VERSIONS

Return:

Array<Number>

flat array of opcodes that are not available in the Java SE runtime of the JVM Class File.

public verify(): Boolean source

Determines if the ClassInfo object only has opcodes that are usable for the given Java SE runtime.

Return:

Boolean