Commit f9632960 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] [cleanup] Remove unneeded field in WasmCompilationJob

The FixedArray holding the export wrappers is never being used before
creating the WasmCompiledModule, so there is no need to store it in a
field on the WasmCompilationJob. Just create it when creating the
WasmCompiledModule.

R=ahaas@chromium.org
CC=​mtrofin@chromium.org

Change-Id: Ibdca3d5c58faf4b52df10560bdf2734fdd7a4656
Reviewed-on: https://chromium-review.googlesource.com/758242Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49214}
parent 55a98076
......@@ -3089,10 +3089,7 @@ class AsyncCompileJob::PrepareAndStartCompile : public CompileStep {
// Initialize {code_table_} with the illegal builtin. All call sites
// will be patched at instantiation.
int code_table_size = static_cast<int>(module_->functions.size());
int export_wrapper_size = static_cast<int>(module_->num_exported_functions);
job_->code_table_ = factory->NewFixedArray(code_table_size, TENURED);
job_->export_wrappers_ =
factory->NewFixedArray(export_wrapper_size, TENURED);
for (int i = 0, e = module_->num_imported_functions; i < e; ++i) {
job_->code_table_->set(i, *illegal_builtin);
......@@ -3107,8 +3104,6 @@ class AsyncCompileJob::PrepareAndStartCompile : public CompileStep {
centry_stub = Handle<Code>(*centry_stub, isolate);
job_->code_table_ = Handle<FixedArray>(*job_->code_table_, isolate);
job_->export_wrappers_ =
Handle<FixedArray>(*job_->export_wrappers_, isolate);
compiler::ModuleEnv* env = job_->module_env_.get();
ReopenHandles(isolate, env->function_code);
Handle<Code>* mut =
......@@ -3297,9 +3292,13 @@ class AsyncCompileJob::FinishCompile : public CompileStep {
// and information needed at instantiation time. This object needs to be
// serializable. Instantiation may occur off a deserialized version of
// this object.
int export_wrapper_size =
static_cast<int>(module_wrapper->get()->num_exported_functions);
Handle<FixedArray> export_wrappers =
job_->isolate_->factory()->NewFixedArray(export_wrapper_size, TENURED);
job_->compiled_module_ =
NewCompiledModule(job_->isolate_, shared, job_->code_table_,
job_->export_wrappers_, job_->module_env_.get());
export_wrappers, job_->module_env_.get());
// Finish the wasm script now and make it public to the debugger.
script->set_wasm_compiled_module(*job_->compiled_module_);
job_->isolate_->debug()->OnAfterCompile(script);
......
......@@ -165,7 +165,6 @@ class AsyncCompileJob {
Handle<WasmModuleObject> module_object_;
Handle<WasmCompiledModule> compiled_module_;
Handle<FixedArray> code_table_;
Handle<FixedArray> export_wrappers_;
size_t outstanding_units_ = 0;
std::unique_ptr<CompileStep> step_;
CancelableTaskManager background_task_manager_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment