|
40 | 40 | */
|
41 | 41 | package org.graalvm.wasm;
|
42 | 42 |
|
43 |
| -import com.oracle.truffle.api.CompilerDirectives; |
44 | 43 | import org.graalvm.wasm.api.Vector128;
|
45 | 44 | import org.graalvm.wasm.exception.Failure;
|
46 | 45 | import org.graalvm.wasm.exception.WasmException;
|
47 | 46 | import org.graalvm.wasm.globals.WasmGlobal;
|
48 | 47 |
|
49 | 48 | import com.oracle.truffle.api.CompilerAsserts;
|
| 49 | +import com.oracle.truffle.api.CompilerDirectives; |
50 | 50 | import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
|
51 | 51 |
|
52 | 52 | /**
|
|
59 | 59 | public class GlobalRegistry {
|
60 | 60 | private static final int INITIAL_GLOBALS_SIZE = 8;
|
61 | 61 |
|
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; |
68 | 69 | @CompilationFinal(dimensions = 1) private WasmGlobal[] externalGlobals;
|
69 | 70 | private int globalCount;
|
70 | 71 | private int externalGlobalCount;
|
|
0 commit comments