Commit 362de3fe authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Make {AsyncCompileJob::context} a native context.

R=ahaas@chromium.org

Change-Id: I9cf40958978f8ebcc34d4c9d15ea301e54829229
Reviewed-on: https://chromium-review.googlesource.com/1125076
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54201}
parent 393a01d3
......@@ -2197,7 +2197,8 @@ AsyncCompileJob::AsyncCompileJob(
foreground_task_runner_ = platform->GetForegroundTaskRunner(v8_isolate);
// The handle for the context must be deferred.
DeferredHandleScope deferred(isolate);
context_ = Handle<Context>(*context, isolate);
native_context_ = Handle<Context>(context->native_context(), isolate);
DCHECK(native_context_->IsNativeContext());
deferred_handles_.push_back(deferred.Detach());
}
......@@ -2308,7 +2309,7 @@ class AsyncCompileJob::CompileStep {
--job_->num_pending_foreground_tasks_;
DCHECK_EQ(0, job_->num_pending_foreground_tasks_);
SaveContext saved_context(job_->isolate_);
job_->isolate_->set_context(*job_->context_);
job_->isolate_->set_context(*job_->native_context_);
RunInForeground();
} else {
RunInBackground();
......@@ -2505,9 +2506,7 @@ class AsyncCompileJob::PrepareAndStartCompile : public CompileStep {
case CompilationEvent::kFinishedBaselineCompilation:
if (job->DecrementAndCheckFinisherCount()) {
SaveContext saved_context(job->isolate());
// TODO(mstarzinger): Make {AsyncCompileJob::context} point
// to the native context and also rename to {native_context}.
job->isolate()->set_context(job->context_->native_context());
job->isolate()->set_context(*job->native_context_);
job->FinishCompile();
}
return;
......@@ -2531,7 +2530,7 @@ class AsyncCompileJob::PrepareAndStartCompile : public CompileStep {
->baseline_compilation_finished());
SaveContext saved_context(job->isolate());
job->isolate()->set_context(job->context_->native_context());
job->isolate()->set_context(*job->native_context_);
Handle<Object> error = thrower->Reify();
DeferredHandleScope deferred(job->isolate());
......
......@@ -144,7 +144,7 @@ class AsyncCompileJob {
// Reference to the wire bytes (hold in {bytes_copy_} or as part of
// {native_module_}).
ModuleWireBytes wire_bytes_;
Handle<Context> context_;
Handle<Context> native_context_;
std::unique_ptr<CompilationResultResolver> resolver_;
std::shared_ptr<const WasmModule> module_;
......
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