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

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

Issue 2121593002: [wasm] Compile and Instantiation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: module_sym Created 4 years, 5 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') | test/mjsunit/wasm/instantiate-module-basic.js » ('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 90bd6cee6e19a981bb20c6a22f46c7a394c5bdc4..258950a91bba98e2ce0e7eb58c0d703131f6fa42 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -1013,9 +1013,9 @@ bool SetupExportsObject(Handle<FixedArray> compiled_module, Isolate* isolate,
} // namespace
-MaybeHandle<FixedArray> WasmModule::CompileFunctions(Isolate* isolate) const {
+MaybeHandle<FixedArray> WasmModule::CompileFunctions(
+ Isolate* isolate, ErrorThrower* thrower) const {
Factory* factory = isolate->factory();
- ErrorThrower thrower(isolate, "WasmModule::CompileFunctions()");
MaybeHandle<FixedArray> nothing;
@@ -1052,14 +1052,14 @@ MaybeHandle<FixedArray> WasmModule::CompileFunctions(Isolate* isolate) const {
static_cast<int>(functions.size()));
if (FLAG_wasm_num_compilation_tasks != 0) {
CompileInParallel(isolate, this,
- temp_instance_for_compilation.function_code, &thrower,
+ temp_instance_for_compilation.function_code, thrower,
&module_env);
} else {
CompileSequentially(isolate, this,
- temp_instance_for_compilation.function_code, &thrower,
+ temp_instance_for_compilation.function_code, thrower,
&module_env);
}
- if (thrower.error()) return nothing;
+ if (thrower->error()) return nothing;
// At this point, compilation has completed. Update the code table.
for (size_t i = FLAG_skip_compiling_wasm_funcs;
@@ -1099,7 +1099,7 @@ MaybeHandle<FixedArray> WasmModule::CompileFunctions(Isolate* isolate) const {
temp_instance_for_compilation.function_code[exp.func_index];
Handle<Code> export_code = compiler::CompileJSToWasmWrapper(
isolate, &module_env, code, exp.func_index);
- if (thrower.error()) return nothing;
+ if (thrower->error()) return nothing;
export_metadata->set(kExportCode, *export_code);
export_metadata->set(kExportName, *name);
export_metadata->set(
@@ -1509,7 +1509,8 @@ int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start,
}
if (thrower.error()) return -1;
- MaybeHandle<FixedArray> compiled_module = module->CompileFunctions(isolate);
+ MaybeHandle<FixedArray> compiled_module =
+ module->CompileFunctions(isolate, &thrower);
if (compiled_module.is_null()) return -1;
Handle<JSObject> instance =
« no previous file with comments | « src/wasm/wasm-module.h ('k') | test/mjsunit/wasm/instantiate-module-basic.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698