Class StackManipulationImplementor

java.lang.Object
ai.timefold.jpyinterpreter.implementors.StackManipulationImplementor

public class StackManipulationImplementor extends Object
Implementations of stack manipulation opcodes (rotations, pop, duplication, etc.)
  • Constructor Details

    • StackManipulationImplementor

      public StackManipulationImplementor()
  • Method Details

    • swap

      public static void swap(org.objectweb.asm.MethodVisitor methodVisitor)
      Swaps TOS and TOS1: (i.e. ..., TOS1, TOS -> ..., TOS, TOS1)
    • rotateThree

      public static void rotateThree(org.objectweb.asm.MethodVisitor methodVisitor)
      Move TOS down two places, and pushes TOS1 and TOS2 up one: (i.e. ..., TOS2, TOS1, TOS -> ..., TOS, TOS2, TOS1)
    • rotateFour

      public static void rotateFour(FunctionMetadata functionMetadata, StackMetadata stackMetadata)
      Move TOS down three places, and pushes TOS1, TOS2 and TOS3 up one: (i.e. ..., TOS3, TOS2, TOS1, TOS -> ..., TOS, TOS3, TOS2, TOS1)
    • popTOS

      public static void popTOS(org.objectweb.asm.MethodVisitor methodVisitor)
      Pops TOS. (i.e. ..., TOS -> ...)
    • duplicateTOS

      public static void duplicateTOS(org.objectweb.asm.MethodVisitor methodVisitor)
      Duplicates TOS. (i.e. ..., TOS -> ..., TOS, TOS)
    • duplicateTOSAndTOS1

      public static void duplicateTOSAndTOS1(org.objectweb.asm.MethodVisitor methodVisitor)
      Duplicates TOS and TOS1. (i.e. ..., TOS1, TOS -> ..., TOS1, TOS, TOS1, TOS)
    • duplicateToTOS

      public static void duplicateToTOS(FunctionMetadata functionMetadata, StackMetadata stackMetadata, int posFromTOS)
      Copies TOS[posFromTOS] to TOS, leaving other stack elements in their original place (i.e. ..., TOS[posFromTOS], ..., TOS2, TOS1, TOS -> ..., TOS[posFromTOS], ..., TOS2, TOS1, TOS, TOS[posFromTOS])
    • shiftTOSDownBy

      public static StackMetadata shiftTOSDownBy(FunctionMetadata functionMetadata, StackMetadata stackMetadata, int posFromTOS)
      Copies TOS to TOS[posFromTOS], moving other stack elements up by one (i.e. ..., TOS[posFromTOS], ..., TOS2, TOS1, TOS -> ..., TOS, TOS[posFromTOS] ..., TOS2, TOS1)
    • swapTOSWithIndex

      public static StackMetadata swapTOSWithIndex(FunctionMetadata functionMetadata, StackMetadata stackMetadata, int posFromTOS)
      Swaps TOS with TOS[posFromTOS] (i.e. ..., TOS[posFromTOS], ..., TOS2, TOS1, TOS -> ..., TOS, ..., TOS2, TOS1, TOS[posFromTOS])
    • storeStack

      public static int[] storeStack(org.objectweb.asm.MethodVisitor methodVisitor, StackMetadata stackMetadata)
    • restoreStack

      public static void restoreStack(org.objectweb.asm.MethodVisitor methodVisitor, StackMetadata stackMetadata, int[] stackLocalVariables)
    • storeExceptionTableStack

      public static void storeExceptionTableStack(FunctionMetadata functionMetadata, StackMetadata stackMetadata, ExceptionBlock exceptionBlock)
    • restoreExceptionTableStack

      public static void restoreExceptionTableStack(FunctionMetadata functionMetadata, StackMetadata stackMetadata, ExceptionBlock exceptionBlock)