Title: [226583] branches/safari-604-branch/Source/_javascript_Core
Revision
226583
Author
[email protected]
Date
2018-01-08 15:50:45 -0800 (Mon, 08 Jan 2018)

Log Message

Apply patch. rdar://problem/36257695

    Disable/remove SharedArrayBuffers from Web API
    rdar://problem/36077849

    Removed SharedArrayBuffer prototype and structure to disable.

    * runtime/JSGlobalObject.cpp:
    (JSC::JSGlobalObject::init):
    (JSC::JSGlobalObject::visitChildren):
    * runtime/JSGlobalObject.h:
    (JSC::JSGlobalObject::arrayBufferPrototype const):
    (JSC::JSGlobalObject::arrayBufferStructure const):

Modified Paths

Diff

Modified: branches/safari-604-branch/Source/_javascript_Core/ChangeLog (226582 => 226583)


--- branches/safari-604-branch/Source/_javascript_Core/ChangeLog	2018-01-08 23:32:53 UTC (rev 226582)
+++ branches/safari-604-branch/Source/_javascript_Core/ChangeLog	2018-01-08 23:50:45 UTC (rev 226583)
@@ -1,5 +1,21 @@
 2017-12-19  Jason Marcell  <[email protected]>
 
+        Apply patch. rdar://problem/36257695
+
+    Disable/remove SharedArrayBuffers from Web API
+    rdar://problem/36077849
+
+    Removed SharedArrayBuffer prototype and structure to disable.
+
+    * runtime/JSGlobalObject.cpp:
+    (JSC::JSGlobalObject::init):
+    (JSC::JSGlobalObject::visitChildren):
+    * runtime/JSGlobalObject.h:
+    (JSC::JSGlobalObject::arrayBufferPrototype const):
+    (JSC::JSGlobalObject::arrayBufferStructure const):
+
+2017-12-19  Jason Marcell  <[email protected]>
+
         Apply patch. rdar://problem/36111993
 
     Cherry-pick r225363, r225437, r225632, r225659, r225697, r225857. rdar://problem/36085975

Modified: branches/safari-604-branch/Source/_javascript_Core/runtime/JSGlobalObject.cpp (226582 => 226583)


--- branches/safari-604-branch/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2018-01-08 23:32:53 UTC (rev 226582)
+++ branches/safari-604-branch/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2018-01-08 23:50:45 UTC (rev 226583)
@@ -571,8 +571,10 @@
     
     m_arrayBufferPrototype.set(vm, this, JSArrayBufferPrototype::create(vm, this, JSArrayBufferPrototype::createStructure(vm, this, m_objectPrototype.get()), ArrayBufferSharingMode::Default));
     m_arrayBufferStructure.set(vm, this, JSArrayBuffer::createStructure(vm, this, m_arrayBufferPrototype.get()));
+#if ENABLE(SHARED_ARRAY_BUFFER)
     m_sharedArrayBufferPrototype.set(vm, this, JSArrayBufferPrototype::create(vm, this, JSArrayBufferPrototype::createStructure(vm, this, m_objectPrototype.get()), ArrayBufferSharingMode::Shared));
     m_sharedArrayBufferStructure.set(vm, this, JSArrayBuffer::createStructure(vm, this, m_sharedArrayBufferPrototype.get()));
+#endif
 
     m_iteratorPrototype.set(vm, this, IteratorPrototype::create(vm, this, IteratorPrototype::createStructure(vm, this, m_objectPrototype.get())));
     m_generatorPrototype.set(vm, this, GeneratorPrototype::create(vm, this, GeneratorPrototype::createStructure(vm, this, m_iteratorPrototype.get())));
@@ -617,10 +619,11 @@
     
     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, 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, DontEnum);
-    
+#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, DontEnum); \
@@ -683,7 +686,9 @@
     putDirectWithoutTransition(vm, vm.propertyNames->builtinNames().ArrayPrivateName(), arrayConstructor, DontEnum | DontDelete | ReadOnly);
 
     putDirectWithoutTransition(vm, vm.propertyNames->ArrayBuffer, arrayBufferConstructor, DontEnum);
+#if ENABLE(SHARED_ARRAY_BUFFER)
     putDirectWithoutTransition(vm, vm.propertyNames->SharedArrayBuffer, sharedArrayBufferConstructor, DontEnum);
+#endif
 
 #define PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
 putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Constructor, DontEnum); \
@@ -1285,8 +1290,10 @@
     
     visitor.append(thisObject->m_arrayBufferPrototype);
     visitor.append(thisObject->m_arrayBufferStructure);
+#if ENABLE(SHARED_ARRAY_BUFFER)
     visitor.append(thisObject->m_sharedArrayBufferPrototype);
     visitor.append(thisObject->m_sharedArrayBufferStructure);
+#endif
 
 #define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
     visitor.append(thisObject->m_ ## lowerName ## Prototype); \

Modified: branches/safari-604-branch/Source/_javascript_Core/runtime/JSGlobalObject.h (226582 => 226583)


--- branches/safari-604-branch/Source/_javascript_Core/runtime/JSGlobalObject.h	2018-01-08 23:32:53 UTC (rev 226582)
+++ branches/safari-604-branch/Source/_javascript_Core/runtime/JSGlobalObject.h	2018-01-08 23:50:45 UTC (rev 226583)
@@ -338,8 +338,10 @@
     WriteBarrier<Structure> m_moduleLoaderStructure;
     WriteBarrier<JSArrayBufferPrototype> m_arrayBufferPrototype;
     WriteBarrier<Structure> m_arrayBufferStructure;
+#if ENABLE(SHARED_ARRAY_BUFFER)
     WriteBarrier<JSArrayBufferPrototype> m_sharedArrayBufferPrototype;
     WriteBarrier<Structure> m_sharedArrayBufferStructure;
+#endif
 
 #define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
     WriteBarrier<capitalName ## Prototype> m_ ## lowerName ## Prototype; \
@@ -670,8 +672,13 @@
         switch (sharingMode) {
         case ArrayBufferSharingMode::Default:
             return m_arrayBufferPrototype.get();
+#if ENABLE(SHARED_ARRAY_BUFFER)
         case ArrayBufferSharingMode::Shared:
             return m_sharedArrayBufferPrototype.get();
+#else
+        default:
+            return m_arrayBufferPrototype.get();
+#endif
         }
     }
     Structure* arrayBufferStructure(ArrayBufferSharingMode sharingMode) const
@@ -679,8 +686,13 @@
         switch (sharingMode) {
         case ArrayBufferSharingMode::Default:
             return m_arrayBufferStructure.get();
+#if ENABLE(SHARED_ARRAY_BUFFER)
         case ArrayBufferSharingMode::Shared:
             return m_sharedArrayBufferStructure.get();
+#else
+        default:
+            return m_arrayBufferStructure.get();
+#endif
         }
         RELEASE_ASSERT_NOT_REACHED();
         return nullptr;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to