[all-commits] [llvm/llvm-project] 6420f3: [WebAssembly] Implement an alternative translation...

YAMAMOTO Takashi via All-commits all-commits at lists.llvm.org
Mon Mar 25 18:12:18 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6420f379268e9178f9f938cef223194ad3daae4e
      https://github.com/llvm/llvm-project/commit/6420f379268e9178f9f938cef223194ad3daae4e
  Author: YAMAMOTO Takashi <yamamoto at midokura.com>
  Date:   2024-03-25 (Mon, 25 Mar 2024)

  Changed paths:
    M llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
    M llvm/test/CodeGen/WebAssembly/lower-em-ehsjlj-options.ll
    M llvm/test/CodeGen/WebAssembly/lower-em-ehsjlj.ll
    M llvm/test/CodeGen/WebAssembly/lower-em-sjlj-alias.ll
    M llvm/test/CodeGen/WebAssembly/lower-em-sjlj-debuginfo.ll
    M llvm/test/CodeGen/WebAssembly/lower-em-sjlj.ll
    M llvm/test/CodeGen/WebAssembly/lower-wasm-ehsjlj.ll
    M llvm/test/CodeGen/WebAssembly/lower-wasm-sjlj.ll

  Log Message:
  -----------
  [WebAssembly] Implement an alternative translation for -wasm-enable-sjlj (#84137)

Instead of maintaining per-function-invocation malloc()'ed tables to track which functions each label belongs to, store the equivalent info in jump buffers (jmp_buf) themselves.

Also, use a less emscripten-looking ABI symbols:
```
    saveSetjmp     -> __wasm_setjmp
    testSetjmp      -> __wasm_setjmp_test
    getTempRet0    -> (removed)
    __wasm_longjmp  -> (no change)
```

While I want to use this for WASI, it should work for emscripten as well.

An example runtime and a few tests:
https://github.com/yamt/garbage/tree/wasm-sjlj-alt2/wasm/longjmp

wasi-libc version of the runtime:
https://github.com/WebAssembly/wasi-libc/pull/483

emscripten version of the runtime:
https://github.com/emscripten-core/emscripten/pull/21502

Discussion:
https://docs.google.com/document/d/1ZvTPT36K5jjiedF8MCXbEmYjULJjI723aOAks1IdLLg/edit



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list