TracedReference: Fix MSVC compile errors

- Fix definition and declaration of noexcept methods not matching
- Disable test using deprecated APIs. Only having clang coverage is
  okay here.

Change-Id: I412d0b0087b2858fb72b0365b94b82ebc13462de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3256693
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77665}
This commit is contained in:
Michael Lippautz 2021-11-02 18:14:59 +01:00 committed by V8 LUCI CQ
parent 7083b10bb1
commit 36cff05fea
2 changed files with 10 additions and 4 deletions

View File

@ -503,7 +503,7 @@ void TracedGlobal<T>::Reset(Isolate* isolate, const Local<S>& other) {
template <class T>
template <class S>
TracedGlobal<T>& TracedGlobal<T>::operator=(TracedGlobal<S>&& rhs) {
TracedGlobal<T>& TracedGlobal<T>::operator=(TracedGlobal<S>&& rhs) noexcept {
static_assert(std::is_base_of<T, S>::value, "type check");
*this = std::move(rhs.template As<T>());
return *this;
@ -518,7 +518,7 @@ TracedGlobal<T>& TracedGlobal<T>::operator=(const TracedGlobal<S>& rhs) {
}
template <class T>
TracedGlobal<T>& TracedGlobal<T>::operator=(TracedGlobal&& rhs) {
TracedGlobal<T>& TracedGlobal<T>::operator=(TracedGlobal&& rhs) noexcept {
if (this != &rhs) {
internal::MoveTracedGlobalReference(
reinterpret_cast<internal::Address**>(&rhs.val_),
@ -554,7 +554,8 @@ void TracedReference<T>::Reset(Isolate* isolate, const Local<S>& other) {
template <class T>
template <class S>
TracedReference<T>& TracedReference<T>::operator=(TracedReference<S>&& rhs) {
TracedReference<T>& TracedReference<T>::operator=(
TracedReference<S>&& rhs) noexcept {
static_assert(std::is_base_of<T, S>::value, "type check");
*this = std::move(rhs.template As<T>());
return *this;
@ -570,7 +571,8 @@ TracedReference<T>& TracedReference<T>::operator=(
}
template <class T>
TracedReference<T>& TracedReference<T>::operator=(TracedReference&& rhs) {
TracedReference<T>& TracedReference<T>::operator=(
TracedReference&& rhs) noexcept {
if (this != &rhs) {
internal::MoveTracedGlobalReference(
reinterpret_cast<internal::Address**>(&rhs.val_),

View File

@ -103,6 +103,8 @@ TEST_F(UnifiedHeapTest, WriteBarrierV8ToCppReference) {
EXPECT_EQ(0u, Wrappable::destructor_callcount);
}
#if !defined(_MSC_VER) || defined(__clang__)
TEST_F(UnifiedHeapTest, WriteBarrierCppToV8Reference) {
// TODO(v8:12165): Remove test when fully removing the deprecated API.
#pragma GCC diagnostic push
@ -143,6 +145,8 @@ TEST_F(UnifiedHeapTest, WriteBarrierCppToV8Reference) {
#pragma GCC diagnostic pop
}
#endif // !_MSC_VER || __clang__
#if DEBUG
namespace {
class Unreferenced : public cppgc::GarbageCollected<Unreferenced> {