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

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

Issue 1775873002: [Wasm] Convert many of the fixed-size values to LEB128. (Closed) Base URL: http://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix windows 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.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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 // Constants for fixed-size elements within a module. 58 // Constants for fixed-size elements within a module.
59 static const size_t kDeclMemorySize = 3; 59 static const size_t kDeclMemorySize = 3;
60 static const size_t kDeclGlobalSize = 6; 60 static const size_t kDeclGlobalSize = 6;
61 static const size_t kDeclDataSegmentSize = 13; 61 static const size_t kDeclDataSegmentSize = 13;
62 62
63 // Static representation of a WASM function. 63 // Static representation of a WASM function.
64 struct WasmFunction { 64 struct WasmFunction {
65 FunctionSig* sig; // signature of the function. 65 FunctionSig* sig; // signature of the function.
66 uint32_t func_index; // index into the function table. 66 uint32_t func_index; // index into the function table.
67 uint16_t sig_index; // index into the signature table. 67 uint32_t sig_index; // index into the signature table.
68 uint32_t name_offset; // offset in the module bytes of the name, if any. 68 uint32_t name_offset; // offset in the module bytes of the name, if any.
69 uint32_t code_start_offset; // offset in the module bytes of code start. 69 uint32_t code_start_offset; // offset in the module bytes of code start.
70 uint32_t code_end_offset; // offset in the module bytes of code end. 70 uint32_t code_end_offset; // offset in the module bytes of code end.
71 uint16_t local_i32_count; // number of i32 local variables. 71 uint16_t local_i32_count; // number of i32 local variables.
72 uint16_t local_i64_count; // number of i64 local variables. 72 uint16_t local_i64_count; // number of i64 local variables.
73 uint16_t local_f32_count; // number of f32 local variables. 73 uint16_t local_f32_count; // number of f32 local variables.
74 uint16_t local_f64_count; // number of f64 local variables. 74 uint16_t local_f64_count; // number of f64 local variables.
75 bool exported; // true if this function is exported. 75 bool exported; // true if this function is exported.
76 bool external; // true if this function is externally supplied. 76 bool external; // true if this function is externally supplied.
77 }; 77 };
78 78
79 // Static representation of an imported WASM function. 79 // Static representation of an imported WASM function.
80 struct WasmImport { 80 struct WasmImport {
81 FunctionSig* sig; // signature of the function. 81 FunctionSig* sig; // signature of the function.
82 uint16_t sig_index; // index into the signature table. 82 uint32_t sig_index; // index into the signature table.
83 uint32_t module_name_offset; // offset in module bytes of the module name. 83 uint32_t module_name_offset; // offset in module bytes of the module name.
84 uint32_t function_name_offset; // offset in module bytes of the import name. 84 uint32_t function_name_offset; // offset in module bytes of the import name.
85 }; 85 };
86 86
87 // Static representation of an exported WASM function. 87 // Static representation of an exported WASM function.
88 struct WasmExport { 88 struct WasmExport {
89 uint16_t func_index; // index into the function table. 89 uint32_t func_index; // index into the function table.
90 uint32_t name_offset; // offset in module bytes of the name to export. 90 uint32_t name_offset; // offset in module bytes of the name to export.
91 }; 91 };
92 92
93 // Static representation of a wasm global variable. 93 // Static representation of a wasm global variable.
94 struct WasmGlobal { 94 struct WasmGlobal {
95 uint32_t name_offset; // offset in the module bytes of the name, if any. 95 uint32_t name_offset; // offset in the module bytes of the name, if any.
96 MachineType type; // type of the global. 96 MachineType type; // type of the global.
97 uint32_t offset; // offset from beginning of globals area. 97 uint32_t offset; // offset from beginning of globals area.
98 bool exported; // true if this global is exported. 98 bool exported; // true if this global is exported.
99 }; 99 };
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 263
264 // For testing. Decode, verify, and run the last exported function in the 264 // For testing. Decode, verify, and run the last exported function in the
265 // given decoded module. 265 // given decoded module.
266 int32_t CompileAndRunWasmModule(Isolate* isolate, WasmModule* module); 266 int32_t CompileAndRunWasmModule(Isolate* isolate, WasmModule* module);
267 267
268 } // namespace wasm 268 } // namespace wasm
269 } // namespace internal 269 } // namespace internal
270 } // namespace v8 270 } // namespace v8
271 271
272 #endif // V8_WASM_MODULE_H_ 272 #endif // V8_WASM_MODULE_H_
OLDNEW
« no previous file with comments | « src/wasm/wasm-macro-gen.h ('k') | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698