Class StringTable
java.lang.Object
de.inetsoftware.jwebassembly.module.nativecode.StringTable
The WASm string table to create String constant on the fly and hold it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
getIntFromMemory
(int pos) WASM codeprivate static String
getStringFromTable
(int strIdx) WASM codeprivate static byte
getUnsignedByteFromMemory
(int pos) WASM codeprivate static void
setStringIntoTable
(int strIdx, String str) WASM code(package private) static String
stringConstant
(int strIdx) WASM codeprivate static int
WASM code
-
Constructor Details
-
StringTable
StringTable()
-
-
Method Details
-
stringConstant
WASM codeGet a constant string from the table.
- Parameters:
strIdx
- the id/index of the string.- Returns:
- the string
- See Also:
-
getStringFromTable
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
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
-