mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 00:04:10 -08:00
wasm gc: add support for string pools over 10000 strings (#977)
Due to limit in spec that allows `ref.array_new_fixed` to take up to 10000 arguments
This commit is contained in:
parent
bf15f0e299
commit
516602d32d
|
@ -93,11 +93,17 @@ public class WasmGCStringPool implements WasmGCStringProvider, WasmGCInitializer
|
||||||
void.class));
|
void.class));
|
||||||
function.getBody().add(new WasmCall(internInit));
|
function.getBody().add(new WasmCall(internInit));
|
||||||
}
|
}
|
||||||
var array = new WasmArrayNewFixed(stringsArray);
|
var stringIterator = stringMap.values().iterator();
|
||||||
for (var str : stringMap.values()) {
|
while (stringIterator.hasNext()) {
|
||||||
array.getElements().add(new WasmGetGlobal(str.global));
|
var elementCount = 0;
|
||||||
|
var array = new WasmArrayNewFixed(stringsArray);
|
||||||
|
// WasmArrayNewFixed cannot be larger than 10000 elements
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user