java.lang.Object
org.kink_lang.kink.internal.callstack.Lnums

public final class Lnums extends Object
Support class for lnums in the call stack.
  • Method Details

    • makeLnum

      public static long makeLnum(int programCounter, int argCount, int dataStackUsage)
      Makes an lnum composing three int nums. Each arg must be unsigned 20bit int.
      Parameters:
      programCounter - the program counter.
      argCount - the count of args of the frame.
      dataStackUsage - the used size of dataStack.
      Returns:
      the lnum.
    • getProgramCounter

      public static int getProgramCounter(long lnum)
      Extracts programCounter from the lnum.
      Parameters:
      lnum - made by makeLnum(int,int,int).
      Returns:
      the programCounter.
    • getArgCount

      public static int getArgCount(long lnum)
      Extracts argCount from the lnum.
      Parameters:
      lnum - made by makeLnum(int,int,int).
      Returns:
      the argCount.
    • getDataStackUsage

      public static int getDataStackUsage(long lnum)
      Extracts dataStackUsage from the lnum.
      Parameters:
      lnum - made by makeLnum(int,int,int).
      Returns:
      the dataStackUsage.