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

Side by Side Diff: test/cctest/wasm/wasm-run-utils.h

Issue 2056633002: [wasm] Separate compilation from instantiation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: feedback Created 4 years, 6 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/x64/assembler-x64.cc ('k') | test/unittests/wasm/ast-decoder-unittest.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 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 interpreter_(mode == kExecuteInterpreted 77 interpreter_(mode == kExecuteInterpreted
78 ? new WasmInterpreter(&instance_, &allocator_) 78 ? new WasmInterpreter(&instance_, &allocator_)
79 : nullptr) { 79 : nullptr) {
80 module = &module_; 80 module = &module_;
81 instance = &instance_; 81 instance = &instance_;
82 instance->module = &module_; 82 instance->module = &module_;
83 instance->globals_start = global_data; 83 instance->globals_start = global_data;
84 module_.globals_size = kMaxGlobalsSize; 84 module_.globals_size = kMaxGlobalsSize;
85 instance->mem_start = nullptr; 85 instance->mem_start = nullptr;
86 instance->mem_size = 0; 86 instance->mem_size = 0;
87 linker = nullptr;
88 origin = kWasmOrigin; 87 origin = kWasmOrigin;
89 memset(global_data, 0, sizeof(global_data)); 88 memset(global_data, 0, sizeof(global_data));
90 } 89 }
91 90
92 ~TestingModule() { 91 ~TestingModule() {
93 if (instance->mem_start) { 92 if (instance->mem_start) {
94 free(instance->mem_start); 93 free(instance->mem_start);
95 } 94 }
96 if (interpreter_) delete interpreter_; 95 if (interpreter_) delete interpreter_;
97 } 96 }
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 // interpreter. 762 // interpreter.
764 #define WASM_EXEC_TEST(name) \ 763 #define WASM_EXEC_TEST(name) \
765 void RunWasm_##name(WasmExecutionMode execution_mode); \ 764 void RunWasm_##name(WasmExecutionMode execution_mode); \
766 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \ 765 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \
767 TEST(RunWasmInterpreted_##name) { RunWasm_##name(kExecuteInterpreted); } \ 766 TEST(RunWasmInterpreted_##name) { RunWasm_##name(kExecuteInterpreted); } \
768 void RunWasm_##name(WasmExecutionMode execution_mode) 767 void RunWasm_##name(WasmExecutionMode execution_mode)
769 768
770 } // namespace 769 } // namespace
771 770
772 #endif 771 #endif
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698