Index: test/cctest/wasm/wasm-run-utils.h |
diff --git a/test/cctest/wasm/wasm-run-utils.h b/test/cctest/wasm/wasm-run-utils.h |
index cc23b46b732365446c8bdb75e4de80ba372104a0..bb9cdab4c51029a4bd8b932630dd70e8308f4da0 100644 |
--- a/test/cctest/wasm/wasm-run-utils.h |
+++ b/test/cctest/wasm/wasm-run-utils.h |
@@ -168,6 +168,29 @@ class TestingModule : public ModuleEnv { |
return &module->functions->back(); |
} |
+ void AddIndirectFunctionTable(int* functions, int table_size) { |
ahaas
2016/01/21 15:47:28
This function is only used with the parameters "nu
|
+ AllocModule(); |
+ Isolate* isolate = module->shared_isolate; |
+ Handle<FixedArray> fixed = |
+ isolate->factory()->NewFixedArray(2 * table_size); |
+ function_table = fixed; |
+ module->function_table = new std::vector<uint16_t>(); |
+ for (int i = 0; i < table_size; i++) { |
+ module->function_table->push_back(functions[i]); |
+ } |
+ } |
+ |
+ void PopulateIndirectFunctionTable() { |
ahaas
2016/01/21 15:47:28
This function is not used anywhere. Does it have t
|
+ if (function_table.is_null()) return; |
+ int table_size = static_cast<int>(module->function_table->size()); |
+ for (int i = 0; i < table_size; i++) { |
+ int function = module->function_table->at(i); |
+ function_table->set(i, Smi::FromInt(function)); |
+ function_table->set(i + table_size, *function_code->at(function)); |
+ } |
+ } |
+ |
+ |
private: |
size_t mem_size; |
uint32_t global_offset; |