[PATCH] D53240: [WebAssembly] WebAssemblyLowerEmscriptenEHSjLj: use getter/setter for accessing tempRet0

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 17 07:58:13 PDT 2018


sbc100 added a comment.

In https://reviews.llvm.org/D53240#1264335, @aheejin wrote:

> - If `__THREW__`, `__threwValue`, and `__tempRet0` are all variables used to communicate between wasm and JS side, isn't it inconsistent that `__tempRet0` is the only function that requires a separate setter and getter here?
> - Pasted from my comment in emscripten repo <https://github.com/kripken/emscripten/issues/7273#issuecomment-429469606>: They are used to mean different things, and they don't even set the same thing (one sets a global variable in linear memory, and the other sets an wasm global). Should they share the same name in the first place?


We could convert __THREW__ and __threwValue to also be stored as wasm globals and also use a setter.   But for now I'm focusing on setTempRet0 and getTempRet0.  This change is one of three patches that unify the behavior.  Once they land all access will be via the binaryen-generated helper functions.   Part of the reason for doing it that way is that neither C code nor this emscripten pass can easily use wasm globals.


Repository:
  rL LLVM

https://reviews.llvm.org/D53240





More information about the llvm-commits mailing list