Search in sources :

Example 11 with Sym

use of org.graalvm.wasm.Linker.ResolutionDag.Sym in project graal by oracle.

the class Linker method resolveGlobalInitialization.

void resolveGlobalInitialization(WasmContext context, WasmInstance instance, int globalIndex, int sourceGlobalIndex) {
    final Runnable resolveAction = () -> {
        final int sourceAddress = instance.globalAddress(sourceGlobalIndex);
        final int address = instance.globalAddress(globalIndex);
        final GlobalRegistry globals = context.globals();
        globals.storeLong(address, globals.loadAsLong(sourceAddress));
    };
    final Sym[] dependencies = new Sym[] { new InitializeGlobalSym(instance.name(), sourceGlobalIndex) };
    resolutionDag.resolveLater(new InitializeGlobalSym(instance.name(), globalIndex), dependencies, resolveAction);
}
Also used : ElemSym(org.graalvm.wasm.Linker.ResolutionDag.ElemSym) ExportMemorySym(org.graalvm.wasm.Linker.ResolutionDag.ExportMemorySym) ExportTableSym(org.graalvm.wasm.Linker.ResolutionDag.ExportTableSym) InitializeGlobalSym(org.graalvm.wasm.Linker.ResolutionDag.InitializeGlobalSym) ExportFunctionSym(org.graalvm.wasm.Linker.ResolutionDag.ExportFunctionSym) CodeEntrySym(org.graalvm.wasm.Linker.ResolutionDag.CodeEntrySym) CallsiteSym(org.graalvm.wasm.Linker.ResolutionDag.CallsiteSym) ImportMemorySym(org.graalvm.wasm.Linker.ResolutionDag.ImportMemorySym) ExportGlobalSym(org.graalvm.wasm.Linker.ResolutionDag.ExportGlobalSym) ImportFunctionSym(org.graalvm.wasm.Linker.ResolutionDag.ImportFunctionSym) Sym(org.graalvm.wasm.Linker.ResolutionDag.Sym) ImportTableSym(org.graalvm.wasm.Linker.ResolutionDag.ImportTableSym) ImportGlobalSym(org.graalvm.wasm.Linker.ResolutionDag.ImportGlobalSym) DataSym(org.graalvm.wasm.Linker.ResolutionDag.DataSym) InitializeGlobalSym(org.graalvm.wasm.Linker.ResolutionDag.InitializeGlobalSym)

Example 12 with Sym

use of org.graalvm.wasm.Linker.ResolutionDag.Sym in project graal by oracle.

the class Linker method resolveGlobalInitialization.

void resolveGlobalInitialization(WasmInstance instance, int globalIndex) {
    final Sym[] dependencies = ResolutionDag.NO_DEPENDENCIES;
    resolutionDag.resolveLater(new InitializeGlobalSym(instance.name(), globalIndex), dependencies, NO_RESOLVE_ACTION);
}
Also used : ElemSym(org.graalvm.wasm.Linker.ResolutionDag.ElemSym) ExportMemorySym(org.graalvm.wasm.Linker.ResolutionDag.ExportMemorySym) ExportTableSym(org.graalvm.wasm.Linker.ResolutionDag.ExportTableSym) InitializeGlobalSym(org.graalvm.wasm.Linker.ResolutionDag.InitializeGlobalSym) ExportFunctionSym(org.graalvm.wasm.Linker.ResolutionDag.ExportFunctionSym) CodeEntrySym(org.graalvm.wasm.Linker.ResolutionDag.CodeEntrySym) CallsiteSym(org.graalvm.wasm.Linker.ResolutionDag.CallsiteSym) ImportMemorySym(org.graalvm.wasm.Linker.ResolutionDag.ImportMemorySym) ExportGlobalSym(org.graalvm.wasm.Linker.ResolutionDag.ExportGlobalSym) ImportFunctionSym(org.graalvm.wasm.Linker.ResolutionDag.ImportFunctionSym) Sym(org.graalvm.wasm.Linker.ResolutionDag.Sym) ImportTableSym(org.graalvm.wasm.Linker.ResolutionDag.ImportTableSym) ImportGlobalSym(org.graalvm.wasm.Linker.ResolutionDag.ImportGlobalSym) DataSym(org.graalvm.wasm.Linker.ResolutionDag.DataSym) InitializeGlobalSym(org.graalvm.wasm.Linker.ResolutionDag.InitializeGlobalSym)

Aggregations

CallsiteSym (org.graalvm.wasm.Linker.ResolutionDag.CallsiteSym)12 CodeEntrySym (org.graalvm.wasm.Linker.ResolutionDag.CodeEntrySym)12 DataSym (org.graalvm.wasm.Linker.ResolutionDag.DataSym)12 ElemSym (org.graalvm.wasm.Linker.ResolutionDag.ElemSym)12 ExportFunctionSym (org.graalvm.wasm.Linker.ResolutionDag.ExportFunctionSym)12 ExportGlobalSym (org.graalvm.wasm.Linker.ResolutionDag.ExportGlobalSym)12 ExportMemorySym (org.graalvm.wasm.Linker.ResolutionDag.ExportMemorySym)12 ExportTableSym (org.graalvm.wasm.Linker.ResolutionDag.ExportTableSym)12 ImportFunctionSym (org.graalvm.wasm.Linker.ResolutionDag.ImportFunctionSym)12 ImportGlobalSym (org.graalvm.wasm.Linker.ResolutionDag.ImportGlobalSym)12 ImportMemorySym (org.graalvm.wasm.Linker.ResolutionDag.ImportMemorySym)12 ImportTableSym (org.graalvm.wasm.Linker.ResolutionDag.ImportTableSym)12 InitializeGlobalSym (org.graalvm.wasm.Linker.ResolutionDag.InitializeGlobalSym)12 Sym (org.graalvm.wasm.Linker.ResolutionDag.Sym)12 ArrayList (java.util.ArrayList)3 CallTarget (com.oracle.truffle.api.CallTarget)1 List (java.util.List)1 WasmMemory (org.graalvm.wasm.memory.WasmMemory)1