Skip to content

Commit fdc01ea

Browse files
committed
BAEL-9118: added other tests
1 parent c4dd649 commit fdc01ea

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

libraries-bytecode/src/test/resources/chicory/graph.dot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Render with Graphviz, https://dreampuf.github.io/GraphvizOnline/?engine=dot
12
digraph WasmOnJVM {
23
rankdir=LR;
34
node [shape=box, style=rounded];
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Render with Graphviz, https://dreampuf.github.io/GraphvizOnline/?engine=dot
2+
digraph ImportsFlow {
3+
rankdir=LR;
4+
node [shape=box, style=rounded];
5+
6+
subgraph cluster_host {
7+
label="Host (JVM)";
8+
style=rounded;
9+
10+
junit [label="JUnit test"];
11+
store [label="Store\n(registers imports)"];
12+
doublef [label="HostFunction\nhost.double : (i32) -> i32"];
13+
inst [label="Chicory Instance"];
14+
}
15+
16+
subgraph cluster_module {
17+
label="Wasm module: imports.wasm";
18+
style=rounded;
19+
20+
importD [label="Import required:\nhost.double : (i32) -> i32"];
21+
useD [label="Exported function:\nuseDouble(i32) -> i32"];
22+
}
23+
24+
// Linking at instantiation
25+
store -> inst [label="instantiate with Store", style=dashed];
26+
importD -> doublef [label="resolved to HostFunction", style=dashed];
27+
28+
// Call flow at runtime
29+
junit -> inst [label="invoke useDouble(21)"];
30+
inst -> useD [label="call export"];
31+
useD -> importD[label="import call"];
32+
importD -> doublef [label="dispatch"];
33+
doublef -> inst [label="return i32 42"];
34+
inst -> junit [label="result as long[]{42}"];
35+
}

0 commit comments

Comments
 (0)