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

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

Issue 2204703002: [wasm] Get rid of extra wrappers when import another wasm export (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make test case code more clean Created 4 years, 4 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 | « src/wasm/wasm-module.cc ('k') | test/mjsunit/wasm/test-import-export-wrapper.js » ('j') | 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 d791d9355b5c390218fa0dc5eed3bef6d4351f85..a9f70deadf5725e5b9bd21f98279bb277b53819d 100644
--- a/test/cctest/wasm/wasm-run-utils.h
+++ b/test/cctest/wasm/wasm-run-utils.h
@@ -211,10 +211,16 @@ class TestingModule : public ModuleEnv {
WasmJs::InstallWasmFunctionMap(isolate_, isolate_->native_context());
Handle<Code> ret_code =
compiler::CompileJSToWasmWrapper(isolate_, this, code, index);
+ FunctionSig* funcSig = this->module->functions[index].sig;
+ Handle<ByteArray> exportedSig = isolate_->factory()->NewByteArray(
+ static_cast<int>(funcSig->parameter_count() + funcSig->return_count()),
+ TENURED);
+ exportedSig->copy_in(0, reinterpret_cast<const byte*>(funcSig->raw_data()),
+ exportedSig->length());
Handle<JSFunction> ret = WrapExportCodeAsJSFunction(
isolate_, ret_code, name,
static_cast<int>(this->module->functions[index].sig->parameter_count()),
- module_object);
+ exportedSig, module_object);
return ret;
}
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | test/mjsunit/wasm/test-import-export-wrapper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698