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

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

Issue 2726553003: [wasm] Prepare WasmCompilationUnit for lazy compilation (Closed)
Patch Set: Minor fix in vector.h Created 3 years, 10 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
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 4e14c9ec8f5f911299332ddcfd1f8c34d6ed9ad1..81e8f1e60b644790729f145f1445263a36e46fd2 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -262,8 +262,8 @@ class CompilationHelper {
compilation_units_.reserve(funcs_to_compile);
for (uint32_t i = start; i < num_funcs; ++i) {
const WasmFunction* func = &functions[i];
- compilation_units_.push_back(new compiler::WasmCompilationUnit(
- thrower, isolate_, &module_env, func, i));
+ compilation_units_.push_back(
+ new compiler::WasmCompilationUnit(isolate_, &module_env, func));
}
}
@@ -296,7 +296,8 @@ class CompilationHelper {
}
}
- void FinishCompilationUnits(std::vector<Handle<Code>>& results) {
+ void FinishCompilationUnits(std::vector<Handle<Code>>& results,
+ ErrorThrower* thrower) {
while (true) {
compiler::WasmCompilationUnit* unit = nullptr;
{
@@ -307,8 +308,8 @@ class CompilationHelper {
unit = executed_units_.front();
executed_units_.pop();
}
- int j = unit->index();
- results[j] = unit->FinishCompilation();
+ int j = unit->func_index();
+ results[j] = unit->FinishCompilation(thrower);
delete unit;
}
}
@@ -360,13 +361,13 @@ class CompilationHelper {
// dequeues it and finishes the compilation unit. Compilation units
// are finished concurrently to the background threads to save
// memory.
- FinishCompilationUnits(results);
+ FinishCompilationUnits(results, thrower);
}
// 4) After the parallel phase of all compilation units has started, the
// main thread waits for all {CompilationTask} instances to finish.
WaitForCompilationTasks(task_ids.get());
// Finish the compilation of the remaining compilation units.
- FinishCompilationUnits(results);
+ FinishCompilationUnits(results, thrower);
}
void CompileSequentially(ModuleBytesEnv* module_env,
« src/vector.h ('K') | « src/vector.h ('k') | test/cctest/wasm/wasm-run-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698