Commit 36cff05f authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

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: 's avatarShu-yu Guo <syg@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77665}
parent 7083b10b
......@@ -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_),
......
......@@ -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> {
......
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