| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 WASM_RUN_UTILS_H | 5 #ifndef WASM_RUN_UTILS_H |
| 6 #define WASM_RUN_UTILS_H | 6 #define WASM_RUN_UTILS_H |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 module_.shared_isolate = CcTest::InitIsolateOnce(); | 84 module_.shared_isolate = CcTest::InitIsolateOnce(); |
| 85 module = &module_; | 85 module = &module_; |
| 86 instance = &instance_; | 86 instance = &instance_; |
| 87 instance->module = &module_; | 87 instance->module = &module_; |
| 88 instance->globals_start = global_data; | 88 instance->globals_start = global_data; |
| 89 instance->globals_size = kMaxGlobalsSize; | 89 instance->globals_size = kMaxGlobalsSize; |
| 90 instance->mem_start = nullptr; | 90 instance->mem_start = nullptr; |
| 91 instance->mem_size = 0; | 91 instance->mem_size = 0; |
| 92 instance->function_code = nullptr; | 92 instance->function_code = nullptr; |
| 93 linker = nullptr; | 93 linker = nullptr; |
| 94 asm_js = false; | 94 origin = kWasmOrigin; |
| 95 memset(global_data, 0, sizeof(global_data)); | 95 memset(global_data, 0, sizeof(global_data)); |
| 96 } | 96 } |
| 97 | 97 |
| 98 ~TestingModule() { | 98 ~TestingModule() { |
| 99 if (instance->mem_start) { | 99 if (instance->mem_start) { |
| 100 free(instance->mem_start); | 100 free(instance->mem_start); |
| 101 } | 101 } |
| 102 if (instance->function_code) { | 102 if (instance->function_code) { |
| 103 delete instance->function_code; | 103 delete instance->function_code; |
| 104 } | 104 } |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 if (p1 == MachineType::None()) return 1; | 627 if (p1 == MachineType::None()) return 1; |
| 628 if (p2 == MachineType::None()) return 2; | 628 if (p2 == MachineType::None()) return 2; |
| 629 if (p3 == MachineType::None()) return 3; | 629 if (p3 == MachineType::None()) return 3; |
| 630 return 4; | 630 return 4; |
| 631 } | 631 } |
| 632 }; | 632 }; |
| 633 | 633 |
| 634 } // namespace | 634 } // namespace |
| 635 | 635 |
| 636 #endif | 636 #endif |
| OLD | NEW |