Commit 4306e211 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

Fix remaining missing V8_NOEXCEPT annotations

Fix some by removing (unnecessarily) implicitly declared constructors
and assignment operators.
String16 constructors and assignment operators can just be defaulted,
and declared in the header.

This fixes the last complaints of the new presubmit check.

R=mlippautz@chromium.org, yangguo@chromium.org, leszeks@chromium.org

Bug: v8:8616
Change-Id: Idae7031b88b793253b63488c52f757513711ed73
Reviewed-on: https://chromium-review.googlesource.com/c/1417173Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59004}
parent b63fcd19
......@@ -136,8 +136,6 @@ class V8_BASE_EXPORT TimeDelta final {
static TimeDelta FromTimespec(struct timespec ts);
struct timespec ToTimespec() const;
TimeDelta& operator=(const TimeDelta& other) = default;
// Computations with other deltas.
TimeDelta operator+(const TimeDelta& other) const {
return TimeDelta(delta_ + other.delta_);
......
......@@ -351,13 +351,6 @@ class AsyncTimedHistogram {
histogram_->Start(&timer_, nullptr);
}
~AsyncTimedHistogram() = default;
AsyncTimedHistogram(const AsyncTimedHistogram& other) = default;
AsyncTimedHistogram& operator=(const AsyncTimedHistogram& other) = default;
AsyncTimedHistogram(AsyncTimedHistogram&& other) = default;
AsyncTimedHistogram& operator=(AsyncTimedHistogram&& other) = default;
// Records the time elapsed to |histogram_| and stops |timer_|.
void RecordDone() { histogram_->Stop(&timer_, nullptr); }
......
......@@ -370,14 +370,6 @@ static inline void putUTF8Triple(char*& buffer, UChar ch) {
} // namespace
String16::String16() = default;
String16::String16(const String16& other) = default;
String16::String16(String16&& other) V8_NOEXCEPT
: m_impl(std::move(other.m_impl)),
hash_code(other.hash_code) {}
String16::String16(const UChar* characters, size_t size)
: m_impl(characters, size) {}
......@@ -393,14 +385,6 @@ String16::String16(const char* characters, size_t size) {
String16::String16(const std::basic_string<UChar>& impl) : m_impl(impl) {}
String16& String16::operator=(const String16& other) = default;
String16& String16::operator=(String16&& other) V8_NOEXCEPT {
m_impl = std::move(other.m_impl);
hash_code = other.hash_code;
return *this;
}
// static
String16 String16::fromInteger(int number) {
char arr[50];
......
......@@ -22,17 +22,17 @@ class String16 {
public:
static const size_t kNotFound = static_cast<size_t>(-1);
String16();
String16(const String16& other);
String16(String16&& other) V8_NOEXCEPT;
String16() = default;
String16(const String16&) V8_NOEXCEPT = default;
String16(String16&&) V8_NOEXCEPT = default;
String16(const UChar* characters, size_t size);
String16(const UChar* characters); // NOLINT(runtime/explicit)
String16(const char* characters); // NOLINT(runtime/explicit)
String16(const char* characters, size_t size);
explicit String16(const std::basic_string<UChar>& impl);
String16& operator=(const String16& other);
String16& operator=(String16&& other) V8_NOEXCEPT;
String16& operator=(const String16&) V8_NOEXCEPT = default;
String16& operator=(String16&&) V8_NOEXCEPT = default;
static String16 fromInteger(int);
static String16 fromInteger(size_t);
......
......@@ -32,9 +32,9 @@ class AtomicSlot : public SlotBase<AtomicSlot, Tagged_t, kTaggedSize> {
class Reference {
public:
explicit Reference(Tagged_t* address) : address_(address) {}
Reference(const Reference& other) : address_(other.address_) {}
Reference(const Reference&) V8_NOEXCEPT = default;
Reference& operator=(const Reference& other) {
Reference& operator=(const Reference& other) V8_NOEXCEPT {
AsAtomicTagged::Relaxed_Store(
address_, AsAtomicTagged::Relaxed_Load(other.address_));
return *this;
......
......@@ -33,7 +33,7 @@ class ScopedExternalStringLock {
}
// Copying a lock increases the locking depth.
ScopedExternalStringLock(const ScopedExternalStringLock& other)
ScopedExternalStringLock(const ScopedExternalStringLock& other) V8_NOEXCEPT
: resource_(other.resource_) {
resource_->Lock();
}
......@@ -84,7 +84,7 @@ class OnHeapStream {
OnHeapStream(Handle<String> string, size_t start_offset, size_t end)
: string_(string), start_offset_(start_offset), length_(end) {}
OnHeapStream(const OnHeapStream& other) : start_offset_(0), length_(0) {
OnHeapStream(const OnHeapStream&) V8_NOEXCEPT : start_offset_(0), length_(0) {
UNREACHABLE();
}
......@@ -118,8 +118,10 @@ class ExternalStringStream {
data_(string->GetChars() + start_offset),
length_(length) {}
ExternalStringStream(const ExternalStringStream& other)
: lock_(other.lock_), data_(other.data_), length_(other.length_) {}
ExternalStringStream(const ExternalStringStream& other) V8_NOEXCEPT
: lock_(other.lock_),
data_(other.data_),
length_(other.length_) {}
// The no_gc argument is only here because of the templated way this class
// is used along with other implementations that require V8 heap access.
......@@ -165,7 +167,7 @@ class ChunkedStream {
explicit ChunkedStream(ScriptCompiler::ExternalSourceStream* source)
: source_(source) {}
ChunkedStream(const ChunkedStream& other) {
ChunkedStream(const ChunkedStream&) V8_NOEXCEPT {
// TODO(rmcilroy): Implement cloning for chunked streams.
UNREACHABLE();
}
......
......@@ -16,7 +16,7 @@ class ThreadId {
// Creates an invalid ThreadId.
ThreadId() { base::Relaxed_Store(&id_, kInvalidId); }
ThreadId& operator=(const ThreadId& other) {
ThreadId& operator=(const ThreadId& other) V8_NOEXCEPT {
base::Relaxed_Store(&id_, base::Relaxed_Load(&other.id_));
return *this;
}
......
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