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

Side by Side Diff: src/wasm/wasm-module.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/wasm-macro-gen.h ('k') | test/cctest/wasm/test-run-wasm-module.cc » ('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_MODULE_H_ 5 #ifndef V8_WASM_MODULE_H_
6 #define V8_WASM_MODULE_H_ 6 #define V8_WASM_MODULE_H_
7 7
8 #include "src/wasm/wasm-opcodes.h" 8 #include "src/wasm/wasm-opcodes.h"
9 #include "src/wasm/wasm-result.h" 9 #include "src/wasm/wasm-result.h"
10 10
11 #include "src/api.h" 11 #include "src/api.h"
12 #include "src/handles.h" 12 #include "src/handles.h"
13 13
14 namespace v8 { 14 namespace v8 {
15 namespace internal { 15 namespace internal {
16 16
17 namespace compiler { 17 namespace compiler {
18 class CallDescriptor; 18 class CallDescriptor;
19 } 19 }
20 20
21 namespace wasm { 21 namespace wasm {
22 const size_t kMaxModuleSize = 1024 * 1024 * 1024; 22 const size_t kMaxModuleSize = 1024 * 1024 * 1024;
23 const size_t kMaxFunctionSize = 128 * 1024; 23 const size_t kMaxFunctionSize = 128 * 1024;
24 const size_t kMaxStringSize = 256; 24 const size_t kMaxStringSize = 256;
25 const uint32_t kWasmMagic = 0x6d736100;
26 const uint32_t kWasmVersion = 0x0a;
25 27
26 enum WasmSectionDeclCode { 28 enum WasmSectionDeclCode {
27 kDeclMemory = 0x00, 29 kDeclMemory = 0x00,
28 kDeclSignatures = 0x01, 30 kDeclSignatures = 0x01,
29 kDeclFunctions = 0x02, 31 kDeclFunctions = 0x02,
30 kDeclGlobals = 0x03, 32 kDeclGlobals = 0x03,
31 kDeclDataSegments = 0x04, 33 kDeclDataSegments = 0x04,
32 kDeclFunctionTable = 0x05, 34 kDeclFunctionTable = 0x05,
33 kDeclEnd = 0x06, 35 kDeclEnd = 0x06,
34 kDeclStartFunction = 0x07, 36 kDeclStartFunction = 0x07,
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 251
250 // For testing. Decode, verify, and run the last exported function in the 252 // For testing. Decode, verify, and run the last exported function in the
251 // given decoded module. 253 // given decoded module.
252 int32_t CompileAndRunWasmModule(Isolate* isolate, WasmModule* module); 254 int32_t CompileAndRunWasmModule(Isolate* isolate, WasmModule* module);
253 255
254 } // namespace wasm 256 } // namespace wasm
255 } // namespace internal 257 } // namespace internal
256 } // namespace v8 258 } // namespace v8
257 259
258 #endif // V8_WASM_MODULE_H_ 260 #endif // V8_WASM_MODULE_H_
OLDNEW
« no previous file with comments | « src/wasm/wasm-macro-gen.h ('k') | test/cctest/wasm/test-run-wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698