Commit 1dfaec26 authored by Loo Rong Jie's avatar Loo Rong Jie Committed by Commit Bot

Partial revert of "Remove ~MaybeHandle and statically assert that handles are trivially copyable"

Reason: cause Blink regression on Android

Original CL: https://chromium-review.googlesource.com/c/538463/

Bug: chromium:735910
Change-Id: I405e71f6ffeaf9fa467036a6fafa0271a60de9d3
Reviewed-on: https://chromium-review.googlesource.com/593247Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Loo Rong Jie <loorongjie@gmail.com>
Cr-Commit-Position: refs/heads/master@{#46995}
parent d4c157ee
......@@ -189,12 +189,6 @@ V8_INLINE Dest bit_cast(Source const& source) {
// TODO(all) Replace all uses of this macro with static_assert, remove macro.
#define STATIC_ASSERT(test) static_assert(test, #test)
// TODO(rongjie) Remove this workaround once we require gcc >= 5.0
#if __GNUG__ && __GNUC__ < 5
#define IS_TRIVIALLY_COPYABLE(T) __has_trivial_copy(T)
#else
#define IS_TRIVIALLY_COPYABLE(T) std::is_trivially_copyable<T>::value
#endif
// The USE(x, ...) template is used to silence C++ compiler warnings
// issued for (yet) unused variables (typically parameters).
......
......@@ -12,15 +12,6 @@
namespace v8 {
namespace internal {
// Handles should be trivially copyable so that they can be efficiently passed
// by value. If they are not trivially copyable, they cannot be passed in
// registers.
static_assert(IS_TRIVIALLY_COPYABLE(HandleBase),
"HandleBase should be trivially copyable");
static_assert(IS_TRIVIALLY_COPYABLE(Handle<Object>),
"Handle<Object> should be trivially copyable");
static_assert(IS_TRIVIALLY_COPYABLE(MaybeHandle<Object>),
"MaybeHandle<Object> should be trivially copyable");
#ifdef DEBUG
bool HandleBase::IsDereferenceAllowed(DereferenceCheckMode mode) const {
......
......@@ -185,6 +185,7 @@ template <typename T>
class MaybeHandle final {
public:
V8_INLINE MaybeHandle() {}
V8_INLINE ~MaybeHandle() {}
// Constructor for handling automatic up casting from Handle.
// Ex. Handle<JSArray> can be passed when MaybeHandle<Object> is expected.
......
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