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

Side by Side Diff: src/wasm/wasm-module.h

Issue 1692173002: [wasm] Add support for a start function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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.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
(...skipping 14 matching lines...) Expand all
25 25
26 enum WasmSectionDeclCode { 26 enum WasmSectionDeclCode {
27 kDeclMemory = 0x00, 27 kDeclMemory = 0x00,
28 kDeclSignatures = 0x01, 28 kDeclSignatures = 0x01,
29 kDeclFunctions = 0x02, 29 kDeclFunctions = 0x02,
30 kDeclGlobals = 0x03, 30 kDeclGlobals = 0x03,
31 kDeclDataSegments = 0x04, 31 kDeclDataSegments = 0x04,
32 kDeclFunctionTable = 0x05, 32 kDeclFunctionTable = 0x05,
33 kDeclWLL = 0x11, 33 kDeclWLL = 0x11,
34 kDeclEnd = 0x06, 34 kDeclEnd = 0x06,
35 kDeclStartFunction = 0x07,
35 }; 36 };
36 37
37 static const int kMaxModuleSectionCode = 6; 38 static const int kMaxModuleSectionCode = 6;
38 39
39 enum WasmFunctionDeclBit { 40 enum WasmFunctionDeclBit {
40 kDeclFunctionName = 0x01, 41 kDeclFunctionName = 0x01,
41 kDeclFunctionImport = 0x02, 42 kDeclFunctionImport = 0x02,
42 kDeclFunctionLocals = 0x04, 43 kDeclFunctionLocals = 0x04,
43 kDeclFunctionExport = 0x08 44 kDeclFunctionExport = 0x08
44 }; 45 };
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 static const uint8_t kMinMemSize = 12; // Minimum memory size = 4kb 87 static const uint8_t kMinMemSize = 12; // Minimum memory size = 4kb
87 static const uint8_t kMaxMemSize = 30; // Maximum memory size = 1gb 88 static const uint8_t kMaxMemSize = 30; // Maximum memory size = 1gb
88 89
89 Isolate* shared_isolate; // isolate for storing shared code. 90 Isolate* shared_isolate; // isolate for storing shared code.
90 const byte* module_start; // starting address for the module bytes. 91 const byte* module_start; // starting address for the module bytes.
91 const byte* module_end; // end address for the module bytes. 92 const byte* module_end; // end address for the module bytes.
92 uint8_t min_mem_size_log2; // minimum size of the memory (log base 2). 93 uint8_t min_mem_size_log2; // minimum size of the memory (log base 2).
93 uint8_t max_mem_size_log2; // maximum size of the memory (log base 2). 94 uint8_t max_mem_size_log2; // maximum size of the memory (log base 2).
94 bool mem_export; // true if the memory is exported. 95 bool mem_export; // true if the memory is exported.
95 bool mem_external; // true if the memory is external. 96 bool mem_external; // true if the memory is external.
97 int start_function_index; // start function, if any.
96 98
97 std::vector<WasmGlobal>* globals; // globals in this module. 99 std::vector<WasmGlobal>* globals; // globals in this module.
98 std::vector<FunctionSig*>* signatures; // signatures in this module. 100 std::vector<FunctionSig*>* signatures; // signatures in this module.
99 std::vector<WasmFunction>* functions; // functions in this module. 101 std::vector<WasmFunction>* functions; // functions in this module.
100 std::vector<WasmDataSegment>* data_segments; // data segments in this module. 102 std::vector<WasmDataSegment>* data_segments; // data segments in this module.
101 std::vector<uint16_t>* function_table; // function table. 103 std::vector<uint16_t>* function_table; // function table.
102 104
103 WasmModule(); 105 WasmModule();
104 ~WasmModule(); 106 ~WasmModule();
105 107
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 const byte* module_end, bool asm_js = false); 205 const byte* module_end, bool asm_js = false);
204 206
205 // For testing. Decode, verify, and run the last exported function in the 207 // For testing. Decode, verify, and run the last exported function in the
206 // given decoded module. 208 // given decoded module.
207 int32_t CompileAndRunWasmModule(Isolate* isolate, WasmModule* module); 209 int32_t CompileAndRunWasmModule(Isolate* isolate, WasmModule* module);
208 } // namespace wasm 210 } // namespace wasm
209 } // namespace internal 211 } // namespace internal
210 } // namespace v8 212 } // namespace v8
211 213
212 #endif // V8_WASM_MODULE_H_ 214 #endif // V8_WASM_MODULE_H_
OLDNEW
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698