| # HG changeset patch |
| # User Lars T Hansen <lhansen@mozilla.com> |
| # Date 1538489772 -7200 |
| # Node ID bb430eaf5521aa8ab233a45b585ff9e5dfecf4c9 |
| # Parent e87d7028568e721e8d297ce62f9622e74d29bb37 |
| Bug 1495731 - remove JS_VOLATILE_ARM, it is no longer relevant. r=waldo |
| |
| JS_VOLATILE_ARM was a workaround for a gcc 4.7 bug on B2G where it |
| would generate unaligned word accesses that should have been |
| individual byte accesses. We now require at least gcc 6.1 (and ARM |
| systems support unaligned accesses). |
| |
| Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| Upstream-Status: Backport [https://hg.mozilla.org/integration/mozilla-inbound/rev/bb430eaf5521] |
| |
| --- a/js/src/vm/TypedArrayObject-inl.h |
| +++ b/js/src/vm/TypedArrayObject-inl.h |
| @@ -259,68 +259,61 @@ class ElementSpecific { |
| return true; |
| } |
| |
| - // Inhibit unaligned accesses on ARM (bug 1097253, a compiler bug). |
| -#if defined(__arm__) && defined(__GNUC__) && !defined(__clang__) |
| -#define JS_VOLATILE_ARM volatile |
| -#else |
| -#define JS_VOLATILE_ARM |
| -#endif |
| - |
| SharedMem<void*> data = Ops::extract(source); |
| switch (source->type()) { |
| case Scalar::Int8: { |
| - SharedMem<JS_VOLATILE_ARM int8_t*> src = |
| - data.cast<JS_VOLATILE_ARM int8_t*>(); |
| + SharedMem<int8_t*> src = |
| + data.cast<int8_t*>(); |
| for (uint32_t i = 0; i < count; ++i) |
| Ops::store(dest++, ConvertNumber<T>(Ops::load(src++))); |
| break; |
| } |
| case Scalar::Uint8: |
| case Scalar::Uint8Clamped: { |
| - SharedMem<JS_VOLATILE_ARM uint8_t*> src = |
| - data.cast<JS_VOLATILE_ARM uint8_t*>(); |
| + SharedMem<uint8_t*> src = |
| + data.cast<uint8_t*>(); |
| for (uint32_t i = 0; i < count; ++i) |
| Ops::store(dest++, ConvertNumber<T>(Ops::load(src++))); |
| break; |
| } |
| case Scalar::Int16: { |
| - SharedMem<JS_VOLATILE_ARM int16_t*> src = |
| - data.cast<JS_VOLATILE_ARM int16_t*>(); |
| + SharedMem<int16_t*> src = |
| + data.cast<int16_t*>(); |
| for (uint32_t i = 0; i < count; ++i) |
| Ops::store(dest++, ConvertNumber<T>(Ops::load(src++))); |
| break; |
| } |
| case Scalar::Uint16: { |
| - SharedMem<JS_VOLATILE_ARM uint16_t*> src = |
| - data.cast<JS_VOLATILE_ARM uint16_t*>(); |
| + SharedMem<uint16_t*> src = |
| + data.cast<uint16_t*>(); |
| for (uint32_t i = 0; i < count; ++i) |
| Ops::store(dest++, ConvertNumber<T>(Ops::load(src++))); |
| break; |
| } |
| case Scalar::Int32: { |
| - SharedMem<JS_VOLATILE_ARM int32_t*> src = |
| - data.cast<JS_VOLATILE_ARM int32_t*>(); |
| + SharedMem<int32_t*> src = |
| + data.cast<int32_t*>(); |
| for (uint32_t i = 0; i < count; ++i) |
| Ops::store(dest++, ConvertNumber<T>(Ops::load(src++))); |
| break; |
| } |
| case Scalar::Uint32: { |
| - SharedMem<JS_VOLATILE_ARM uint32_t*> src = |
| - data.cast<JS_VOLATILE_ARM uint32_t*>(); |
| + SharedMem<uint32_t*> src = |
| + data.cast<uint32_t*>(); |
| for (uint32_t i = 0; i < count; ++i) |
| Ops::store(dest++, ConvertNumber<T>(Ops::load(src++))); |
| break; |
| } |
| case Scalar::Float32: { |
| - SharedMem<JS_VOLATILE_ARM float*> src = |
| - data.cast<JS_VOLATILE_ARM float*>(); |
| + SharedMem<float*> src = |
| + data.cast<float*>(); |
| for (uint32_t i = 0; i < count; ++i) |
| Ops::store(dest++, ConvertNumber<T>(Ops::load(src++))); |
| break; |
| } |
| case Scalar::Float64: { |
| - SharedMem<JS_VOLATILE_ARM double*> src = |
| - data.cast<JS_VOLATILE_ARM double*>(); |
| + SharedMem<double*> src = |
| + data.cast<double*>(); |
| for (uint32_t i = 0; i < count; ++i) |
| Ops::store(dest++, ConvertNumber<T>(Ops::load(src++))); |
| break; |
| @@ -329,8 +322,6 @@ class ElementSpecific { |
| MOZ_CRASH("setFromTypedArray with a typed array with bogus type"); |
| } |
| |
| -#undef JS_VOLATILE_ARM |
| - |
| return true; |
| } |
| |