java.lang.Object
de.inetsoftware.jwebassembly.module.nativecode.StringTable

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

    • StringTable

      StringTable()
  • Method Details

    • stringConstant

      static 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:
      • invalid reference
        #STRING_CONSTANT_FUNCTION
    • getStringFromTable

      private static 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, 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