Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: src/wasm/wasm-macro-gen.h

Issue 1740373002: [wasm] Add a magic word and a version number to the binary. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | src/wasm/wasm-module.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_WASM_MACRO_GEN_H_ 5 #ifndef V8_WASM_MACRO_GEN_H_
6 #define V8_WASM_MACRO_GEN_H_ 6 #define V8_WASM_MACRO_GEN_H_
7 7
8 #include "src/wasm/wasm-opcodes.h" 8 #include "src/wasm/wasm-opcodes.h"
9 9
10 // Convenience macros for building Wasm bytecode directly into a byte array. 10 // Convenience macros for building Wasm bytecode directly into a byte array.
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 #define WASM_F32_REINTERPRET_I32(x) kExprF32ReinterpretI32, x 258 #define WASM_F32_REINTERPRET_I32(x) kExprF32ReinterpretI32, x
259 #define WASM_F64_SCONVERT_I32(x) kExprF64SConvertI32, x 259 #define WASM_F64_SCONVERT_I32(x) kExprF64SConvertI32, x
260 #define WASM_F64_UCONVERT_I32(x) kExprF64UConvertI32, x 260 #define WASM_F64_UCONVERT_I32(x) kExprF64UConvertI32, x
261 #define WASM_F64_SCONVERT_I64(x) kExprF64SConvertI64, x 261 #define WASM_F64_SCONVERT_I64(x) kExprF64SConvertI64, x
262 #define WASM_F64_UCONVERT_I64(x) kExprF64UConvertI64, x 262 #define WASM_F64_UCONVERT_I64(x) kExprF64UConvertI64, x
263 #define WASM_F64_CONVERT_F32(x) kExprF64ConvertF32, x 263 #define WASM_F64_CONVERT_F32(x) kExprF64ConvertF32, x
264 #define WASM_F64_REINTERPRET_I64(x) kExprF64ReinterpretI64, x 264 #define WASM_F64_REINTERPRET_I64(x) kExprF64ReinterpretI64, x
265 #define WASM_I32_REINTERPRET_F32(x) kExprI32ReinterpretF32, x 265 #define WASM_I32_REINTERPRET_F32(x) kExprI32ReinterpretF32, x
266 #define WASM_I64_REINTERPRET_F64(x) kExprI64ReinterpretF64, x 266 #define WASM_I64_REINTERPRET_F64(x) kExprI64ReinterpretF64, x
267 267
268 #define U32_LE(v) \
269 static_cast<byte>(v), static_cast<byte>((v) >> 8), \
270 static_cast<byte>((v) >> 16), static_cast<byte>((v) >> 24)
271
272 #define U16_LE(v) static_cast<byte>(v), static_cast<byte>((v) >> 8)
273
274 #define WASM_MODULE_HEADER U32_LE(kWasmMagic), U32_LE(kWasmVersion)
275
276 #define SIG_INDEX(v) U16_LE(v)
277 #define FUNC_INDEX(v) U16_LE(v)
278 #define NAME_OFFSET(v) U32_LE(v)
279
268 #endif // V8_WASM_MACRO_GEN_H_ 280 #endif // V8_WASM_MACRO_GEN_H_
OLDNEW
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698