Commit a46765e2 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[compiler] Replace another std::unique_ptr with base::Optional

This replaces four heap allocations by one stack allocated value.

R=mstarzinger@chromium.org

Change-Id: I7d00968d7bddadb51d7c7b1f3bc5253e54c8a3f9
Reviewed-on: https://chromium-review.googlesource.com/574025
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46704}
parent ce04f26a
......@@ -113,15 +113,15 @@ CompilationJob::Status CompilationJob::PrepareJob() {
}
CompilationJob::Status CompilationJob::ExecuteJob() {
std::unique_ptr<DisallowHeapAllocation> no_allocation;
std::unique_ptr<DisallowHandleAllocation> no_handles;
std::unique_ptr<DisallowHandleDereference> no_deref;
std::unique_ptr<DisallowCodeDependencyChange> no_dependency_change;
base::Optional<DisallowHeapAllocation> no_allocation;
base::Optional<DisallowHandleAllocation> no_handles;
base::Optional<DisallowHandleDereference> no_deref;
base::Optional<DisallowCodeDependencyChange> no_dependency_change;
if (can_execute_on_background_thread()) {
no_allocation.reset(new DisallowHeapAllocation());
no_handles.reset(new DisallowHandleAllocation());
no_deref.reset(new DisallowHandleDereference());
no_dependency_change.reset(new DisallowCodeDependencyChange());
no_allocation.emplace();
no_handles.emplace();
no_deref.emplace();
no_dependency_change.emplace();
executed_on_background_thread_ =
!ThreadId::Current().Equals(isolate_thread_id_);
} else {
......
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