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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/api.h" | 10 #include "src/api.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 } | 23 } |
24 | 24 |
25 namespace wasm { | 25 namespace wasm { |
26 const size_t kMaxModuleSize = 1024 * 1024 * 1024; | 26 const size_t kMaxModuleSize = 1024 * 1024 * 1024; |
27 const size_t kMaxFunctionSize = 128 * 1024; | 27 const size_t kMaxFunctionSize = 128 * 1024; |
28 const size_t kMaxStringSize = 256; | 28 const size_t kMaxStringSize = 256; |
29 const uint32_t kWasmMagic = 0x6d736100; | 29 const uint32_t kWasmMagic = 0x6d736100; |
30 const uint32_t kWasmVersion = 0x0b; | 30 const uint32_t kWasmVersion = 0x0b; |
31 const uint8_t kWasmFunctionTypeForm = 0x40; | 31 const uint8_t kWasmFunctionTypeForm = 0x40; |
32 | 32 |
| 33 struct TrapHandlerData { |
| 34 Code* code; |
| 35 TrapHandlerData* next; |
| 36 }; |
| 37 |
| 38 extern TrapHandlerData* gTrapHandlers; |
| 39 |
33 // WebAssembly sections are named as strings in the binary format, but | 40 // WebAssembly sections are named as strings in the binary format, but |
34 // internally V8 uses an enum to handle them. | 41 // internally V8 uses an enum to handle them. |
35 // | 42 // |
36 // Entries have the form F(enumerator, string). | 43 // Entries have the form F(enumerator, string). |
37 #define FOR_EACH_WASM_SECTION_TYPE(F) \ | 44 #define FOR_EACH_WASM_SECTION_TYPE(F) \ |
38 F(Signatures, 1, "type") \ | 45 F(Signatures, 1, "type") \ |
39 F(ImportTable, 2, "import") \ | 46 F(ImportTable, 2, "import") \ |
40 F(FunctionSignatures, 3, "function") \ | 47 F(FunctionSignatures, 3, "function") \ |
41 F(FunctionTable, 4, "table") \ | 48 F(FunctionTable, 4, "table") \ |
42 F(Memory, 5, "memory") \ | 49 F(Memory, 5, "memory") \ |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 424 |
418 int32_t CallFunction(Isolate* isolate, Handle<JSObject> instance, | 425 int32_t CallFunction(Isolate* isolate, Handle<JSObject> instance, |
419 ErrorThrower* thrower, const char* name, int argc, | 426 ErrorThrower* thrower, const char* name, int argc, |
420 Handle<Object> argv[], bool asm_js = false); | 427 Handle<Object> argv[], bool asm_js = false); |
421 } // namespace testing | 428 } // namespace testing |
422 } // namespace wasm | 429 } // namespace wasm |
423 } // namespace internal | 430 } // namespace internal |
424 } // namespace v8 | 431 } // namespace v8 |
425 | 432 |
426 #endif // V8_WASM_MODULE_H_ | 433 #endif // V8_WASM_MODULE_H_ |
OLD | NEW |