Commit 8f38f35
authored
Support Emscripten EH/SjLj in Wasm64 (#14357)
This mostly changes some `uint32_t`s to `uintptr_t` in libraries for EH
and SjLj to support wasm64.
More details in case you are interested:
1. I described in https://reviews.llvm.org/D101985 how changing the
first argument of `emscripten_longjmp` in turn changed `testSetjmp`'s
first argument to `uintptr_t`.
2. `testSetjmp`'s first argument `id` is compared with the local
variable `curr`. So it's `uintptr_t` now:
[Link](https://github.com/emscripten-core/emscripten/blob/aa2bad5d6a0de5b175688fc8ead46f70a1b43a0d/system/lib/compiler-rt/emscripten_setjmp.c#L53)
3. That `curr` is set from `table[i].id`, which is `TableEntry.id`. So
`id` in `TableEntry` here is now `uintptr_t`:
[Link](https://github.com/emscripten-core/emscripten/blob/aa2bad5d6a0de5b175688fc8ead46f70a1b43a0d/system/lib/compiler-rt/emscripten_setjmp.c#L51)
4. Because `table[i].id` is set from `setjmpId`, `setjmpId` needs to be
`uintptr_t` too:
[Link](https://github.com/emscripten-core/emscripten/blob/aa2bad5d6a0de5b175688fc8ead46f70a1b43a0d/system/lib/compiler-rt/emscripten_setjmp.c#L31)
5. Because `setjmpId` is stored in `env` (first parameter) in
`saveSetjmp`, `saveSetjmp`'s first argument has to change to
`uintptr_t`:
[Link](https://github.com/emscripten-core/emscripten/blob/aa2bad5d6a0de5b175688fc8ead46f70a1b43a0d/system/lib/compiler-rt/emscripten_setjmp.c#L28)
Not sure how to add tests for this given that wasm64 support is not
ready yet. Existing tests run fine.1 parent 1647d14 commit 8f38f35
File tree
2 files changed
+13
-8
lines changed- system/lib/compiler-rt
2 files changed
+13
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | | - | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | | - | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
22 | | - | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
48 | | - | |
49 | | - | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | | - | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
0 commit comments