Class StringTable
- java.lang.Object
-
- de.inetsoftware.jwebassembly.module.nativecode.StringTable
-
class StringTable extends java.lang.ObjectThe WASm string table to create String constant on the fly and hold it.
-
-
Constructor Summary
Constructors Constructor Description StringTable()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static intgetIntFromMemory(int pos)WASM codeprivate static java.lang.StringgetStringFromTable(int strIdx)WASM codeprivate static bytegetUnsignedByteFromMemory(int pos)WASM codeprivate static voidsetStringIntoTable(int strIdx, java.lang.String str)WASM code(package private) static java.lang.StringstringConstant(int strIdx)WASM codeprivate static intstringsMemoryOffset()WASM code
-
-
-
Method Detail
-
stringConstant
static java.lang.String stringConstant(int strIdx)
WASM codeGet 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 codeGet 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 codeSet 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 codePlaceholder 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 codeLoad 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 codeLoad a byte from the memory. Should be inlined from the optimizer.
- Parameters:
pos- the memory position- Returns:
- the value from the memory
-
-