Class StringTable


  • class StringTable
    extends java.lang.Object
    The WASm string table to create String constant on the fly and hold it.
    • Constructor Detail

      • StringTable

        StringTable()
    • Method Detail

      • stringConstant

        static java.lang.String stringConstant​(int strIdx)
        WASM code

        Get a constant string from the table.

        Parameters:
        strIdx - the id/index of the string.
        Returns:
        the string
        See Also:
        #STRING_CONSTANT_FUNCTION
      • getStringFromTable

        private static java.lang.String getStringFromTable​(int strIdx)
        WASM code

        Get a string from the string table. Should be inlined from the optimizer.

        Parameters:
        strIdx - the id/index of the string.
        Returns:
        the string or null if not already set.
      • setStringIntoTable

        private static void setStringIntoTable​(int strIdx,
                                               java.lang.String str)
        WASM code

        Set a string in the string table. Should be inlined from the optimizer.

        Parameters:
        strIdx - the id/index of the string.
        str - the string
      • stringsMemoryOffset

        private static int stringsMemoryOffset()
        WASM code

        Placeholder for a synthetic function. Should be inlined from the optimizer.

        Returns:
        the memory offset of the serialized string data in the element section
      • getIntFromMemory

        private static int getIntFromMemory​(int pos)
        WASM code

        Load an i32 from memory. The offset must be aligned. Should be inlined from the optimizer.

        Parameters:
        pos - the memory position
        Returns:
        the value from the memory
      • getUnsignedByteFromMemory

        private static byte getUnsignedByteFromMemory​(int pos)
        WASM code

        Load a byte from the memory. Should be inlined from the optimizer.

        Parameters:
        pos - the memory position
        Returns:
        the value from the memory