Package-level declarations

Types

Link copied to clipboard

A helper class for referring to a constructor. It verifies at construction time that the referenced method is marked with the ReferencedInGeneratedCode annotation, and that the specified argument types are correct. When it generates a call, it uses the appropriate invoke instruction.

Link copied to clipboard

A helper class for referring to a field. It verifies at construction time that the referenced field is marked with the ReferencedInGeneratedCode annotation, and that the specified type agrees. When it generates a read (getfield/getstatic) or write (putfield/putstatic), it uses the appropriate instruction. It substitutes a literal if the field is final, and forbids generating a write to it.

Link copied to clipboard

A helper class for referring to a method. It verifies at construction time that the referenced method is marked with the ReferencedInGeneratedCode annotation, and that the specified argument types are correct. When it generates a call, it uses the appropriate invoke instruction, and even generates a Opcodes.CHECKCAST instruction if the result type isn't strong enough.

Link copied to clipboard
abstract class JVMChunk constructor : ExecutableChunk

A JVMChunk is an ExecutableChunk for the Java Virtual Machine. It is produced by a JVMTranslator on behalf of an L2Generator that has just completed a translation or optimization.

Link copied to clipboard

A JVMChunkClassLoader is created for each generated JVMChunk, permitted dynamic loading and unloading of each JVMChunk independently. The class loader holds onto zero or many objects for usage during static initialization of the generated JVMChunk; these values are accessed from an array.

Link copied to clipboard

JVMChunkL1Source captures an absolute path to the disassembled L1 code that serves as the basis for the annotated method, making it available in generated class files. This annotation is only attached if JVMTranslator.debugJVM is enabled.

Link copied to clipboard

JVMChunkL2Source captures an absolute path to the L2ControlFlowGraph of the L2Chunk that serves as the basis for the annotated method, making it available in generated class files. This annotation is only attached if JVMTranslator.debugJVM is enabled.

Link copied to clipboard
class JVMTranslator(val code: A_RawFunction?, chunkName: String, sourceFileName: String?, controlFlowGraph: L2ControlFlowGraph, instructions: List<L2Instruction>)

A JVMTranslator converts a single L2Chunk into a JVMChunk in a naive fashion. Instruction selection is optimized, but no other optimizations are attempted; all significant optimizations should occur on the L2Chunk's control flow graph and be reflected in the L2Chunk to be translated.

Link copied to clipboard

ReferencedInGeneratedCode indicates that the annotated method or field is referenced from generated code, and therefore great care must be taken when refactoring.