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

Unified Diff: src/wasm/wasm-module.cc

Issue 2651903002: [wasm] No need to use multiple inheritance for `ModuleBytesEnv` (Closed)
Patch Set: Created 3 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 | « src/wasm/wasm-module.h ('k') | src/wasm/wasm-text.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 646b6dc797d75d0f54806e20eeae61fcbfdeaaa0..9dba12546e8e146b78c0f4ca1a5f392a2087bd6b 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -321,7 +321,7 @@ void FinishCompilationUnits(
void CompileInParallel(Isolate* isolate, ModuleBytesEnv* module_env,
std::vector<Handle<Code>>& functions,
ErrorThrower* thrower) {
- const WasmModule* module = module_env->module;
+ const WasmModule* module = module_env->module_env.module;
// Data structures for the parallel compilation.
std::vector<compiler::WasmCompilationUnit*> compilation_units(
module->functions.size());
@@ -388,7 +388,7 @@ void CompileSequentially(Isolate* isolate, ModuleBytesEnv* module_env,
ErrorThrower* thrower) {
DCHECK(!thrower->error());
- const WasmModule* module = module_env->module;
+ const WasmModule* module = module_env->module_env.module;
for (uint32_t i = FLAG_skip_compiling_wasm_funcs;
i < module->functions.size(); ++i) {
const WasmFunction& func = module->functions[i];
@@ -399,7 +399,7 @@ void CompileSequentially(Isolate* isolate, ModuleBytesEnv* module_env,
code = compiler::WasmCompilationUnit::CompileWasmFunction(
thrower, isolate, module_env, &func);
if (code.is_null()) {
- WasmName str = module_env->GetName(&func);
+ WasmName str = module_env->wire_bytes.GetName(&func);
thrower->CompileError("Compilation of #%d:%.*s failed.", i, str.length(),
str.start());
break;
@@ -730,8 +730,8 @@ Handle<Script> CreateWasmScript(Isolate* isolate,
script->set_type(Script::TYPE_WASM);
int hash = StringHasher::HashSequentialString(
- reinterpret_cast<const char*>(wire_bytes.module_bytes.start()),
- wire_bytes.module_bytes.length(), kZeroHashSeed);
+ reinterpret_cast<const char*>(wire_bytes.start()), wire_bytes.length(),
+ kZeroHashSeed);
const int kBufferSize = 50;
char buffer[kBufferSize];
@@ -970,7 +970,9 @@ MaybeHandle<WasmCompiledModule> WasmModule::CompileFunctions(
// TODO(wasm): only save the sections necessary to deserialize a
// {WasmModule}. E.g. function bodies could be omitted.
Handle<String> module_bytes =
- factory->NewStringFromOneByte(wire_bytes.module_bytes, TENURED)
+ factory
+ ->NewStringFromOneByte({wire_bytes.start(), wire_bytes.length()},
+ TENURED)
.ToHandleChecked();
DCHECK(module_bytes->IsSeqOneByteString());
« no previous file with comments | « src/wasm/wasm-module.h ('k') | src/wasm/wasm-text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698