[llvm] r365088 - [WebAssembly] Add option to emit passive segments

Thomas Lively via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 15:04:54 PDT 2019


Author: tlively
Date: Wed Jul  3 15:04:54 2019
New Revision: 365088

URL: http://llvm.org/viewvc/llvm-project?rev=365088&view=rev
Log:
[WebAssembly] Add option to emit passive segments

Summary:
Adds `--passive-segments` and `--active-segments` flags to control
what kind of segments are emitted. For now the default is always
to emit active segments so this is not a breaking change, but in
the future the default will be changed to passive segments when
shared memory is requested and active segments otherwise. When
passive segments are emitted, corresponding memory.init and
data.drop instructions are emitted in a `__wasm_init_memory`
function that is automatically called at the beginning of
`__wasm_call_ctors`.

Reviewers: sbc100, aheejin, dschuff

Subscribers: azakai, dschuff, jgravelle-google, sunfish, jfb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59343

Modified:
    llvm/trunk/include/llvm/BinaryFormat/Wasm.h

Modified: llvm/trunk/include/llvm/BinaryFormat/Wasm.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BinaryFormat/Wasm.h?rev=365088&r1=365087&r2=365088&view=diff
==============================================================================
--- llvm/trunk/include/llvm/BinaryFormat/Wasm.h (original)
+++ llvm/trunk/include/llvm/BinaryFormat/Wasm.h Wed Jul  3 15:04:54 2019
@@ -249,6 +249,9 @@ enum : unsigned {
   WASM_OPCODE_F32_CONST = 0x43,
   WASM_OPCODE_F64_CONST = 0x44,
   WASM_OPCODE_I32_ADD = 0x6a,
+  WASM_OPCODE_MISC_PREFIX = 0xfc,
+  WASM_OPCODE_MEMORY_INIT = 0x08,
+  WASM_OPCODE_DATA_DROP = 0x09,
 };
 
 enum : unsigned {




More information about the llvm-commits mailing list