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

Unified Diff: test/cctest/wasm/wasm-run-utils.h

Issue 1616973004: [wasm] Add utilities to print out WASM ast directly from the bytes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/wasm/test-signatures.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « test/cctest/wasm/test-signatures.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698