# Package org.codehaus.groovy.classgen.asm

package org.codehaus.groovy.classgen.asm
ASM-based helpers that support Groovy bytecode generation in the core class generator.

- Related Packages
  Package
  Description
  org.codehaus.groovy.classgen
  Provides classes for generating Java bytecode from Groovy Abstract Syntax Trees (AST).
  org.codehaus.groovy.classgen.asm.indy
  InvokeDynamic-based bytecode generation for optimized method calls.
  org.codehaus.groovy.classgen.asm.sc
  Static compilation bytecode generation.
  org.codehaus.groovy.classgen.asm.util
  Utilities for bytecode generation.
- Class
  Description
  AssertionWriter
  Emits bytecode for Groovy `assert` statements.
  BinaryBooleanExpressionHelper
  Binary write operations specialised for Booleans
  BinaryDoubleExpressionHelper
  Binary expression helper specialized for `double` operations.
  BinaryExpressionHelper
  Emits bytecode for dynamic binary expressions.
  BinaryExpressionMultiTypeDispatcher
  This class is for internal use only! This class will dispatch to the right type adapters according to the kind of binary expression that is provided.
  BinaryExpressionWriter
  Base class for writing primitive typed operations
  BinaryFloatExpressionHelper
  Binary expression helper specialized for `float` operations.
  BinaryIntExpressionHelper
  Emits optimized bytecode for integer binary operations.
  BinaryLongExpressionHelper
  Binary expression helper specialized for `long` operations.
  BinaryObjectExpressionHelper
  Binary expression helper used for object operations that fall back to dynamic dispatch.
  BytecodeDumper
  A utility class which can be used in test cases to dump generated bytecode.
  BytecodeHelper
  A helper class for bytecode generation with AsmClassGenerator.
  BytecodeVariable
  Represents compile time variable metadata while compiling a method.
  CallSiteWriter
  Bytecode writer for classic (non-`invokedynamic`) call sites.
  ClosureWriter
  Generates bytecode for closure expressions.
  ClosureWriter.CorrectAccessedVariableVisitor
  Visitor that rewrites `VariableExpression` nodes whose accessed variable is a `FieldNode` in an outer class to instead reference the corresponding field in the generated closure inner class.
  ClosureWriter.UseExistingReference
  Marker interface for using existing reference.
  CompileStack
  Manages different aspects of the code of a code block like handling labels, defining variables, and scopes.
  CompileStack.BlockRecorder
  Records a block for finally or other special handling.
  CompileStack.LabelRange
  Represents a label range for exception handling or other scoping.
  CompileStack.SwitchExpressionContext
  Join-point information for a switch expression being compiled (GROOVY-12255).
  DelegatingController
  This class will delegate all calls to a WriterController given in the constructor.
  ExpressionAsVariableSlot
  Helper class that takes an Expression and if visited will load it normally, storing the result in a helper variable, which then can be requested after the visit is completed.
  InvocationWriter
  Handles method and constructor invocations, generating appropriate bytecode.
  LambdaWriter
  Generates bytecode for lambda expressions.
  MethodCaller
  A helper class to invoke methods more easily in ASM
  MethodCallerMultiAdapter
  Multi-adapter for method callers that handles different argument counts and safe/spread-safe variants.
  MethodPointerExpressionWriter
  Generates bytecode for method pointer expressions.
  MethodReferenceExpressionWriter
  Generates bytecode for method reference expressions.
  MopWriter
  Generates bytecode for Meta Object Protocol (MOP) methods.
  MopWriter.Factory
  Factory interface for creating MopWriter instances.
  OperandStack
  Tracks the JVM operand stack during bytecode generation, maintaining a parallel list of `ClassNode` type descriptors for each slot.
  OptimizingStatementWriter
  A `StatementWriter` that emits optimized fast-path bytecode for statements involving integer (and other primitive) operations.
  OptimizingStatementWriter.ClassNodeSkip
  Marker metadata used to skip optimization analysis for a class node.
  OptimizingStatementWriter.StatementMeta
  Stores optimization metadata collected for a statement or expression.
  PackStrategy
  The compilation strategy the GEP-27 capability analysis selects for a closure literal: keep today's per-closure class, or pack the closure by hoisting its body to a method on the enclosing class behind a shared `PackedClosure` adapter.
  PeepholeOptimizingClassVisitor
  Class-level installation point for Groovy's single-pass bytecode peephole layer.
  PeepholeOptimizingMethodVisitor
  Single-pass, stack-local bytecode compaction for methods emitted by the Groovy class generator.
  StatementMetaTypeChooser
  A `TypeChooser` which is aware of statement metadata.
  StatementWriter
  Generates bytecode for Groovy statements by visiting AST statement nodes and emitting corresponding JVM instructions via the `WriterController`.
  SwitchExpressionWriter
  Emits JVM bytecode for a `SwitchExpression`.
  TypeChooser
  Interface for modules which are capable of resolving the type of an expression.
  UnaryExpressionHelper
  A helper class used to generate bytecode for unary expressions.
  VariableSlotLoader
  A bytecode expression that loads a variable from a specific slot index.
  WriterController
  Central coordinator for Groovy-to-bytecode compilation of a single class.
  WriterControllerFactory
  A non-static factory to get alternative writer controller to be stored in the metadata