Commit 70b64395 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Add missing V8_NOEXCEPT annotations

This silences the new presubmit check for the whole src/wasm directory.

This change uncovered that MSVC is a bit behind with noexcept annotations
on standard containers. This makes all implicit constructors and
assignment operators noexcept(false) if the class contains any standard
container.
Thus disable noexcept on MSVC for now.

R=tebbi@chromium.org
CC=marja@chromium.org

Bug: v8:8616, v8:7999
Change-Id: Ica86ac84a5b8a835dcea9b783c7987d9b850241a
Reviewed-on: https://chromium-review.googlesource.com/c/1386869
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58430}
parent 2c2a6bb0
......@@ -94,9 +94,11 @@
// Allowing the use of noexcept by removing the keyword on older compilers that
// do not support adding noexcept to default members.
#if ((!defined(V8_CC_GNU) && !defined(V8_TARGET_ARCH_MIPS) && \
!defined(V8_TARGET_ARCH_MIPS64) && !defined(V8_TARGET_ARCH_PPC) && \
!defined(V8_TARGET_ARCH_PPC64)) || \
// Disabled on MSVC because constructors of standard containers are not noexcept
// there.
#if ((!defined(V8_CC_GNU) && !defined(V8_CC_MSVC) && \
!defined(V8_TARGET_ARCH_MIPS) && !defined(V8_TARGET_ARCH_MIPS64) && \
!defined(V8_TARGET_ARCH_PPC) && !defined(V8_TARGET_ARCH_PPC64)) || \
(defined(__clang__) && __cplusplus > 201300L))
#define V8_NOEXCEPT noexcept
#else
......
......@@ -114,8 +114,8 @@ class LiftoffAssembler : public TurboAssembler {
struct CacheState {
// Allow default construction, move construction, and move assignment.
CacheState() = default;
CacheState(CacheState&&) = default;
CacheState& operator=(CacheState&&) = default;
CacheState(CacheState&&) V8_NOEXCEPT = default;
CacheState& operator=(CacheState&&) V8_NOEXCEPT = default;
base::SmallVector<VarState, 8> stack_state;
LiftoffRegList used_registers;
......@@ -242,7 +242,7 @@ class LiftoffAssembler : public TurboAssembler {
private:
// Make the copy assignment operator private (to be used from {Split()}).
CacheState& operator=(const CacheState&) = default;
CacheState& operator=(const CacheState&) V8_NOEXCEPT = default;
// Disallow copy construction.
CacheState(const CacheState&) = delete;
};
......@@ -717,7 +717,7 @@ class LiftoffStackSlots {
private:
struct Slot {
// Allow move construction.
Slot(Slot&&) = default;
Slot(Slot&&) V8_NOEXCEPT = default;
Slot(const LiftoffAssembler::VarState& src, uint32_t src_index,
RegPairHalf half)
: src_(src), src_index_(src_index), half_(half) {}
......
......@@ -45,8 +45,9 @@ class V8_EXPORT_PRIVATE DisjointAllocationPool final {
explicit DisjointAllocationPool(base::AddressRegion region)
: regions_({region}) {}
DisjointAllocationPool(DisjointAllocationPool&& other) = default;
DisjointAllocationPool& operator=(DisjointAllocationPool&& other) = default;
DisjointAllocationPool(DisjointAllocationPool&& other) V8_NOEXCEPT = default;
DisjointAllocationPool& operator=(DisjointAllocationPool&& other)
V8_NOEXCEPT = default;
// Merge the parameter region into this object while preserving ordering of
// the regions. The assumption is that the passed parameter is not
......
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