[unwinder] Copy constructor cleanups

There were some cleanups to be done after crrev.com/c/v8/v8/+/2472000/
was merged.

Bug: v8:10799
Change-Id: I09bc2d123f89b88c74c3aecfa97c82d1925a1f2b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2488686
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70685}
This commit is contained in:
Santiago Aboy Solanes 2020-10-21 09:34:51 +01:00 committed by Commit Bot
parent cf1bb76181
commit 0b5ceda473

View File

@ -11154,14 +11154,7 @@ RegisterState::RegisterState()
RegisterState::~RegisterState() = default;
RegisterState::RegisterState(const RegisterState& other) V8_NOEXCEPT {
pc = other.pc;
sp = other.sp;
fp = other.fp;
lr = other.lr;
if (other.callee_saved) {
callee_saved =
std::make_unique<CalleeSavedRegisters>(*(other.callee_saved));
}
*this = other;
}
RegisterState& RegisterState::operator=(const RegisterState& other)
@ -11172,8 +11165,12 @@ RegisterState& RegisterState::operator=(const RegisterState& other)
fp = other.fp;
lr = other.lr;
if (other.callee_saved) {
// Make a deep copy if {other.callee_saved} is non-null.
callee_saved =
std::make_unique<CalleeSavedRegisters>(*(other.callee_saved));
} else {
// Otherwise, set {callee_saved} to null to match {other}.
callee_saved.reset();
}
}
return *this;