Class StringManager
- All Implemented Interfaces:
Serializable, Cloneable, Map<String,Integer>, SequencedMap<String, Integer>
Handle all the constant strings. The constant strings will be write into the data section. At runtime the strings will be instantiate on the fly and hold in a table.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the positive id for the string.(package private) FunctionNameGet the function name object for the.invalid reference
#stringConstant(int)(package private) voidprepareFinish(ModuleWriter writer) Finish the prepare.private static voidwriteVaruint32(int value, OutputStream out) Write an unsigned integer.Methods inherited from class LinkedHashMap
clear, containsValue, entrySet, forEach, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, removeEldestEntry, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class AbstractMap
equals, hashCode, toStringMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from interface SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Field Details
-
stringConstantFunction
-
functions
-
stringMemoryOffset
private int stringMemoryOffset
-
-
Constructor Details
-
StringManager
StringManager(WasmOptions options) Create a new instance.- Parameters:
options- compiler properties and shared managers
-
-
Method Details
-
get
-
getStringConstantFunction
Get the function name object for the.invalid reference
#stringConstant(int)- Returns:
- the name
- See Also:
-
prepareFinish
Finish the prepare. Now no new strings should be added.- Parameters:
writer- the targets for the strings- Throws:
IOException- if any I/O error occur
-
writeVaruint32
Write an unsigned integer.- Parameters:
value- the valueout- target stream- Throws:
IOException- if an I/O error occurs.
-