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 @@
#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_
......@@ -134,9 +134,9 @@ V8_INLINE Dest bit_cast(Source const& source) {
// Disallow copying a type, and only provide move construction and move
// assignment. Especially useful for move-only structs.
#define MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(TypeName) \
TypeName(TypeName&&) V8_NOEXCEPT = default; \
TypeName& operator=(TypeName&&) V8_NOEXCEPT = default; \
#define MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(TypeName) \
TypeName(TypeName&&) = default; \
TypeName& operator=(TypeName&&) = default; \
DISALLOW_COPY_AND_ASSIGN(TypeName)
// A macro to disallow the dynamic allocation.
......
......@@ -131,7 +131,7 @@ class Optional {
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()));
}
......@@ -164,7 +164,7 @@ class Optional {
return *this;
}
Optional& operator=(Optional&& other) V8_NOEXCEPT {
Optional& operator=(Optional&& other) {
if (other.storage_.is_null_) {
FreeIfNeeded();
return *this;
......
......@@ -139,15 +139,13 @@ class ExternalizedContents {
: base_(contents.AllocationBase()),
length_(contents.AllocationLength()),
mode_(contents.AllocationMode()) {}
ExternalizedContents(ExternalizedContents&& other) V8_NOEXCEPT
: base_(other.base_),
length_(other.length_),
mode_(other.mode_) {
ExternalizedContents(ExternalizedContents&& other)
: base_(other.base_), length_(other.length_), mode_(other.mode_) {
other.base_ = nullptr;
other.length_ = 0;
other.mode_ = ArrayBuffer::Allocator::AllocationMode::kNormal;
}
ExternalizedContents& operator=(ExternalizedContents&& other) V8_NOEXCEPT {
ExternalizedContents& operator=(ExternalizedContents&& other) {
if (this != &other) {
base_ = other.base_;
length_ = other.length_;
......
......@@ -2,7 +2,6 @@ include_rules = [
"-src",
"-include/v8-debug.h",
"+src/base/atomicops.h",
"+src/base/compiler-specific.h",
"+src/base/macros.h",
"+src/base/logging.h",
"+src/base/platform/platform.h",
......
......@@ -375,9 +375,8 @@ String16::String16() {}
String16::String16(const String16& other)
: m_impl(other.m_impl), hash_code(other.hash_code) {}
String16::String16(String16&& other) V8_NOEXCEPT
: m_impl(std::move(other.m_impl)),
hash_code(other.hash_code) {}
String16::String16(String16&& other)
: m_impl(std::move(other.m_impl)), hash_code(other.hash_code) {}
String16::String16(const UChar* characters, size_t size)
: m_impl(characters, size) {}
......@@ -400,7 +399,7 @@ String16& String16::operator=(const String16& other) {
return *this;
}
String16& String16::operator=(String16&& other) V8_NOEXCEPT {
String16& String16::operator=(String16&& other) {
m_impl = std::move(other.m_impl);
hash_code = other.hash_code;
return *this;
......
......@@ -12,8 +12,6 @@
#include <string>
#include <vector>
#include "src/base/compiler-specific.h"
namespace v8_inspector {
using UChar = uint16_t;
......@@ -24,7 +22,7 @@ class String16 {
String16();
String16(const String16& other);
String16(String16&& other) V8_NOEXCEPT;
String16(String16&& other);
String16(const UChar* characters, size_t size);
String16(const UChar* characters); // NOLINT(runtime/explicit)
String16(const char* characters); // NOLINT(runtime/explicit)
......@@ -32,7 +30,7 @@ class String16 {
explicit String16(const std::basic_string<UChar>& impl);
String16& operator=(const String16& other);
String16& operator=(String16&& other) V8_NOEXCEPT;
String16& operator=(String16&& other);
static String16 fromInteger(int);
static String16 fromInteger(size_t);
......
......@@ -300,10 +300,8 @@ class SerializedData {
SerializedData(byte* data, int size)
: data_(data), size_(size), owns_data_(false) {}
SerializedData() : data_(nullptr), size_(0), owns_data_(false) {}
SerializedData(SerializedData&& other) V8_NOEXCEPT
: data_(other.data_),
size_(other.size_),
owns_data_(other.owns_data_) {
SerializedData(SerializedData&& other)
: data_(other.data_), size_(other.size_), owns_data_(other.owns_data_) {
// Ensure |other| will not attempt to destroy our data in destructor.
other.owns_data_ = false;
}
......
......@@ -145,7 +145,7 @@ void ErrorThrower::Reset() {
error_msg_.clear();
}
ErrorThrower::ErrorThrower(ErrorThrower&& other) V8_NOEXCEPT
ErrorThrower::ErrorThrower(ErrorThrower&& other)
: isolate_(other.isolate_),
context_(other.context_),
error_type_(other.error_type_),
......
......@@ -26,10 +26,10 @@ class V8_EXPORT_PRIVATE ResultBase {
protected:
ResultBase() = default;
ResultBase& operator=(ResultBase&& other) V8_NOEXCEPT = default;
ResultBase& operator=(ResultBase&& other) = default;
public:
ResultBase(ResultBase&& other) V8_NOEXCEPT
ResultBase(ResultBase&& other)
: error_offset_(other.error_offset_),
error_msg_(std::move(other.error_msg_)) {}
......@@ -73,10 +73,10 @@ class Result : public ResultBase {
explicit Result(S&& value) : val(std::forward<S>(value)) {}
template <typename S>
Result(Result<S>&& other) V8_NOEXCEPT : ResultBase(std::move(other)),
val(std::move(other.val)) {}
Result(Result<S>&& other)
: 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, ...) {
va_list args;
......@@ -99,7 +99,7 @@ class V8_EXPORT_PRIVATE ErrorThrower {
ErrorThrower(Isolate* isolate, const char* context)
: isolate_(isolate), context_(context) {}
// Explicitly allow move-construction. Disallow copy (below).
ErrorThrower(ErrorThrower&& other) V8_NOEXCEPT;
ErrorThrower(ErrorThrower&& other);
~ErrorThrower();
PRINTF_FORMAT(2, 3) void TypeError(const char* fmt, ...);
......
......@@ -21,7 +21,7 @@ const char src_simple[] = "function foo() { var x = 2 * a() + b; }";
struct ScannerTestHelper {
ScannerTestHelper() = default;
ScannerTestHelper(ScannerTestHelper&& other) V8_NOEXCEPT
ScannerTestHelper(ScannerTestHelper&& other)
: unicode_cache(std::move(other.unicode_cache)),
stream(std::move(other.stream)),
scanner(std::move(other.scanner)) {}
......
......@@ -43,10 +43,8 @@ class DataRange {
// lead to OOM because the end might not be reached.
// Define move constructor and move assignment, disallow copy constructor and
// copy assignment (below).
DataRange(DataRange&& other) V8_NOEXCEPT : DataRange(other.data_) {
other.data_ = {};
}
DataRange& operator=(DataRange&& other) V8_NOEXCEPT {
DataRange(DataRange&& other) : DataRange(other.data_) { other.data_ = {}; }
DataRange& operator=(DataRange&& other) {
data_ = other.data_;
other.data_ = {};
return *this;
......
......@@ -63,12 +63,12 @@ class AsmTypeTest : public TestWithZone {
class FunctionTypeBuilder {
public:
FunctionTypeBuilder(FunctionTypeBuilder&& b) V8_NOEXCEPT
FunctionTypeBuilder(FunctionTypeBuilder&& b)
: function_type_(b.function_type_) {
b.function_type_ = nullptr;
}
FunctionTypeBuilder& operator=(FunctionTypeBuilder&& b) V8_NOEXCEPT {
FunctionTypeBuilder& operator=(FunctionTypeBuilder&& b) {
if (this != &b) {
function_type_ = b.function_type_;
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