Commit 889730af authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Inline single-use CompileFailed step

This factors out one part of the "Remove finisher task" CL
(https://crrev.com/c/1400781), which I would like to test in isolation.

R=ahaas@chromium.org

Bug: v8:8423
Change-Id: I7c598f60c4757df8e26508e68da4b3c300a511cb
Reviewed-on: https://chromium-review.googlesource.com/c/1448316Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59256}
parent 1387d5a2
......@@ -1112,7 +1112,12 @@ class AsyncCompileJob::CompilationStateCallback {
AsyncCompileJob* job = job_;
job->foreground_task_runner_->PostTask(
MakeCancelableTask(job->isolate_, [job] {
job->DoSync<CompileFailed, kUseExistingForegroundTask>();
HandleScope scope(job->isolate_);
SaveContext saved_context(job->isolate_);
job->isolate_->set_context(*job->native_context_);
WasmError error = Impl(job->native_module_->compilation_state())
->GetCompileError();
return job->AsyncCompileFailed("Async compilation failed", error);
}));
break;
......@@ -1356,19 +1361,6 @@ class AsyncCompileJob::PrepareAndStartCompile : public CompileStep {
}
};
//==========================================================================
// Step 4b (sync): Compilation failed. Reject Promise.
//==========================================================================
class AsyncCompileJob::CompileFailed : public CompileStep {
public:
void RunInForeground(AsyncCompileJob* job) override {
TRACE_COMPILE("(4b) Compilation Failed...\n");
WasmError error =
Impl(job->native_module_->compilation_state())->GetCompileError();
return job->AsyncCompileFailed("Async compilation failed", error);
}
};
void AsyncCompileJob::CompileWrappers() {
// TODO(wasm): Compile all wrappers here, including the start function wrapper
// and the wrappers for the function table elements.
......
......@@ -92,7 +92,6 @@ class AsyncCompileJob {
class DecodeModule; // Step 1 (async)
class DecodeFail; // Step 1b (sync)
class PrepareAndStartCompile; // Step 2 (sync)
class CompileFailed; // Step 4b (sync)
friend class AsyncStreamingProcessor;
......
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