Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Unified Diff: src/handles.cc

Issue 2632713003: Remove ~MaybeHandle and statically assert that handles are trivially copyable
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/handles.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.cc
diff --git a/src/handles.cc b/src/handles.cc
index 3b1902e076ff397b238d3f2cf17eb99611160db0..e4562eaf8e5a31c240ffd005f4ffc336dd06d304 100644
--- a/src/handles.cc
+++ b/src/handles.cc
@@ -12,6 +12,16 @@
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(std::is_trivially_copyable<HandleBase>::value,
+ "HandleBase should be trivially copyable");
+static_assert(std::is_trivially_copyable<Handle<Object>>::value,
+ "Handle<Object> should be trivially copyable");
+static_assert(std::is_trivially_copyable<MaybeHandle<Object>>::value,
+ "MaybeHandle<Object> should be trivially copyable");
+
#ifdef DEBUG
bool HandleBase::IsDereferenceAllowed(DereferenceCheckMode mode) const {
DCHECK_NOT_NULL(location_);
« no previous file with comments | « src/handles.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698