| OLD | NEW |
| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 static const size_t kDeclGlobalSize = 6; | 48 static const size_t kDeclGlobalSize = 6; |
| 49 static const size_t kDeclDataSegmentSize = 13; | 49 static const size_t kDeclDataSegmentSize = 13; |
| 50 | 50 |
| 51 // Static representation of a wasm function. | 51 // Static representation of a wasm function. |
| 52 struct WasmFunction { | 52 struct WasmFunction { |
| 53 FunctionSig* sig; // signature of the function. | 53 FunctionSig* sig; // signature of the function. |
| 54 uint16_t sig_index; // index into the signature table. | 54 uint16_t sig_index; // index into the signature table. |
| 55 uint32_t name_offset; // offset in the module bytes of the name, if any. | 55 uint32_t name_offset; // offset in the module bytes of the name, if any. |
| 56 uint32_t code_start_offset; // offset in the module bytes of code start. | 56 uint32_t code_start_offset; // offset in the module bytes of code start. |
| 57 uint32_t code_end_offset; // offset in the module bytes of code end. | 57 uint32_t code_end_offset; // offset in the module bytes of code end. |
| 58 uint16_t local_int32_count; // number of int32 local variables. | 58 uint16_t local_i32_count; // number of i32 local variables. |
| 59 uint16_t local_int64_count; // number of int64 local variables. | 59 uint16_t local_i64_count; // number of i64 local variables. |
| 60 uint16_t local_float32_count; // number of float32 local variables. | 60 uint16_t local_f32_count; // number of f32 local variables. |
| 61 uint16_t local_float64_count; // number of float64 local variables. | 61 uint16_t local_f64_count; // number of f64 local variables. |
| 62 bool exported; // true if this function is exported. | 62 bool exported; // true if this function is exported. |
| 63 bool external; // true if this function is externally supplied. | 63 bool external; // true if this function is externally supplied. |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 struct ModuleEnv; // forward declaration of decoder interface. | 66 struct ModuleEnv; // forward declaration of decoder interface. |
| 67 | 67 |
| 68 // Static representation of a wasm global variable. | 68 // Static representation of a wasm global variable. |
| 69 struct WasmGlobal { | 69 struct WasmGlobal { |
| 70 uint32_t name_offset; // offset in the module bytes of the name, if any. | 70 uint32_t name_offset; // offset in the module bytes of the name, if any. |
| 71 MachineType type; // type of the global. | 71 MachineType type; // type of the global. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 const byte* module_end, bool asm_js = false); | 203 const byte* module_end, bool asm_js = false); |
| 204 | 204 |
| 205 // For testing. Decode, verify, and run the last exported function in the | 205 // For testing. Decode, verify, and run the last exported function in the |
| 206 // given decoded module. | 206 // given decoded module. |
| 207 int32_t CompileAndRunWasmModule(Isolate* isolate, WasmModule* module); | 207 int32_t CompileAndRunWasmModule(Isolate* isolate, WasmModule* module); |
| 208 } // namespace wasm | 208 } // namespace wasm |
| 209 } // namespace internal | 209 } // namespace internal |
| 210 } // namespace v8 | 210 } // namespace v8 |
| 211 | 211 |
| 212 #endif // V8_WASM_MODULE_H_ | 212 #endif // V8_WASM_MODULE_H_ |
| OLD | NEW |