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

Unified Diff: src/objects-inl.h

Issue 1150953002: Generalize HeapObject alignment requirements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review comments. Created 5 years, 7 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/objects-debug.cc ('k') | src/snapshot/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 50d02f9f655e887b10cf5dc4e290d0a343cd7480..b76b2c9764241a50a2bd19400b5d304e1bb60e15 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2829,23 +2829,16 @@ WriteBarrierMode HeapObject::GetWriteBarrierMode(
}
-bool HeapObject::NeedsToEnsureDoubleAlignment() {
+AllocationAlignment HeapObject::RequiredAlignment() {
#ifdef V8_HOST_ARCH_32_BIT
- return (IsFixedFloat64Array() || IsFixedDoubleArray() ||
- IsConstantPoolArray()) &&
- FixedArrayBase::cast(this)->length() != 0;
-#else
- return false;
-#endif // V8_HOST_ARCH_32_BIT
-}
-
-
-bool HeapObject::NeedsToEnsureDoubleUnalignment() {
-#ifdef V8_HOST_ARCH_32_BIT
- return IsHeapNumber();
-#else
- return false;
+ if ((IsFixedFloat64Array() || IsFixedDoubleArray() ||
+ IsConstantPoolArray()) &&
+ FixedArrayBase::cast(this)->length() != 0) {
+ return kDoubleAligned;
+ }
+ if (IsHeapNumber()) return kDoubleUnaligned;
#endif // V8_HOST_ARCH_32_BIT
+ return kWordAligned;
}
« no previous file with comments | « src/objects-debug.cc ('k') | src/snapshot/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698