| 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 |
| 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 Loading... |
| 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_ |
| OLD | NEW |