Packages

abstract class ClosureOptimizer extends AnyRef

Source
ClosureOptimizer.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ClosureOptimizer
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ClosureOptimizer()

Type Members

  1. case class Local(local: Int, opcodeOffset: Int) extends Product with Serializable

    Stores a local variable index the opcode offset required for operating on that variable.

    Stores a local variable index the opcode offset required for operating on that variable.

    The xLOAD / xSTORE opcodes are in the following sequence: I, L, F, D, A, so the offset for a local variable holding a reference (A) is 4. See also method getOpcode in scala.tools.asm.Type.

  2. case class LocalsList(locals: List[Local]) extends Product with Serializable

    A list of local variables.

    A list of local variables. Each local stores information about its type, see class Local.

Abstract Value Members

  1. abstract val postProcessor: PostProcessor

Concrete Value Members

  1. def rewriteClosureApplyInvocations(): Unit

    If a closure is allocated and invoked within the same method, re-write the invocation to the closure body method.

    If a closure is allocated and invoked within the same method, re-write the invocation to the closure body method.

    Note that the closure body method (generated by delambdafy:method) takes additional parameters for the values captured by the closure. The bytecode is transformed from

    [generate captured values] [closure init, capturing values] [...] [load closure object] [generate closure invocation arguments] [invoke closure.apply]

    to

    [generate captured values] [store captured values into new locals] [load the captured values from locals] // a future optimization will eliminate the closure [closure init, capturing values] // instantiation if the closure object becomes unused [...] [load closure object] [generate closure invocation arguments] [store argument values into new locals] [drop the closure object] [load captured values from locals] [load argument values from locals] [invoke the closure body method]

  2. object LocalsList extends Serializable