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:
parent
7083b10bb1
commit
36cff05fea
@ -503,7 +503,7 @@ void TracedGlobal<T>::Reset(Isolate* isolate, const Local<S>& other) {
|
|||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
template <class S>
|
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");
|
static_assert(std::is_base_of<T, S>::value, "type check");
|
||||||
*this = std::move(rhs.template As<T>());
|
*this = std::move(rhs.template As<T>());
|
||||||
return *this;
|
return *this;
|
||||||
@ -518,7 +518,7 @@ TracedGlobal<T>& TracedGlobal<T>::operator=(const TracedGlobal<S>& rhs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
TracedGlobal<T>& TracedGlobal<T>::operator=(TracedGlobal&& rhs) {
|
TracedGlobal<T>& TracedGlobal<T>::operator=(TracedGlobal&& rhs) noexcept {
|
||||||
if (this != &rhs) {
|
if (this != &rhs) {
|
||||||
internal::MoveTracedGlobalReference(
|
internal::MoveTracedGlobalReference(
|
||||||
reinterpret_cast<internal::Address**>(&rhs.val_),
|
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 T>
|
||||||
template <class S>
|
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");
|
static_assert(std::is_base_of<T, S>::value, "type check");
|
||||||
*this = std::move(rhs.template As<T>());
|
*this = std::move(rhs.template As<T>());
|
||||||
return *this;
|
return *this;
|
||||||
@ -570,7 +571,8 @@ TracedReference<T>& TracedReference<T>::operator=(
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
TracedReference<T>& TracedReference<T>::operator=(TracedReference&& rhs) {
|
TracedReference<T>& TracedReference<T>::operator=(
|
||||||
|
TracedReference&& rhs) noexcept {
|
||||||
if (this != &rhs) {
|
if (this != &rhs) {
|
||||||
internal::MoveTracedGlobalReference(
|
internal::MoveTracedGlobalReference(
|
||||||
reinterpret_cast<internal::Address**>(&rhs.val_),
|
reinterpret_cast<internal::Address**>(&rhs.val_),
|
||||||
|
@ -103,6 +103,8 @@ TEST_F(UnifiedHeapTest, WriteBarrierV8ToCppReference) {
|
|||||||
EXPECT_EQ(0u, Wrappable::destructor_callcount);
|
EXPECT_EQ(0u, Wrappable::destructor_callcount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(_MSC_VER) || defined(__clang__)
|
||||||
|
|
||||||
TEST_F(UnifiedHeapTest, WriteBarrierCppToV8Reference) {
|
TEST_F(UnifiedHeapTest, WriteBarrierCppToV8Reference) {
|
||||||
// TODO(v8:12165): Remove test when fully removing the deprecated API.
|
// TODO(v8:12165): Remove test when fully removing the deprecated API.
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
@ -143,6 +145,8 @@ TEST_F(UnifiedHeapTest, WriteBarrierCppToV8Reference) {
|
|||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // !_MSC_VER || __clang__
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
namespace {
|
namespace {
|
||||||
class Unreferenced : public cppgc::GarbageCollected<Unreferenced> {
|
class Unreferenced : public cppgc::GarbageCollected<Unreferenced> {
|
||||||
|
Loading…
Reference in New Issue
Block a user