[PATCH] D64537: [WebAssembly] Implement thread-local storage (local-exec model)

Derek Schuff via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 16 17:11:01 PDT 2019


dschuff added a comment.

I had a reply that got eaten here, so I'm going to keep trolling you on your CL since we don't have a design doc for this.
The `offset` field of a data segment initializer can be a `global.get` on an imported global.  (https://webassembly.github.io/spec/core/valid/instructions.html#constant-expressions). Since each thread is separately instantiated with separate JS, we could have a global import like `__tls_base` which has a different value in each thread. Then we wouldn't need to manually call the init code anywhere. Would there be other advantages or disadvantages for that?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64537/new/

https://reviews.llvm.org/D64537





More information about the cfe-commits mailing list