Skip to content

Commit b632e46

Browse files
committed
Growable global variable arrays should not be compilation-final.
1 parent 90732e1 commit b632e46

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/GlobalRegistry.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
*/
4141
package org.graalvm.wasm;
4242

43-
import com.oracle.truffle.api.CompilerDirectives;
4443
import org.graalvm.wasm.api.Vector128;
4544
import org.graalvm.wasm.exception.Failure;
4645
import org.graalvm.wasm.exception.WasmException;
4746
import org.graalvm.wasm.globals.WasmGlobal;
4847

4948
import com.oracle.truffle.api.CompilerAsserts;
49+
import com.oracle.truffle.api.CompilerDirectives;
5050
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
5151

5252
/**
@@ -59,12 +59,13 @@
5959
public class GlobalRegistry {
6060
private static final int INITIAL_GLOBALS_SIZE = 8;
6161

62-
// If we support late linking, we need to ensure that methods accessing the global array
63-
// are compiled with assumptions on what this field points to.
64-
// Such an assumption can be invalidated if the late-linking causes this array
65-
// to be replaced with a larger array.
66-
@CompilationFinal(dimensions = 0) private long[] globals;
67-
@CompilationFinal(dimensions = 0) private Object[] objectGlobals;
62+
/**
63+
* If we support late linking, and the global arrays are @CompilationFinal, we need to ensure
64+
* that methods accessing the global array are compiled with assumptions that will be
65+
* invalidated if the late linking causes this array to be replaced with a larger array.
66+
*/
67+
private long[] globals;
68+
private Object[] objectGlobals;
6869
@CompilationFinal(dimensions = 1) private WasmGlobal[] externalGlobals;
6970
private int globalCount;
7071
private int externalGlobalCount;

0 commit comments

Comments
 (0)