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

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

Issue 2651793003: [wasm] Test argument passing in the interpreter entry (Closed)
Patch Set: Naming Created 3 years, 10 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-wasm-interpreter-entry.cc ('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 7a893df2fb5cd432914033e8871ec179211838ec..9c883fa5fa005aba8b64ad634b0dbc5ba8e7fb26 100644
--- a/test/cctest/wasm/wasm-run-utils.h
+++ b/test/cctest/wasm/wasm-run-utils.h
@@ -564,8 +564,16 @@ class WasmFunctionCompiler : private GraphAndBuilders {
Handle<WasmCompiledModule> compiled_module(
testing_module_->instance_object()->compiled_module(), isolate());
Handle<FixedArray> code_table = compiled_module->code_table();
- code_table = FixedArray::SetAndGrow(code_table, function_index(), code);
- compiled_module->set_code_table(code_table);
+ if (static_cast<int>(function_index()) >= code_table->length()) {
+ Handle<FixedArray> new_arr = isolate()->factory()->NewFixedArray(
+ static_cast<int>(function_index()) + 1);
+ code_table->CopyTo(0, *new_arr, 0, code_table->length());
+ code_table = new_arr;
+ compiled_module->set_code_table(code_table);
+ }
+ DCHECK(code_table->get(static_cast<int>(function_index()))
+ ->IsUndefined(isolate()));
+ code_table->set(static_cast<int>(function_index()), *code);
}
byte AllocateLocal(ValueType type) {
« no previous file with comments | « test/cctest/wasm/test-wasm-interpreter-entry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698