|
27 | 27 | // The approach here is a third-generation design after Emscripten's original |
28 | 28 | // Asyncify and then Emterpreter-Async approaches: |
29 | 29 | // |
30 | | -// * Asyncify rewrote control flow in LLVM IR. A problem is that this needs |
31 | | -// to save all SSA registers as part of the local state, which can be |
| 30 | +// * Old Asyncify rewrote control flow in LLVM IR. A problem is that this |
| 31 | +// needs to save all SSA registers as part of the local state, which can be |
32 | 32 | // very costly. A further increase can happen because of phis that are |
33 | 33 | // added because of control flow transformations. As a result we saw |
34 | 34 | // pathological cases where the code size increase was unacceptable. |
|
40 | 40 | // high-speed code that it calls, and in which cannot be an async operation, |
41 | 41 | // remain at full speed. |
42 | 42 | // |
43 | | -// Asyncify's design learns from both of those: |
| 43 | +// New Asyncify's design learns from both of those: |
44 | 44 | // |
45 | 45 | // * The code rewrite is done in Binaryen, that is, at the wasm level. At |
46 | 46 | // this level we will only need to save wasm locals, which is a much smaller |
|
49 | 49 | // for obvious reasons, while Emterpreter-Async proved it is tolerable to |
50 | 50 | // have *some* overhead, if the transform can be applied selectively. |
51 | 51 | // |
52 | | -// The specific transform implemented here is simpler than Asyncify but should |
53 | | -// still have low overhead when properly optimized. Asyncify worked at the CFG |
54 | | -// level and added branches there; Asyncify on the other hand works on the |
| 52 | +// The specific transform implemented here is nicknamed "Bysyncify" (as it is |
| 53 | +// in BinarYen, and "B" comes after "A"). It is simpler than old Asyncify but |
| 54 | +// has low overhead when properly optimized. Old Asyncify worked at the CFG |
| 55 | +// level and added branches there; new Asyncify on the other hand works on the |
55 | 56 | // structured control flow of wasm and simply "skips over" code when rewinding |
56 | 57 | // the stack, and jumps out when unwinding. The transformed code looks |
57 | 58 | // conceptually like this: |
|
0 commit comments