Packages

trait InvokedynamicRewriting extends DeferredInvokedynamicResolution

Provides support for rewriting Java 8/Scala lambda or method reference expressions that were compiled to org.opalj.br.instructions.INVOKEDYNAMIC instructions. This trait should be mixed in alongside a BytecodeReaderAndBinding, which extracts basic invokedynamic information from the BootstrapMethodTable.

Specifically, whenever an invokedynamic instruction is encountered that is the result of a lambda/method reference expression compiled by Oracle's JDK8, it creates a proxy class file that represents the synthetic object that the JVM generates after executing the invokedynamic call site. This proxy is then stored in the temporary ClassFile attribute SynthesizedClassFiles. All such ClassFiles will be picked up later for inclusion in the project.

Self Type
InvokedynamicRewriting with ClassFileBinding
See also

DismantlingInvokeDynamic for further information.

Linear Supertypes
DeferredInvokedynamicResolution, CodeBinding, ConstantPoolBinding, Constant_PoolReader, Constant_PoolAbstractions, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. InvokedynamicRewriting
  2. DeferredInvokedynamicResolution
  3. CodeBinding
  4. ConstantPoolBinding
  5. Constant_PoolReader
  6. Constant_PoolAbstractions
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type CONSTANT_Class_info = cp.CONSTANT_Class_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  2. type CONSTANT_Double_info = cp.CONSTANT_Double_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  3. type CONSTANT_Fieldref_info = cp.CONSTANT_Fieldref_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  4. type CONSTANT_Float_info = cp.CONSTANT_Float_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  5. type CONSTANT_Integer_info = cp.CONSTANT_Integer_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  6. type CONSTANT_InterfaceMethodref_info = cp.CONSTANT_InterfaceMethodref_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  7. type CONSTANT_InvokeDynamic_info = cp.CONSTANT_InvokeDynamic_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  8. type CONSTANT_Long_info = cp.CONSTANT_Long_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  9. type CONSTANT_MethodHandle_info = cp.CONSTANT_MethodHandle_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  10. type CONSTANT_MethodType_info = cp.CONSTANT_MethodType_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  11. type CONSTANT_Methodref_info = cp.CONSTANT_Methodref_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  12. type CONSTANT_Module_info = cp.CONSTANT_Module_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  13. type CONSTANT_NameAndType_info = cp.CONSTANT_NameAndType_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  14. type CONSTANT_Package_info = cp.CONSTANT_Package_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  15. type CONSTANT_String_info = cp.CONSTANT_String_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  16. type CONSTANT_Utf8_info = cp.CONSTANT_Utf8_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader → Constant_PoolAbstractions
  17. abstract type ClassFile <: br.ClassFile
    Definition Classes
    ConstantPoolBinding → Constant_PoolAbstractions
  18. final type Constant_Pool = Array[(InvokedynamicRewriting.this)#Constant_Pool_Entry]
    Definition Classes
    Constant_PoolAbstractions
  19. type Constant_Pool_Entry = cp.Constant_Pool_Entry
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader → Constant_PoolAbstractions
  20. final type Constant_Pool_Index = Int
    Definition Classes
    Constant_PoolAbstractions
  21. type DeferredActionsStore = Buffer[((InvokedynamicRewriting.this)#ClassFile) ⇒ (InvokedynamicRewriting.this)#ClassFile] with (InvokedynamicRewriting.this)#Constant_Pool_Entry
    Definition Classes
    Constant_PoolAbstractions
  22. type Instructions = Array[Instruction]
    Definition Classes
    CodeBinding

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def CONSTANT_Class_info(i: Int): (InvokedynamicRewriting.this)#CONSTANT_Class_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  5. def CONSTANT_Double_info(d: Double): (InvokedynamicRewriting.this)#CONSTANT_Double_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  6. def CONSTANT_Fieldref_info(class_index: (InvokedynamicRewriting.this)#Constant_Pool_Index, name_and_type_index: (InvokedynamicRewriting.this)#Constant_Pool_Index): (InvokedynamicRewriting.this)#CONSTANT_Fieldref_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  7. def CONSTANT_Float_info(f: Float): (InvokedynamicRewriting.this)#CONSTANT_Float_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  8. def CONSTANT_Integer_info(i: Int): (InvokedynamicRewriting.this)#CONSTANT_Integer_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  9. def CONSTANT_InterfaceMethodref_info(class_index: (InvokedynamicRewriting.this)#Constant_Pool_Index, name_and_type_index: (InvokedynamicRewriting.this)#Constant_Pool_Index): (InvokedynamicRewriting.this)#CONSTANT_InterfaceMethodref_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  10. def CONSTANT_InvokeDynamic_info(bootstrap_method_attr_index: (InvokedynamicRewriting.this)#Constant_Pool_Index, name_and_type_index: (InvokedynamicRewriting.this)#Constant_Pool_Index): (InvokedynamicRewriting.this)#CONSTANT_InvokeDynamic_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  11. def CONSTANT_Long_info(l: Long): (InvokedynamicRewriting.this)#CONSTANT_Long_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  12. def CONSTANT_MethodHandle_info(reference_kind: Int, reference_index: Int): (InvokedynamicRewriting.this)#CONSTANT_MethodHandle_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  13. def CONSTANT_MethodType_info(descriptor_index: (InvokedynamicRewriting.this)#Constant_Pool_Index): (InvokedynamicRewriting.this)#CONSTANT_MethodType_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  14. def CONSTANT_Methodref_info(class_index: (InvokedynamicRewriting.this)#Constant_Pool_Index, name_and_type_index: (InvokedynamicRewriting.this)#Constant_Pool_Index): (InvokedynamicRewriting.this)#CONSTANT_Methodref_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  15. def CONSTANT_Module_info(name_index: (InvokedynamicRewriting.this)#Constant_Pool_Index): (InvokedynamicRewriting.this)#CONSTANT_Module_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  16. def CONSTANT_NameAndType_info(name_index: (InvokedynamicRewriting.this)#Constant_Pool_Index, descriptor_index: (InvokedynamicRewriting.this)#Constant_Pool_Index): (InvokedynamicRewriting.this)#CONSTANT_NameAndType_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  17. def CONSTANT_Package_info(name_index: (InvokedynamicRewriting.this)#Constant_Pool_Index): (InvokedynamicRewriting.this)#CONSTANT_Package_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  18. def CONSTANT_String_info(i: Int): (InvokedynamicRewriting.this)#CONSTANT_String_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  19. def CONSTANT_Utf8_info(r: Array[Byte], s: String): (InvokedynamicRewriting.this)#CONSTANT_Utf8_info
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  20. def Constant_Pool(in: DataInputStream): (InvokedynamicRewriting.this)#Constant_Pool
    Definition Classes
    Constant_PoolReader
  21. val Constant_Pool_EntryManifest: ClassTag[(InvokedynamicRewriting.this)#Constant_Pool_Entry]
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  22. val ScalaRuntimeObject: ObjectType
  23. def applyDeferredActions(cp: (InvokedynamicRewriting.this)#Constant_Pool, classFile: (InvokedynamicRewriting.this)#ClassFile): (InvokedynamicRewriting.this)#ClassFile
    Definition Classes
    Constant_PoolReader → Constant_PoolAbstractions
  24. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  25. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  26. implicit def cpIndexTocpEntry(index: (InvokedynamicRewriting.this)#Constant_Pool_Index)(implicit cp: (InvokedynamicRewriting.this)#Constant_Pool): (InvokedynamicRewriting.this)#Constant_Pool_Entry
    Definition Classes
    ConstantPoolBinding
  27. def createDeferredActionsStore(): (InvokedynamicRewriting.this)#DeferredActionsStore
    Attributes
    protected[this]
    Definition Classes
    ConstantPoolBinding → Constant_PoolReader
  28. def deferredInvokedynamicResolution(classFile: (InvokedynamicRewriting.this)#ClassFile, cp: (InvokedynamicRewriting.this)#Constant_Pool, methodNameIndex: (InvokedynamicRewriting.this)#Constant_Pool_Index, methodDescriptorIndex: (InvokedynamicRewriting.this)#Constant_Pool_Index, invokeDynamicInfo: (InvokedynamicRewriting.this)#CONSTANT_InvokeDynamic_info, instructions: Array[Instruction], pc: PC): (InvokedynamicRewriting.this)#ClassFile

    Resolves an org.opalj.br.instructions.INCOMPLETE_INVOKEDYNAMIC instruction using the BootstrapMethodTable of the class.

    Resolves an org.opalj.br.instructions.INCOMPLETE_INVOKEDYNAMIC instruction using the BootstrapMethodTable of the class.

    Deferred resolution is necessary since the BootstrapMethodTable – which is an attribute of the class file – is loaded after the methods.

    classFile

    The ClassFile with which the deferred action was registered.

    cp

    The class file's Constant_Pool.

    invokeDynamicInfo

    The org.opalj.br.instructions.INVOKEDYNAMIC instruction's constant pool entry.

    instructions

    This method's array of instructions.Instructions. (The array returned by the #Instructions method.)

    pc

    The program counter of the invokedynamic instruction.

    Definition Classes
    InvokedynamicRewritingDeferredInvokedynamicResolution
    Note

    This method is called (back) after the class file was completely loaded. Registration as a callback method happens whenever an invokedynamic instruction is found in a method's byte code.

    Overriding this Method

    To perform additional analyses on invokedynamic instructions, e.g., to fully resolve the call target, a subclass may override this method to do so. When you override this method, you should call this method (super.deferredResolveInvokedynamicInstruction) to ensure that the default resolution is carried out.

  29. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  30. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  31. def extractAltMetafactoryArguments(altMetafactoryArgs: Seq[BootstrapArgument]): (IndexedSeq[ReferenceType], IndexedSeq[MethodDescriptor], Boolean)

    Extract the parameters of altMetafactory calls.

    Extract the parameters of altMetafactory calls.

    CallSite altMetafactory(MethodHandles.Lookup caller, String invokedName, MethodType invokedType, Object... args)

    Object... args evaluates to the following argument list: int flags, int markerInterfaceCount, // IF flags has MARKERS set Class... markerInterfaces, // IF flags has MARKERS set int bridgeCount, // IF flags has BRIDGES set MethodType... bridges // IF flags has BRIDGES set

    flags is a bitwise OR of the desired flags FLAG_MARKERS, FLAG_BRIDGES and FLAG_SERIALIZABLE.

    altMetafactoryArgs

    Object... args of altMetafactory parameters

    returns

    A tuple containing an IndexSeq of markerInterfaces, bridges and a boolean indicating if the class must be serializable.

    See also

    https://docs.oracle.com/javase/8/docs/api/java/lang/invoke/LambdaMetafactory.html#altMetafactory-java.lang.invoke.MethodHandles.Lookup-java.lang.String-java.lang.invoke.MethodType-java.lang.Object...-

  32. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  33. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  34. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  35. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  36. val logLambdaExpressionsRewrites: Boolean
  37. val logStringConcatRewrites: Boolean
  38. val logUnknownInvokeDynamics: Boolean
  39. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  40. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  41. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  42. val performLambdaExpressionsRewriting: Boolean
  43. def registerDeferredAction(cp: (InvokedynamicRewriting.this)#Constant_Pool)(deferredAction: ((InvokedynamicRewriting.this)#ClassFile) ⇒ (InvokedynamicRewriting.this)#ClassFile): Unit
    Definition Classes
    Constant_PoolReader
  44. def storeProxy(classFile: (InvokedynamicRewriting.this)#ClassFile, proxy: (InvokedynamicRewriting.this)#ClassFile, reason: Option[AnyRef]): (InvokedynamicRewriting.this)#ClassFile
  45. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  46. def toString(): String
    Definition Classes
    AnyRef → Any
  47. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from CodeBinding

Inherited from ConstantPoolBinding

Inherited from Constant_PoolReader

Inherited from Constant_PoolAbstractions

Inherited from AnyRef

Inherited from Any

Ungrouped