Class Frame

java.lang.Object
de.uzl.its.swat.symbolic.Frame

public class Frame extends Object
A symbolic Stack Frame that stores Values in the symbolic Stack and symbolic locals
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    Number of words that are returned on invoke method end
  • Constructor Summary

    Constructors
    Constructor
    Description
    Frame(String className, String methodName, int nReturnWords)
    Constructor for Frame
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addLocal(Value<?,?> o)
    Sets a Value into the symbolic locals at a specific index If the index is larger than the current max, a Placeholder Values are added until the index is reached
    void
    addLocal2(Value<?,?> o)
    Adds a two byte Value into the symbolic locals, at the next available index (not Placeholder) The two bytes are reflected by first adding a placeholder and then the actual value
    void
    Clears the symbolic stack
     
    Value<?,?>
    getLocal(int index)
    Gets a Value from the symbolic locals
    Value<?,?>
    getLocal2(int index)
    Gets a two byte Value from the symbolic locals
    The symbolic version of Javas locals -- GETTER -- Gets all locals of the Frame (used for lambdas)
     
    Value<?,?>
     
    The symbolic version of Javas stack
    Value<?,?>
    Peeks at the top element on the symbolic stack without popping it
    Value<?,?>
    Peeks at the top 2 elements on the symbolic stack without popping them
    Value<?,?>
    pop()
    Pops the top element from the symbolic stack
    Value<?,?>
    Pops the top 2 elements from the symbolic stack
    void
     
    void
    push(Value<?,?> o)
    Pushes one element onto the symbolic stack
    void
    push2(Value<?,?> o)
    Pushes 2 elements onto the symbolic stack (used for e.g.
    void
    setLocal(int index, Value<?,?> o)
    Sets a Value into the symbolic locals at a specific index If the index is larger than the current max, a Placeholder Values are added until the index is reached
    void
    setLocal2(int index, Value<?,?> o)
    Sets a two byte Value into the symbolic locals at a specific index If the index is larger than the current max, Placeholder Values are added until the index is reached The two bytes are reflected by first adding a placeholder and then the actual value
    void
    setRet(Value<?,?> v)
    Setter for the return value of the symbolic stack frame
    Override of the default toString method for printing the Current symbolic stack frame and locals

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • nReturnWords

      public final int nReturnWords
      Number of words that are returned on invoke method end
  • Constructor Details

    • Frame

      public Frame(String className, String methodName, int nReturnWords)
      Constructor for Frame
      Parameters:
      nReturnWords - Number of words that are returned on invoke method end
  • Method Details

    • setRet

      public void setRet(Value<?,?> v)
      Setter for the return value of the symbolic stack frame
      Parameters:
      v - The return value for the invoked method
    • addLocal

      public void addLocal(Value<?,?> o)
      Sets a Value into the symbolic locals at a specific index If the index is larger than the current max, a Placeholder Values are added until the index is reached
      Parameters:
      o - The Value that should be placed into the symbolic locals
    • addLocal2

      public void addLocal2(Value<?,?> o)
      Adds a two byte Value into the symbolic locals, at the next available index (not Placeholder) The two bytes are reflected by first adding a placeholder and then the actual value
      Parameters:
      o - The Value that should be placed into the symbolic locals
    • setLocal

      public void setLocal(int index, Value<?,?> o)
      Sets a Value into the symbolic locals at a specific index If the index is larger than the current max, a Placeholder Values are added until the index is reached
      Parameters:
      index - The index of the value
      o - The Value that should be placed into the symbolic locals
    • getLocal

      public Value<?,?> getLocal(int index)
      Gets a Value from the symbolic locals
      Parameters:
      index - The index to get from the symbolic locals, if the index does not exist, returns a Placeholder
      Returns:
      The Value at position index in the symbolic locals
    • setLocal2

      public void setLocal2(int index, Value<?,?> o)
      Sets a two byte Value into the symbolic locals at a specific index If the index is larger than the current max, Placeholder Values are added until the index is reached The two bytes are reflected by first adding a placeholder and then the actual value
      Parameters:
      index - The index of the value
      o - The Value that should be placed into the symbolic locals
    • getLocal2

      public Value<?,?> getLocal2(int index)
      Gets a two byte Value from the symbolic locals
      Parameters:
      index - The index of the Value
      Returns:
      The Value if the index exists, else a Placeholder
    • push

      public void push(Value<?,?> o)
      Pushes one element onto the symbolic stack
      Parameters:
      o - Value to be pushed onto the symbolic stack
    • push2

      public void push2(Value<?,?> o)
      Pushes 2 elements onto the symbolic stack (used for e.g. for two byte datatype. THe second pushed value is a placeholder)
      Parameters:
      o - Value to be pushed onto the symbolic stack
    • pop

      public Value<?,?> pop()
      Pops the top element from the symbolic stack
      Returns:
      the top element from the symbolic stack
    • pop2

      public Value<?,?> pop2()
      Pops the top 2 elements from the symbolic stack
      Returns:
      the top two elements from the symbolic stack
    • peek

      public Value<?,?> peek()
      Peeks at the top element on the symbolic stack without popping it
      Returns:
      the top element from the symbolic stack
    • peek2

      public Value<?,?> peek2()
      Peeks at the top 2 elements on the symbolic stack without popping them
      Returns:
      the top two elements from the symbolic stack
    • clear

      public void clear()
      Clears the symbolic stack
    • printStack

      public void printStack()
    • toString

      public String toString()
      Override of the default toString method for printing the Current symbolic stack frame and locals
      Overrides:
      toString in class Object
      Returns:
      A string representation of the current symbolic stack frame and locals
    • getLocals

      public ArrayList<Value<?,?>> getLocals()
      The symbolic version of Javas locals -- GETTER -- Gets all locals of the Frame (used for lambdas)
      Returns:
      All locals
    • getStack

      public ArrayList<Value<?,?>> getStack()
      The symbolic version of Javas stack
    • getRet

      public Value<?,?> getRet()
    • getClassName

      public String getClassName()
    • getMethodName

      public String getMethodName()