Bug 933001 - Part 5/5 - Pref-off SharedArrayBuffer outside Nightly. r=sfink
authorSean Stangl <sstangl@mozilla.com>
Thu, 20 Feb 2014 14:49:09 -0800
changeset 171171 7bb98e166b5bd052a8753914286c4f7b5f682528
parent 171170 b21841db83df66f3f1b15fba09f24433c5e74878
child 171172 3d8a39b9c13e50f1cb199849837c3ead6ea03b9e
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerssfink
bugs933001
milestone30.0a1
Bug 933001 - Part 5/5 - Pref-off SharedArrayBuffer outside Nightly. r=sfink
dom/tests/mochitest/general/test_interfaces.html
js/src/jsprototypes.h
js/src/moz.build
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -69,16 +69,17 @@ var ecmaGlobals =
     {name: "NaN", xbl: false},
     "Number",
     "Object",
     "Proxy",
     "RangeError",
     "ReferenceError",
     "RegExp",
     "Set",
+    {name: "SharedArrayBuffer", nightly: true},
     {name: "SIMD", nightly: true},
     "StopIteration",
     "String",
     "SyntaxError",
     {name: "TypedObject", nightly: true},
     "TypeError",
     "Uint16Array",
     "Uint32Array",
--- a/js/src/jsprototypes.h
+++ b/js/src/jsprototypes.h
@@ -49,16 +49,22 @@
 #endif
 
 #ifdef ENABLE_BINARYDATA
 #define IF_BDATA(real,imaginary) real
 #else
 #define IF_BDATA(real,imaginary) imaginary
 #endif
 
+#ifdef ENABLE_SHARED_ARRAY_BUFFER
+#define IF_SAB(real,imaginary) real
+#else
+#define IF_SAB(real,imaginary) imaginary
+#endif
+
 #define JS_FOR_PROTOTYPES(real,imaginary) \
     imaginary(Null,              0,     js_InitNullClass,          dummy) \
     real(Object,                 1,     js_InitObjectClass,        &JSObject::class_) \
     real(Function,               2,     js_InitFunctionClass,      &JSFunction::class_) \
     real(Array,                  3,     js_InitArrayClass,         OCLASP(Array)) \
     real(Boolean,                4,     js_InitBooleanClass,       OCLASP(Boolean)) \
     real(JSON,                   5,     js_InitJSONClass,          CLASP(JSON)) \
     real(Date,                   6,     js_InitViaClassSpec,       OCLASP(Date)) \
@@ -86,17 +92,17 @@
     real(Float32Array,          28,     js_InitTypedArrayClasses,  TYPED_ARRAY_CLASP(TYPE_FLOAT32)) \
     real(Float64Array,          29,     js_InitTypedArrayClasses,  TYPED_ARRAY_CLASP(TYPE_FLOAT64)) \
     real(Uint8ClampedArray,     30,     js_InitTypedArrayClasses,  TYPED_ARRAY_CLASP(TYPE_UINT8_CLAMPED)) \
     real(Proxy,                 31,     js_InitProxyClass,         &ProxyObject::uncallableClass_) \
     real(WeakMap,               32,     js_InitWeakMapClass,       OCLASP(WeakMap)) \
     real(Map,                   33,     js_InitMapClass,           OCLASP(Map)) \
     real(Set,                   34,     js_InitSetClass,           OCLASP(Set)) \
     real(DataView,              35,     js_InitTypedArrayClasses,  OCLASP(DataView)) \
-    real(SharedArrayBuffer,     36,     js_InitSharedArrayBufferClass, &js::SharedArrayBufferObject::protoClass) \
+IF_SAB(real,imaginary)(SharedArrayBuffer,       36,     js_InitSharedArrayBufferClass, &js::SharedArrayBufferObject::protoClass) \
 IF_INTL(real,imaginary) (Intl,                  37,     js_InitIntlClass,          CLASP(Intl)) \
 IF_BDATA(real,imaginary)(TypedObject,           38,     js_InitTypedObjectModuleObject,   OCLASP(TypedObjectModule)) \
     imaginary(GeneratorFunction,     39,     js_InitIteratorClasses, dummy) \
 IF_BDATA(real,imaginary)(SIMD,                  40,     js_InitSIMDClass, OCLASP(SIMD)) \
 
 #define JS_FOR_EACH_PROTOTYPE(macro) JS_FOR_PROTOTYPES(macro,macro)
 
 #endif /* jsprototypes_h */
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -423,16 +423,17 @@ if CONFIG['MOZ_ETW']:
         'ETWProvider.h',
     ]
     # This will get the ETW provider resources into the library mozjs.dll
     RESFILE = 'ETWProvider.res'
 
 if CONFIG['NIGHTLY_BUILD']:
     DEFINES['ENABLE_PARALLEL_JS'] = True
     DEFINES['ENABLE_BINARYDATA'] = True
+    DEFINES['ENABLE_SHARED_ARRAY_BUFFER'] = True
 
 DEFINES['EXPORT_JS_API'] = True
 
 if CONFIG['JS_THREADSAFE']:
     DEFINES['JS_THREADSAFE'] = True
 
 if CONFIG['JS_HAS_CTYPES']:
     DEFINES['JS_HAS_CTYPES'] = True