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

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

Issue 2456193006: Revert of [wasm] Support for restricted table imports. (Closed)
Patch Set: Created 4 years, 1 month 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/wasm/wasm-module.cc ('k') | test/mjsunit/wasm/indirect-tables.js » ('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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 static_cast<int>(index), module_object); 216 static_cast<int>(index), module_object);
217 return ret; 217 return ret;
218 } 218 }
219 219
220 void SetFunctionCode(uint32_t index, Handle<Code> code) { 220 void SetFunctionCode(uint32_t index, Handle<Code> code) {
221 instance->function_code[index] = code; 221 instance->function_code[index] = code;
222 } 222 }
223 223
224 void AddIndirectFunctionTable(uint16_t* function_indexes, 224 void AddIndirectFunctionTable(uint16_t* function_indexes,
225 uint32_t table_size) { 225 uint32_t table_size) {
226 module_.function_tables.push_back({table_size, table_size, true, 226 module_.function_tables.push_back({table_size, table_size,
227 std::vector<int32_t>(), false, false, 227 std::vector<int32_t>(), false, false,
228 SignatureMap()}); 228 SignatureMap()});
229 WasmIndirectFunctionTable& table = module_.function_tables.back(); 229 WasmIndirectFunctionTable& table = module_.function_tables.back();
230 table.min_size = table_size;
231 table.max_size = table_size;
232 for (uint32_t i = 0; i < table_size; ++i) { 230 for (uint32_t i = 0; i < table_size; ++i) {
233 table.values.push_back(function_indexes[i]); 231 table.values.push_back(function_indexes[i]);
234 table.map.FindOrInsert(module_.functions[function_indexes[i]].sig); 232 table.map.FindOrInsert(module_.functions[function_indexes[i]].sig);
235 } 233 }
236 234
237 instance->function_tables.push_back( 235 instance->function_tables.push_back(
238 isolate_->factory()->NewFixedArray(table_size * 2)); 236 isolate_->factory()->NewFixedArray(table_size * 2));
239 } 237 }
240 238
241 void PopulateIndirectFunctionTable() { 239 void PopulateIndirectFunctionTable() {
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 // interpreter. 786 // interpreter.
789 #define WASM_EXEC_TEST(name) \ 787 #define WASM_EXEC_TEST(name) \
790 void RunWasm_##name(WasmExecutionMode execution_mode); \ 788 void RunWasm_##name(WasmExecutionMode execution_mode); \
791 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \ 789 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \
792 TEST(RunWasmInterpreted_##name) { RunWasm_##name(kExecuteInterpreted); } \ 790 TEST(RunWasmInterpreted_##name) { RunWasm_##name(kExecuteInterpreted); } \
793 void RunWasm_##name(WasmExecutionMode execution_mode) 791 void RunWasm_##name(WasmExecutionMode execution_mode)
794 792
795 } // namespace 793 } // namespace
796 794
797 #endif 795 #endif
OLDNEW
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | test/mjsunit/wasm/indirect-tables.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698