java.lang.Object
org.kink_lang.kink.internal.callstack.Lnums
Support class for lnums in the call stack.
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
getArgCount
(long lnum) Extracts argCount from the lnum.static int
getDataStackUsage
(long lnum) Extracts dataStackUsage from the lnum.static int
getProgramCounter
(long lnum) Extracts programCounter from the lnum.static long
makeLnum
(int programCounter, int argCount, int dataStackUsage) Makes an lnum composing three int nums.
-
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 bymakeLnum(int,int,int)
.- Returns:
- the programCounter.
-
getArgCount
public static int getArgCount(long lnum) Extracts argCount from the lnum.- Parameters:
lnum
- made bymakeLnum(int,int,int)
.- Returns:
- the argCount.
-
getDataStackUsage
public static int getDataStackUsage(long lnum) Extracts dataStackUsage from the lnum.- Parameters:
lnum
- made bymakeLnum(int,int,int)
.- Returns:
- the dataStackUsage.
-