Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
MozillaFirefox.11385
mozilla-bigendian_bit_flags_alias.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mozilla-bigendian_bit_flags_alias.patch of Package MozillaFirefox.11385
# HG changeset patch # User Steve Fink <sfink@mozilla.com> # Date 1536603384 25200 # Mon Sep 10 11:16:24 2018 -0700 # Node ID 5ae88679757a2b2ed538b019a55f63c0f5fe026c # Parent a9a2adb25cee04ef0e44149793507a62f1afdb68 Bug 1488552 - JSString flags bit must alias the low 32 bits of JSObject.group_, not the high 32. r=tcampbell diff -r a9a2adb25cee js/src/gc/Marking-inl.h --- a/js/src/gc/Marking-inl.h Tue May 21 08:45:31 2019 +0200 +++ b/js/src/gc/Marking-inl.h Tue May 21 17:38:12 2019 +0200 @@ -82,12 +82,12 @@ MOZ_ASSERT(!isForwarded()); // The location of magic_ is important because it must never be valid to see // the value Relocated there in a GC thing that has not been moved. - static_assert(offsetof(RelocationOverlay, magic_) == - offsetof(JSObject, group_) + sizeof(uint32_t), - "RelocationOverlay::magic_ is in the wrong location"); - static_assert(offsetof(RelocationOverlay, magic_) == - offsetof(js::Shape, base_) + sizeof(uint32_t), - "RelocationOverlay::magic_ is in the wrong location"); + //static_assert(offsetof(RelocationOverlay, magic_) == + // offsetof(JSObject, group_) + sizeof(uint32_t), + // "RelocationOverlay::magic_ is in the wrong location"); + //static_assert(offsetof(RelocationOverlay, magic_) == + // offsetof(js::Shape, base_) + sizeof(uint32_t), + // "RelocationOverlay::magic_ is in the wrong location"); static_assert( offsetof(RelocationOverlay, magic_) == offsetof(JSString, d.u1.length), "RelocationOverlay::magic_ is in the wrong location"); diff -r a9a2adb25cee js/src/gc/RelocationOverlay.h --- a/js/src/gc/RelocationOverlay.h Tue May 21 08:45:31 2019 +0200 +++ b/js/src/gc/RelocationOverlay.h Tue May 21 17:38:12 2019 +0200 @@ -33,14 +33,25 @@ /* See comment in js/public/HeapAPI.h. */ static const uint32_t Relocated = js::gc::Relocated; +#if MOZ_LITTLE_ENDIAN /* - * Keep the low 32 bits untouched. Use them to distinguish strings from + * Keep the first 32 bits untouched. Use them to distinguish strings from * objects in the nursery. */ uint32_t preserve_; /* Set to Relocated when moved. */ uint32_t magic_; +#elif JS_BITS_PER_WORD == 64 + /* + * On big-endian, we need to reorder to keep preserve_ lined up with the + * low 32 bits of the aligned group_ pointer in JSObject. + */ + uint32_t magic_; + uint32_t preserve_; +#else +# error "Support for 32-bit big-endian architectures is untested. See bug 1488552." +#endif /* The location |this| was moved to. */ Cell* newLocation_; diff -r a9a2adb25cee js/src/jsfriendapi.h --- a/js/src/jsfriendapi.h Tue May 21 08:45:31 2019 +0200 +++ b/js/src/jsfriendapi.h Tue May 21 17:38:12 2019 +0200 @@ -609,8 +609,15 @@ static const uint32_t LATIN1_CHARS_BIT = JS_BIT(6); static const uint32_t EXTERNAL_FLAGS = LINEAR_BIT | NON_ATOM_BIT | JS_BIT(5); static const uint32_t TYPE_FLAGS_MASK = JS_BIT(6) - 1; +#if MOZ_LITTLE_ENDIAN uint32_t flags; uint32_t length; +#elif JS_BITS_PER_WORD == 64 + uint32_t length; + uint32_t flags; +#else +# error "Support for 32-bit big-endian architectures is untested. See bug 1488552." +#endif union { const JS::Latin1Char* nonInlineCharsLatin1; const char16_t* nonInlineCharsTwoByte; diff -r a9a2adb25cee js/src/vm/StringType.h --- a/js/src/vm/StringType.h Tue May 21 08:45:31 2019 +0200 +++ b/js/src/vm/StringType.h Tue May 21 17:38:12 2019 +0200 @@ -7,6 +7,7 @@ #ifndef vm_StringType_h #define vm_StringType_h +#include "mozilla/EndianUtils.h" #include "mozilla/MemoryReporting.h" #include "mozilla/PodOperations.h" #include "mozilla/Range.h" @@ -168,8 +169,20 @@ struct Data { union { struct { +#if MOZ_LITTLE_ENDIAN uint32_t flags; /* JSString */ uint32_t length; /* JSString */ +#elif JS_BITS_PER_WORD == 64 + /* + * On big-endian, we need to reorder to keep flags lined up + * with the low 32 bits of the aligned group_ pointer in + * JSObject. + */ + uint32_t length; /* JSString */ + uint32_t flags; /* JSString */ +#else +# error "Support for 32-bit big-endian architectures is untested. See bug 1488552." +#endif }; uintptr_t flattenData; /* JSRope (temporary while flattening) */ } u1;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor