Commit 86aa8e40 authored by Omer Katz's avatar Omer Katz Committed by V8 LUCI CQ

cppgc: Avoid using members on stack in cppgc

Bug: chromium:1283720
Cq-Include-Trybots: luci.v8.try:v8_linux_blink_rel
Change-Id: Ifd9982a9315ebbed8765bc9f15ac3ffcbf04612f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3368269
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78506}
parent a7aa6c70
...@@ -118,10 +118,10 @@ class BasicPersistent final : public PersistentBase, ...@@ -118,10 +118,10 @@ class BasicPersistent final : public PersistentBase,
template <typename U, typename MemberBarrierPolicy, template <typename U, typename MemberBarrierPolicy,
typename MemberWeaknessTag, typename MemberCheckingPolicy, typename MemberWeaknessTag, typename MemberCheckingPolicy,
typename = std::enable_if_t<std::is_base_of<T, U>::value>> typename = std::enable_if_t<std::is_base_of<T, U>::value>>
BasicPersistent(internal::BasicMember<U, MemberBarrierPolicy, BasicPersistent(
MemberWeaknessTag, MemberCheckingPolicy> const internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag,
member, MemberCheckingPolicy>& member,
const SourceLocation& loc = SourceLocation::Current()) const SourceLocation& loc = SourceLocation::Current())
: BasicPersistent(member.Get(), loc) {} : BasicPersistent(member.Get(), loc) {}
~BasicPersistent() { Clear(); } ~BasicPersistent() { Clear(); }
...@@ -159,9 +159,8 @@ class BasicPersistent final : public PersistentBase, ...@@ -159,9 +159,8 @@ class BasicPersistent final : public PersistentBase,
typename MemberWeaknessTag, typename MemberCheckingPolicy, typename MemberWeaknessTag, typename MemberCheckingPolicy,
typename = std::enable_if_t<std::is_base_of<T, U>::value>> typename = std::enable_if_t<std::is_base_of<T, U>::value>>
BasicPersistent& operator=( BasicPersistent& operator=(
internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag, const internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag,
MemberCheckingPolicy> MemberCheckingPolicy>& member) {
member) {
return operator=(member.Get()); return operator=(member.Get());
} }
...@@ -292,12 +291,12 @@ template <typename T1, typename PersistentWeaknessPolicy, ...@@ -292,12 +291,12 @@ template <typename T1, typename PersistentWeaknessPolicy,
typename PersistentLocationPolicy, typename PersistentCheckingPolicy, typename PersistentLocationPolicy, typename PersistentCheckingPolicy,
typename T2, typename MemberWriteBarrierPolicy, typename T2, typename MemberWriteBarrierPolicy,
typename MemberWeaknessTag, typename MemberCheckingPolicy> typename MemberWeaknessTag, typename MemberCheckingPolicy>
bool operator==(const BasicPersistent<T1, PersistentWeaknessPolicy, bool operator==(
PersistentLocationPolicy, const BasicPersistent<T1, PersistentWeaknessPolicy,
PersistentCheckingPolicy>& p, PersistentLocationPolicy, PersistentCheckingPolicy>&
BasicMember<T2, MemberWeaknessTag, MemberWriteBarrierPolicy, p,
MemberCheckingPolicy> const BasicMember<T2, MemberWeaknessTag, MemberWriteBarrierPolicy,
m) { MemberCheckingPolicy>& m) {
return p.Get() == m.Get(); return p.Get() == m.Get();
} }
...@@ -305,12 +304,12 @@ template <typename T1, typename PersistentWeaknessPolicy, ...@@ -305,12 +304,12 @@ template <typename T1, typename PersistentWeaknessPolicy,
typename PersistentLocationPolicy, typename PersistentCheckingPolicy, typename PersistentLocationPolicy, typename PersistentCheckingPolicy,
typename T2, typename MemberWriteBarrierPolicy, typename T2, typename MemberWriteBarrierPolicy,
typename MemberWeaknessTag, typename MemberCheckingPolicy> typename MemberWeaknessTag, typename MemberCheckingPolicy>
bool operator!=(const BasicPersistent<T1, PersistentWeaknessPolicy, bool operator!=(
PersistentLocationPolicy, const BasicPersistent<T1, PersistentWeaknessPolicy,
PersistentCheckingPolicy>& p, PersistentLocationPolicy, PersistentCheckingPolicy>&
BasicMember<T2, MemberWeaknessTag, MemberWriteBarrierPolicy, p,
MemberCheckingPolicy> const BasicMember<T2, MemberWeaknessTag, MemberWriteBarrierPolicy,
m) { MemberCheckingPolicy>& m) {
return !(p == m); return !(p == m);
} }
...@@ -318,12 +317,12 @@ template <typename T1, typename MemberWriteBarrierPolicy, ...@@ -318,12 +317,12 @@ template <typename T1, typename MemberWriteBarrierPolicy,
typename MemberWeaknessTag, typename MemberCheckingPolicy, typename MemberWeaknessTag, typename MemberCheckingPolicy,
typename T2, typename PersistentWeaknessPolicy, typename T2, typename PersistentWeaknessPolicy,
typename PersistentLocationPolicy, typename PersistentCheckingPolicy> typename PersistentLocationPolicy, typename PersistentCheckingPolicy>
bool operator==(BasicMember<T2, MemberWeaknessTag, MemberWriteBarrierPolicy, bool operator==(
MemberCheckingPolicy> const BasicMember<T2, MemberWeaknessTag, MemberWriteBarrierPolicy,
m, MemberCheckingPolicy>& m,
const BasicPersistent<T1, PersistentWeaknessPolicy, const BasicPersistent<T1, PersistentWeaknessPolicy,
PersistentLocationPolicy, PersistentLocationPolicy, PersistentCheckingPolicy>&
PersistentCheckingPolicy>& p) { p) {
return m.Get() == p.Get(); return m.Get() == p.Get();
} }
...@@ -331,12 +330,12 @@ template <typename T1, typename MemberWriteBarrierPolicy, ...@@ -331,12 +330,12 @@ template <typename T1, typename MemberWriteBarrierPolicy,
typename MemberWeaknessTag, typename MemberCheckingPolicy, typename MemberWeaknessTag, typename MemberCheckingPolicy,
typename T2, typename PersistentWeaknessPolicy, typename T2, typename PersistentWeaknessPolicy,
typename PersistentLocationPolicy, typename PersistentCheckingPolicy> typename PersistentLocationPolicy, typename PersistentCheckingPolicy>
bool operator!=(BasicMember<T2, MemberWeaknessTag, MemberWriteBarrierPolicy, bool operator!=(
MemberCheckingPolicy> const BasicMember<T2, MemberWeaknessTag, MemberWriteBarrierPolicy,
m, MemberCheckingPolicy>& m,
const BasicPersistent<T1, PersistentWeaknessPolicy, const BasicPersistent<T1, PersistentWeaknessPolicy,
PersistentLocationPolicy, PersistentLocationPolicy, PersistentCheckingPolicy>&
PersistentCheckingPolicy>& p) { p) {
return !(m == p); return !(m == p);
} }
......
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