Title: [227104] trunk
Revision
227104
Author
sbar...@apple.com
Date
2018-01-17 17:58:25 -0800 (Wed, 17 Jan 2018)

Log Message

Disable Atomics when SharedArrayBuffer isn’t enabled
https://bugs.webkit.org/show_bug.cgi?id=181572
<rdar://problem/36553206>

Reviewed by Michael Saboff.

JSTests:

* stress/isLockFree.js:

Source/_javascript_Core:

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::createAtomicsProperty): Deleted.

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (227103 => 227104)


--- trunk/JSTests/ChangeLog	2018-01-18 01:58:05 UTC (rev 227103)
+++ trunk/JSTests/ChangeLog	2018-01-18 01:58:25 UTC (rev 227104)
@@ -1,5 +1,15 @@
 2018-01-17  Saam Barati  <sbar...@apple.com>
 
+        Disable Atomics when SharedArrayBuffer isn’t enabled
+        https://bugs.webkit.org/show_bug.cgi?id=181572
+        <rdar://problem/36553206>
+
+        Reviewed by Michael Saboff.
+
+        * stress/isLockFree.js:
+
+2018-01-17  Saam Barati  <sbar...@apple.com>
+
         DFG::Node::convertToConstant needs to clear the varargs flags
         https://bugs.webkit.org/show_bug.cgi?id=181697
         <rdar://problem/36497332>

Modified: trunk/JSTests/stress/isLockFree.js (227103 => 227104)


--- trunk/JSTests/stress/isLockFree.js	2018-01-18 01:58:05 UTC (rev 227103)
+++ trunk/JSTests/stress/isLockFree.js	2018-01-18 01:58:25 UTC (rev 227104)
@@ -1,3 +1,5 @@
+//@ skip
+
 function foo(bytes) {
     return Atomics.isLockFree(bytes);
 }

Modified: trunk/Source/_javascript_Core/ChangeLog (227103 => 227104)


--- trunk/Source/_javascript_Core/ChangeLog	2018-01-18 01:58:05 UTC (rev 227103)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-01-18 01:58:25 UTC (rev 227104)
@@ -1,5 +1,17 @@
 2018-01-17  Saam Barati  <sbar...@apple.com>
 
+        Disable Atomics when SharedArrayBuffer isn’t enabled
+        https://bugs.webkit.org/show_bug.cgi?id=181572
+        <rdar://problem/36553206>
+
+        Reviewed by Michael Saboff.
+
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init):
+        (JSC::createAtomicsProperty): Deleted.
+
+2018-01-17  Saam Barati  <sbar...@apple.com>
+
         Support MultiGetByOffset in the DFG
         https://bugs.webkit.org/show_bug.cgi?id=181466
 

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (227103 => 227104)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2018-01-18 01:58:05 UTC (rev 227103)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2018-01-18 01:58:25 UTC (rev 227104)
@@ -212,12 +212,6 @@
     return ConsoleObject::create(vm, global, ConsoleObject::createStructure(vm, global, constructEmptyObject(global->globalExec())));
 }
 
-static JSValue createAtomicsProperty(VM& vm, JSObject* object)
-{
-    JSGlobalObject* global = jsCast<JSGlobalObject*>(object);
-    return AtomicsObject::create(vm, global, AtomicsObject::createStructure(vm, global, global->objectPrototype()));
-}
-
 static EncodedJSValue JSC_HOST_CALL makeBoundFunction(ExecState* exec)
 {
     VM& vm = exec->vm();
@@ -308,7 +302,6 @@
   Proxy                 createProxyProperty                          DontEnum|PropertyCallback
   JSON                  createJSONProperty                           DontEnum|PropertyCallback
   Math                  createMathProperty                           DontEnum|PropertyCallback
-  Atomics               createAtomicsProperty                        DontEnum|PropertyCallback
   console               createConsoleProperty                        DontEnum|PropertyCallback
   Int8Array             JSGlobalObject::m_typedArrayInt8             DontEnum|ClassStructure
   Int16Array            JSGlobalObject::m_typedArrayInt16            DontEnum|ClassStructure
@@ -664,11 +657,15 @@
     
     JSArrayBufferConstructor* arrayBufferConstructor = JSArrayBufferConstructor::create(vm, JSArrayBufferConstructor::createStructure(vm, this, m_functionPrototype.get()), m_arrayBufferPrototype.get(), m_speciesGetterSetter.get(), ArrayBufferSharingMode::Default);
     m_arrayBufferPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, arrayBufferConstructor, static_cast<unsigned>(PropertyAttribute::DontEnum));
+
 #if ENABLE(SHARED_ARRAY_BUFFER)
     JSArrayBufferConstructor* sharedArrayBufferConstructor = nullptr;
     sharedArrayBufferConstructor = JSArrayBufferConstructor::create(vm, JSArrayBufferConstructor::createStructure(vm, this, m_functionPrototype.get()), m_sharedArrayBufferPrototype.get(), m_speciesGetterSetter.get(), ArrayBufferSharingMode::Shared);
     m_sharedArrayBufferPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, sharedArrayBufferConstructor, static_cast<unsigned>(PropertyAttribute::DontEnum));
+
+    AtomicsObject* atomicsObject = AtomicsObject::create(vm, this, AtomicsObject::createStructure(vm, this, m_objectPrototype.get()));
 #endif
+
 #define CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
 capitalName ## Constructor* lowerName ## Constructor = capitalName ## Constructor::create(vm, capitalName ## Constructor::createStructure(vm, this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get(), m_speciesGetterSetter.get()); \
 m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, lowerName ## Constructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); \
@@ -747,6 +744,7 @@
     putDirectWithoutTransition(vm, vm.propertyNames->ArrayBuffer, arrayBufferConstructor, static_cast<unsigned>(PropertyAttribute::DontEnum));
 #if ENABLE(SHARED_ARRAY_BUFFER)
     putDirectWithoutTransition(vm, vm.propertyNames->SharedArrayBuffer, sharedArrayBufferConstructor, static_cast<unsigned>(PropertyAttribute::DontEnum));
+    putDirectWithoutTransition(vm, Identifier::fromString(exec, "Atomics"), atomicsObject, static_cast<unsigned>(PropertyAttribute::DontEnum));
 #endif
 
 #define PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to