blob: a20873cb0b2343c07abddfa7e30d7d13355055ea [file] [log] [blame]
Andrew Geissler97771a32021-03-05 15:23:11 -06001# HG changeset patch
2# User Lars T Hansen <lhansen@mozilla.com>
3# Date 1538489772 -7200
4# Node ID bb430eaf5521aa8ab233a45b585ff9e5dfecf4c9
5# Parent e87d7028568e721e8d297ce62f9622e74d29bb37
6Bug 1495731 - remove JS_VOLATILE_ARM, it is no longer relevant. r=waldo
7
8JS_VOLATILE_ARM was a workaround for a gcc 4.7 bug on B2G where it
9would generate unaligned word accesses that should have been
10individual byte accesses. We now require at least gcc 6.1 (and ARM
11systems support unaligned accesses).
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14Upstream-Status: Backport [https://hg.mozilla.org/integration/mozilla-inbound/rev/bb430eaf5521]
15
16--- a/js/src/vm/TypedArrayObject-inl.h
17+++ b/js/src/vm/TypedArrayObject-inl.h
18@@ -259,68 +259,61 @@ class ElementSpecific {
19 return true;
20 }
21
22- // Inhibit unaligned accesses on ARM (bug 1097253, a compiler bug).
23-#if defined(__arm__) && defined(__GNUC__) && !defined(__clang__)
24-#define JS_VOLATILE_ARM volatile
25-#else
26-#define JS_VOLATILE_ARM
27-#endif
28-
29 SharedMem<void*> data = Ops::extract(source);
30 switch (source->type()) {
31 case Scalar::Int8: {
32- SharedMem<JS_VOLATILE_ARM int8_t*> src =
33- data.cast<JS_VOLATILE_ARM int8_t*>();
34+ SharedMem<int8_t*> src =
35+ data.cast<int8_t*>();
36 for (uint32_t i = 0; i < count; ++i)
37 Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
38 break;
39 }
40 case Scalar::Uint8:
41 case Scalar::Uint8Clamped: {
42- SharedMem<JS_VOLATILE_ARM uint8_t*> src =
43- data.cast<JS_VOLATILE_ARM uint8_t*>();
44+ SharedMem<uint8_t*> src =
45+ data.cast<uint8_t*>();
46 for (uint32_t i = 0; i < count; ++i)
47 Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
48 break;
49 }
50 case Scalar::Int16: {
51- SharedMem<JS_VOLATILE_ARM int16_t*> src =
52- data.cast<JS_VOLATILE_ARM int16_t*>();
53+ SharedMem<int16_t*> src =
54+ data.cast<int16_t*>();
55 for (uint32_t i = 0; i < count; ++i)
56 Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
57 break;
58 }
59 case Scalar::Uint16: {
60- SharedMem<JS_VOLATILE_ARM uint16_t*> src =
61- data.cast<JS_VOLATILE_ARM uint16_t*>();
62+ SharedMem<uint16_t*> src =
63+ data.cast<uint16_t*>();
64 for (uint32_t i = 0; i < count; ++i)
65 Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
66 break;
67 }
68 case Scalar::Int32: {
69- SharedMem<JS_VOLATILE_ARM int32_t*> src =
70- data.cast<JS_VOLATILE_ARM int32_t*>();
71+ SharedMem<int32_t*> src =
72+ data.cast<int32_t*>();
73 for (uint32_t i = 0; i < count; ++i)
74 Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
75 break;
76 }
77 case Scalar::Uint32: {
78- SharedMem<JS_VOLATILE_ARM uint32_t*> src =
79- data.cast<JS_VOLATILE_ARM uint32_t*>();
80+ SharedMem<uint32_t*> src =
81+ data.cast<uint32_t*>();
82 for (uint32_t i = 0; i < count; ++i)
83 Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
84 break;
85 }
86 case Scalar::Float32: {
87- SharedMem<JS_VOLATILE_ARM float*> src =
88- data.cast<JS_VOLATILE_ARM float*>();
89+ SharedMem<float*> src =
90+ data.cast<float*>();
91 for (uint32_t i = 0; i < count; ++i)
92 Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
93 break;
94 }
95 case Scalar::Float64: {
96- SharedMem<JS_VOLATILE_ARM double*> src =
97- data.cast<JS_VOLATILE_ARM double*>();
98+ SharedMem<double*> src =
99+ data.cast<double*>();
100 for (uint32_t i = 0; i < count; ++i)
101 Ops::store(dest++, ConvertNumber<T>(Ops::load(src++)));
102 break;
103@@ -329,8 +322,6 @@ class ElementSpecific {
104 MOZ_CRASH("setFromTypedArray with a typed array with bogus type");
105 }
106
107-#undef JS_VOLATILE_ARM
108-
109 return true;
110 }
111