Commit 8332c0ff authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

Revert "Applied noexcept to all mctors and massigns"

This reverts commit baa055c7.

Reason for revert: mips compile failure: https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Mips%20-%20builder/18458

Original change's description:
> Applied noexcept to all mctors and massigns
> 
> Refactoring the code base to use noexcept for their move constructors and move
> assignment operators.
> 
> Bug: v8:7999
> 
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: I13d24eddba3bfa601cff26fd680a040cf4e71426
> Reviewed-on: https://chromium-review.googlesource.com/1152817
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Andreas Haas <ahaas@chromium.org>
> Commit-Queue: Florian Sattler <sattlerf@google.com>
> Cr-Commit-Position: refs/heads/master@{#54841}

TBR=marja@chromium.org,yangguo@chromium.org,ahaas@chromium.org,jgruber@chromium.org,sattlerf@google.com

Change-Id: I49757025daac368a647887a63164e927f0106803
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7999
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://chromium-review.googlesource.com/1158644Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54843}
parent 98728e58
...@@ -92,12 +92,4 @@ ...@@ -92,12 +92,4 @@
#endif // V8_CC_MSVC #endif // V8_CC_MSVC
// Allowing the use of noexcept by removing the keyword on older compilers that
// do not support adding noexcept to default members.
#if (V8_GNUC_PREREQ(4, 9, 0)) || (defined(__clang__) && __cplusplus > 201300L)
#define V8_NOEXCEPT noexcept
#else
#define V8_NOEXCEPT
#endif
#endif // V8_BASE_COMPILER_SPECIFIC_H_ #endif // V8_BASE_COMPILER_SPECIFIC_H_
...@@ -134,9 +134,9 @@ V8_INLINE Dest bit_cast(Source const& source) { ...@@ -134,9 +134,9 @@ V8_INLINE Dest bit_cast(Source const& source) {
// Disallow copying a type, and only provide move construction and move // Disallow copying a type, and only provide move construction and move
// assignment. Especially useful for move-only structs. // assignment. Especially useful for move-only structs.
#define MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(TypeName) \ #define MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(TypeName) \
TypeName(TypeName&&) V8_NOEXCEPT = default; \ TypeName(TypeName&&) = default; \
TypeName& operator=(TypeName&&) V8_NOEXCEPT = default; \ TypeName& operator=(TypeName&&) = default; \
DISALLOW_COPY_AND_ASSIGN(TypeName) DISALLOW_COPY_AND_ASSIGN(TypeName)
// A macro to disallow the dynamic allocation. // A macro to disallow the dynamic allocation.
......
...@@ -131,7 +131,7 @@ class Optional { ...@@ -131,7 +131,7 @@ class Optional {
if (!other.storage_.is_null_) Init(other.value()); if (!other.storage_.is_null_) Init(other.value());
} }
Optional(Optional&& other) V8_NOEXCEPT { Optional(Optional&& other) {
if (!other.storage_.is_null_) Init(std::move(other.value())); if (!other.storage_.is_null_) Init(std::move(other.value()));
} }
...@@ -164,7 +164,7 @@ class Optional { ...@@ -164,7 +164,7 @@ class Optional {
return *this; return *this;
} }
Optional& operator=(Optional&& other) V8_NOEXCEPT { Optional& operator=(Optional&& other) {
if (other.storage_.is_null_) { if (other.storage_.is_null_) {
FreeIfNeeded(); FreeIfNeeded();
return *this; return *this;
......
...@@ -139,15 +139,13 @@ class ExternalizedContents { ...@@ -139,15 +139,13 @@ class ExternalizedContents {
: base_(contents.AllocationBase()), : base_(contents.AllocationBase()),
length_(contents.AllocationLength()), length_(contents.AllocationLength()),
mode_(contents.AllocationMode()) {} mode_(contents.AllocationMode()) {}
ExternalizedContents(ExternalizedContents&& other) V8_NOEXCEPT ExternalizedContents(ExternalizedContents&& other)
: base_(other.base_), : base_(other.base_), length_(other.length_), mode_(other.mode_) {
length_(other.length_),
mode_(other.mode_) {
other.base_ = nullptr; other.base_ = nullptr;
other.length_ = 0; other.length_ = 0;
other.mode_ = ArrayBuffer::Allocator::AllocationMode::kNormal; other.mode_ = ArrayBuffer::Allocator::AllocationMode::kNormal;
} }
ExternalizedContents& operator=(ExternalizedContents&& other) V8_NOEXCEPT { ExternalizedContents& operator=(ExternalizedContents&& other) {
if (this != &other) { if (this != &other) {
base_ = other.base_; base_ = other.base_;
length_ = other.length_; length_ = other.length_;
......
...@@ -2,7 +2,6 @@ include_rules = [ ...@@ -2,7 +2,6 @@ include_rules = [
"-src", "-src",
"-include/v8-debug.h", "-include/v8-debug.h",
"+src/base/atomicops.h", "+src/base/atomicops.h",
"+src/base/compiler-specific.h",
"+src/base/macros.h", "+src/base/macros.h",
"+src/base/logging.h", "+src/base/logging.h",
"+src/base/platform/platform.h", "+src/base/platform/platform.h",
......
...@@ -375,9 +375,8 @@ String16::String16() {} ...@@ -375,9 +375,8 @@ String16::String16() {}
String16::String16(const String16& other) String16::String16(const String16& other)
: m_impl(other.m_impl), hash_code(other.hash_code) {} : m_impl(other.m_impl), hash_code(other.hash_code) {}
String16::String16(String16&& other) V8_NOEXCEPT String16::String16(String16&& other)
: m_impl(std::move(other.m_impl)), : m_impl(std::move(other.m_impl)), hash_code(other.hash_code) {}
hash_code(other.hash_code) {}
String16::String16(const UChar* characters, size_t size) String16::String16(const UChar* characters, size_t size)
: m_impl(characters, size) {} : m_impl(characters, size) {}
...@@ -400,7 +399,7 @@ String16& String16::operator=(const String16& other) { ...@@ -400,7 +399,7 @@ String16& String16::operator=(const String16& other) {
return *this; return *this;
} }
String16& String16::operator=(String16&& other) V8_NOEXCEPT { String16& String16::operator=(String16&& other) {
m_impl = std::move(other.m_impl); m_impl = std::move(other.m_impl);
hash_code = other.hash_code; hash_code = other.hash_code;
return *this; return *this;
......
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "src/base/compiler-specific.h"
namespace v8_inspector { namespace v8_inspector {
using UChar = uint16_t; using UChar = uint16_t;
...@@ -24,7 +22,7 @@ class String16 { ...@@ -24,7 +22,7 @@ class String16 {
String16(); String16();
String16(const String16& other); String16(const String16& other);
String16(String16&& other) V8_NOEXCEPT; String16(String16&& other);
String16(const UChar* characters, size_t size); String16(const UChar* characters, size_t size);
String16(const UChar* characters); // NOLINT(runtime/explicit) String16(const UChar* characters); // NOLINT(runtime/explicit)
String16(const char* characters); // NOLINT(runtime/explicit) String16(const char* characters); // NOLINT(runtime/explicit)
...@@ -32,7 +30,7 @@ class String16 { ...@@ -32,7 +30,7 @@ class String16 {
explicit String16(const std::basic_string<UChar>& impl); explicit String16(const std::basic_string<UChar>& impl);
String16& operator=(const String16& other); String16& operator=(const String16& other);
String16& operator=(String16&& other) V8_NOEXCEPT; String16& operator=(String16&& other);
static String16 fromInteger(int); static String16 fromInteger(int);
static String16 fromInteger(size_t); static String16 fromInteger(size_t);
......
...@@ -300,10 +300,8 @@ class SerializedData { ...@@ -300,10 +300,8 @@ class SerializedData {
SerializedData(byte* data, int size) SerializedData(byte* data, int size)
: data_(data), size_(size), owns_data_(false) {} : data_(data), size_(size), owns_data_(false) {}
SerializedData() : data_(nullptr), size_(0), owns_data_(false) {} SerializedData() : data_(nullptr), size_(0), owns_data_(false) {}
SerializedData(SerializedData&& other) V8_NOEXCEPT SerializedData(SerializedData&& other)
: data_(other.data_), : data_(other.data_), size_(other.size_), owns_data_(other.owns_data_) {
size_(other.size_),
owns_data_(other.owns_data_) {
// Ensure |other| will not attempt to destroy our data in destructor. // Ensure |other| will not attempt to destroy our data in destructor.
other.owns_data_ = false; other.owns_data_ = false;
} }
......
...@@ -145,7 +145,7 @@ void ErrorThrower::Reset() { ...@@ -145,7 +145,7 @@ void ErrorThrower::Reset() {
error_msg_.clear(); error_msg_.clear();
} }
ErrorThrower::ErrorThrower(ErrorThrower&& other) V8_NOEXCEPT ErrorThrower::ErrorThrower(ErrorThrower&& other)
: isolate_(other.isolate_), : isolate_(other.isolate_),
context_(other.context_), context_(other.context_),
error_type_(other.error_type_), error_type_(other.error_type_),
......
...@@ -26,10 +26,10 @@ class V8_EXPORT_PRIVATE ResultBase { ...@@ -26,10 +26,10 @@ class V8_EXPORT_PRIVATE ResultBase {
protected: protected:
ResultBase() = default; ResultBase() = default;
ResultBase& operator=(ResultBase&& other) V8_NOEXCEPT = default; ResultBase& operator=(ResultBase&& other) = default;
public: public:
ResultBase(ResultBase&& other) V8_NOEXCEPT ResultBase(ResultBase&& other)
: error_offset_(other.error_offset_), : error_offset_(other.error_offset_),
error_msg_(std::move(other.error_msg_)) {} error_msg_(std::move(other.error_msg_)) {}
...@@ -73,10 +73,10 @@ class Result : public ResultBase { ...@@ -73,10 +73,10 @@ class Result : public ResultBase {
explicit Result(S&& value) : val(std::forward<S>(value)) {} explicit Result(S&& value) : val(std::forward<S>(value)) {}
template <typename S> template <typename S>
Result(Result<S>&& other) V8_NOEXCEPT : ResultBase(std::move(other)), Result(Result<S>&& other)
val(std::move(other.val)) {} : ResultBase(std::move(other)), val(std::move(other.val)) {}
Result& operator=(Result&& other) V8_NOEXCEPT = default; Result& operator=(Result&& other) = default;
static Result<T> PRINTF_FORMAT(1, 2) Error(const char* format, ...) { static Result<T> PRINTF_FORMAT(1, 2) Error(const char* format, ...) {
va_list args; va_list args;
...@@ -99,7 +99,7 @@ class V8_EXPORT_PRIVATE ErrorThrower { ...@@ -99,7 +99,7 @@ class V8_EXPORT_PRIVATE ErrorThrower {
ErrorThrower(Isolate* isolate, const char* context) ErrorThrower(Isolate* isolate, const char* context)
: isolate_(isolate), context_(context) {} : isolate_(isolate), context_(context) {}
// Explicitly allow move-construction. Disallow copy (below). // Explicitly allow move-construction. Disallow copy (below).
ErrorThrower(ErrorThrower&& other) V8_NOEXCEPT; ErrorThrower(ErrorThrower&& other);
~ErrorThrower(); ~ErrorThrower();
PRINTF_FORMAT(2, 3) void TypeError(const char* fmt, ...); PRINTF_FORMAT(2, 3) void TypeError(const char* fmt, ...);
......
...@@ -21,7 +21,7 @@ const char src_simple[] = "function foo() { var x = 2 * a() + b; }"; ...@@ -21,7 +21,7 @@ const char src_simple[] = "function foo() { var x = 2 * a() + b; }";
struct ScannerTestHelper { struct ScannerTestHelper {
ScannerTestHelper() = default; ScannerTestHelper() = default;
ScannerTestHelper(ScannerTestHelper&& other) V8_NOEXCEPT ScannerTestHelper(ScannerTestHelper&& other)
: unicode_cache(std::move(other.unicode_cache)), : unicode_cache(std::move(other.unicode_cache)),
stream(std::move(other.stream)), stream(std::move(other.stream)),
scanner(std::move(other.scanner)) {} scanner(std::move(other.scanner)) {}
......
...@@ -43,10 +43,8 @@ class DataRange { ...@@ -43,10 +43,8 @@ class DataRange {
// lead to OOM because the end might not be reached. // lead to OOM because the end might not be reached.
// Define move constructor and move assignment, disallow copy constructor and // Define move constructor and move assignment, disallow copy constructor and
// copy assignment (below). // copy assignment (below).
DataRange(DataRange&& other) V8_NOEXCEPT : DataRange(other.data_) { DataRange(DataRange&& other) : DataRange(other.data_) { other.data_ = {}; }
other.data_ = {}; DataRange& operator=(DataRange&& other) {
}
DataRange& operator=(DataRange&& other) V8_NOEXCEPT {
data_ = other.data_; data_ = other.data_;
other.data_ = {}; other.data_ = {};
return *this; return *this;
......
...@@ -63,12 +63,12 @@ class AsmTypeTest : public TestWithZone { ...@@ -63,12 +63,12 @@ class AsmTypeTest : public TestWithZone {
class FunctionTypeBuilder { class FunctionTypeBuilder {
public: public:
FunctionTypeBuilder(FunctionTypeBuilder&& b) V8_NOEXCEPT FunctionTypeBuilder(FunctionTypeBuilder&& b)
: function_type_(b.function_type_) { : function_type_(b.function_type_) {
b.function_type_ = nullptr; b.function_type_ = nullptr;
} }
FunctionTypeBuilder& operator=(FunctionTypeBuilder&& b) V8_NOEXCEPT { FunctionTypeBuilder& operator=(FunctionTypeBuilder&& b) {
if (this != &b) { if (this != &b) {
function_type_ = b.function_type_; function_type_ = b.function_type_;
b.function_type_ = nullptr; b.function_type_ = nullptr;
......
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