From 9ab9fbf1dd7731dc865f45f66bf05ca53ad0b4bd Mon Sep 17 00:00:00 2001 From: Clemens Hammacher Date: Tue, 5 Sep 2017 15:38:13 +0200 Subject: [PATCH] [wasm] Make ModuleCompiler::CompileToModuleObject static The current usage pattern is always to allocate a {ModuleCompiler}, then call {CompileToModuleObject}, then deallocate the {ModuleCompiler}. Hence, the method can be made static and allocate the {ModuleCompiler} internally. This also gives back a reason for the existence of {CompileToModuleObjectInternal}. R=ahaas@chromium.org Change-Id: Iac1ba28421ade6728046c0b9a6e9fc249a349491 Reviewed-on: https://chromium-review.googlesource.com/650386 Reviewed-by: Andreas Haas Commit-Queue: Clemens Hammacher Cr-Commit-Position: refs/heads/master@{#47834} --- src/wasm/module-compiler.cc | 25 ++++++++++++++----------- src/wasm/module-compiler.h | 9 +++++---- src/wasm/wasm-module.cc | 22 ++++++++++------------ 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/wasm/module-compiler.cc b/src/wasm/module-compiler.cc index f2ec4c141c..1c3510015d 100644 --- a/src/wasm/module-compiler.cc +++ b/src/wasm/module-compiler.cc @@ -323,16 +323,15 @@ void ModuleCompiler::ValidateSequentially(const ModuleWireBytes& wire_bytes, } } +// static MaybeHandle ModuleCompiler::CompileToModuleObject( - ErrorThrower* thrower, const ModuleWireBytes& wire_bytes, - Handle