Class StackInspector


  • class StackInspector
    extends java.lang.Object
    Inspect the current parsed instructions to find details over specific stack information.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  StackInspector.StackValue
      Hold the state of the stack.
    • Constructor Summary

      Constructors 
      Constructor Description
      StackInspector()  
    • Constructor Detail

      • StackInspector

        StackInspector()
    • Method Detail

      • findInstructionThatPushValue

        @Nonnull
        static StackInspector.StackValue findInstructionThatPushValue​(java.util.List<WasmInstruction> instructions,
                                                                      int count,
                                                                      int javaCodePos)
        Inspect the instructions to find details over a specific stack position.
        Parameters:
        instructions - the parsed instructions
        count - the count of values on the stack back. 1 means the last value. 2 means the penultimate value.
        javaCodePos - the current code position, important to follow jumps in the code
        Returns:
        details of the stack position