Packages

o

scala.tools.nsc.backend.jvm.opt

BytecodeUtils

object BytecodeUtils

Source
BytecodeUtils.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BytecodeUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit final class AnalyzerExtensions[V <: Value] extends AnyVal
  2. implicit final class FrameExtensions[V <: Value] extends AnyVal

Value Members

  1. def cloneLabels(methodNode: MethodNode): Map[LabelNode, LabelNode]
  2. def cloneLocalVariableNodes(methodNode: MethodNode, labelMap: Map[LabelNode, LabelNode], calleeMethodName: String, shift: Int): List[LocalVariableNode]

    Clone the local variable descriptors of methodNode and map their start and end labels according to the labelMap.

  3. def cloneTryCatchBlockNodes(methodNode: MethodNode, labelMap: Map[LabelNode, LabelNode]): List[TryCatchBlockNode]

    Clone the local try/catch blocks of methodNode and map their start and end and handler labels according to the labelMap.

  4. def codeSizeOKForInlining(caller: MethodNode, callee: MethodNode): Boolean
  5. def finalJumpTarget(source: JumpInsnNode): LabelNode
  6. def fixLoadedNothingOrNullValue(loadedType: Type, loadInstr: AbstractInsnNode, methodNode: MethodNode, bTypes: BTypes): Unit

    This method is used by optimizer components to eliminate phantom values of instruction that load a value of type Nothing$ or Null$.

    This method is used by optimizer components to eliminate phantom values of instruction that load a value of type Nothing$ or Null$. Such values on the stack don't interact well with stack map frames.

    For example, opt.getOrElse(throw e) is re-written to an invocation of the lambda body, a method with return type Nothing$. Similarly for opt.getOrElse(null) and Null$.

    During bytecode generation this is handled by BCodeBodyBuilder.adapt. See the comment in that method which explains the issue with such phantom values.

  7. def getPop(size: Int): InsnNode
  8. def hasCallerSensitiveAnnotation(methodNode: MethodNode): Boolean
  9. def instructionResultSize(insn: AbstractInsnNode): Int
  10. def isAbstractMethod(methodNode: MethodNode): Boolean
  11. def isCall(instruction: AbstractInsnNode): Boolean
  12. def isConditionalJump(instruction: AbstractInsnNode): Boolean
  13. def isConstructor(methodNode: MethodNode): Boolean
  14. def isExecutable(instruction: AbstractInsnNode): Boolean
  15. def isFinalClass(classNode: ClassNode): Boolean
  16. def isFinalMethod(methodNode: MethodNode): Boolean
  17. def isInterface(classNode: ClassNode): Boolean
  18. def isJumpNonJsr(instruction: AbstractInsnNode): Boolean
  19. def isLoad(instruction: AbstractInsnNode): Boolean
  20. def isLoadOrStore(instruction: AbstractInsnNode): Boolean
  21. def isLoadStoreOrRet(instruction: AbstractInsnNode): Boolean
  22. def isNativeMethod(methodNode: MethodNode): Boolean
  23. def isNonVirtualCall(instruction: AbstractInsnNode): Boolean
  24. def isPrivateMethod(methodNode: MethodNode): Boolean
  25. def isPublicMethod(methodNode: MethodNode): Boolean
  26. def isReference(t: Type): Boolean
  27. def isReturn(instruction: AbstractInsnNode): Boolean
  28. def isSize2LoadOrStore(opcode: Int): Boolean
  29. def isStaticMethod(methodNode: MethodNode): Boolean
  30. def isStore(instruction: AbstractInsnNode): Boolean
  31. def isStrictfpMethod(methodNode: MethodNode): Boolean
  32. def isSynchronizedMethod(methodNode: MethodNode): Boolean
  33. def isVirtualCall(instruction: AbstractInsnNode): Boolean
  34. def loadZeroForTypeSort(sort: Int): InsnNode
  35. final val maxJVMMethodSize: Int(65535)
  36. final val maxMethodSizeAfterInline: Int
  37. def negateJumpOpcode(jumpOpcode: Int): Int
  38. def newLabelNode: LabelNode

    Create a new LabelNode with a correctly associated Label.

  39. def nextExecutableInstruction(insn: AbstractInsnNode, alsoKeep: (AbstractInsnNode) ⇒ Boolean = Set()): Option[AbstractInsnNode]
    Annotations
    @tailrec()
  40. def nextExecutableInstructionOrLabel(insn: AbstractInsnNode): Option[AbstractInsnNode]
    Annotations
    @tailrec()
  41. def parametersSize(methodNode: MethodNode): Int

    The number of local variable slots used for parameters and for the this reference.

  42. def previousExecutableInstruction(insn: AbstractInsnNode, stopBefore: (AbstractInsnNode) ⇒ Boolean = Set()): Option[AbstractInsnNode]

    Find the nearest preceding node to insn which is executable (i.e., not a label / line number) and which is not selected by stopBefore.

    Find the nearest preceding node to insn which is executable (i.e., not a label / line number) and which is not selected by stopBefore.

    Annotations
    @tailrec()
  43. def removeJumpAndAdjustStack(method: MethodNode, jump: JumpInsnNode): Unit
  44. def removeLineNumberNodes(instructions: InsnList): Unit
  45. def removeLineNumberNodes(classNode: ClassNode): Unit
  46. def sameTargetExecutableInstruction(a: JumpInsnNode, b: JumpInsnNode): Boolean
  47. def substituteLabel(reference: AnyRef, from: LabelNode, to: LabelNode): Unit
  48. object ConditionalJump
  49. object Goto
  50. object JumpNonJsr
  51. object VarInstruction