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

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 18 00:41:17 PDT 2018


sbc100 added a comment.

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

> > The alternative you are suggesting is to create several sets of global+getter+setter right? getReturnHighBits/setReturnHighBits/__returnHighBit + getLongJmpArg/setLongJmpArg/__longJmpArg ... etc.
>
> Not really. What I was suggesting was use different names for EH's `__tempRet0` and `other.test_sixtyfour_bit_return_value`'s `__tempRet0`, add getter or setter for each of them only if it is necessary, and that's all. In other words what I meant was we might not need to impose a strict getter/setter rules for every variable, because we don't know how many we will end up with. Person who creates a new variable can add getter or setter in the library if it is necessary, but I was not sure if we want to impose a strict rule that all of getter and setter for cross-communicating variables should be generated from binaryen's legalize-js-interface.


This change doesn't mind if its binaryen's legalize-js-interface defines this stuff, or if they come from a C library.  The main point of this change is to allow whoever defines these function to choose how the getters/setters work.   We don't mandate the existence of the global memory location

We might be able to rename these functions as followup change.   I'm not sure how much emscripten depends on these names.   But I think this change is a good first step in any case.


Repository:
  rL LLVM

https://reviews.llvm.org/D53240





More information about the llvm-commits mailing list