mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Add support for string pools over 10000 strings
This commit is contained in:
parent
bf15f0e299
commit
4f431f4170
|
@ -93,12 +93,18 @@ public class WasmGCStringPool implements WasmGCStringProvider, WasmGCInitializer
|
||||||
void.class));
|
void.class));
|
||||||
function.getBody().add(new WasmCall(internInit));
|
function.getBody().add(new WasmCall(internInit));
|
||||||
}
|
}
|
||||||
|
var stringIterator = stringMap.values().iterator();
|
||||||
|
while (stringIterator.hasNext()) {
|
||||||
|
var elementCount = 0;
|
||||||
var array = new WasmArrayNewFixed(stringsArray);
|
var array = new WasmArrayNewFixed(stringsArray);
|
||||||
for (var str : stringMap.values()) {
|
// WasmArrayNewFixed cannot be larger than 10000 elements
|
||||||
array.getElements().add(new WasmGetGlobal(str.global));
|
while (elementCount < 10000 && stringIterator.hasNext()) {
|
||||||
|
array.getElements().add(new WasmGetGlobal(stringIterator.next().global));
|
||||||
|
++elementCount;
|
||||||
}
|
}
|
||||||
function.getBody().add(new WasmCall(initStringsFunction, array));
|
function.getBody().add(new WasmCall(initStringsFunction, array));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WasmGCStringConstant getStringConstant(String string) {
|
public WasmGCStringConstant getStringConstant(String string) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user