Title: [157654] trunk/Source
Revision
157654
Author
[email protected]
Date
2013-10-18 16:57:24 -0700 (Fri, 18 Oct 2013)

Log Message

[iOS] Upstream WebSafe{GCActivityCallback, IncrementalSweeper}IOS
https://bugs.webkit.org/show_bug.cgi?id=123049

Reviewed by Mark Hahnenberg.

Source/_javascript_Core:

* heap/Heap.cpp:
(JSC::Heap::setIncrementalSweeper):
* heap/Heap.h:
* heap/HeapTimer.h:
* heap/IncrementalSweeper.h: Make protected and export CF-variant of constructor.
Removed unused include of header RetainPtr.h. Also forward declare class MarkedBlock
(we include its header in the .cpp file) and remove include for header wtf/HashSet.h
(duplicates the include in the .cpp).
* heap/MachineStackMarker.h: Export function makeUsableFromMultipleThreads(). We aren't
making use of this now, but we'll make use of it in a subsequent patch.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* platform/ios/WebSafeGCActivityCallbackIOS.h: Added.
* platform/ios/WebSafeIncrementalSweeperIOS.h: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (157653 => 157654)


--- trunk/Source/_javascript_Core/ChangeLog	2013-10-18 23:41:24 UTC (rev 157653)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-10-18 23:57:24 UTC (rev 157654)
@@ -1,3 +1,21 @@
+2013-10-18  Daniel Bates  <[email protected]>
+
+        [iOS] Upstream WebSafe{GCActivityCallback, IncrementalSweeper}IOS
+        https://bugs.webkit.org/show_bug.cgi?id=123049
+
+        Reviewed by Mark Hahnenberg.
+
+        * heap/Heap.cpp:
+        (JSC::Heap::setIncrementalSweeper):
+        * heap/Heap.h:
+        * heap/HeapTimer.h:
+        * heap/IncrementalSweeper.h: Make protected and export CF-variant of constructor.
+        Removed unused include of header RetainPtr.h. Also forward declare class MarkedBlock
+        (we include its header in the .cpp file) and remove include for header wtf/HashSet.h
+        (duplicates the include in the .cpp).
+        * heap/MachineStackMarker.h: Export function makeUsableFromMultipleThreads(). We aren't
+        making use of this now, but we'll make use of it in a subsequent patch.
+
 2013-10-18  Anders Carlsson  <[email protected]>
 
         Remove spaces between template angle brackets

Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (157653 => 157654)


--- trunk/Source/_javascript_Core/heap/Heap.cpp	2013-10-18 23:41:24 UTC (rev 157653)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp	2013-10-18 23:57:24 UTC (rev 157654)
@@ -899,6 +899,11 @@
     return m_activityCallback.get();
 }
 
+void Heap::setIncrementalSweeper(PassOwnPtr<IncrementalSweeper> sweeper)
+{
+    m_sweeper = sweeper;
+}
+
 IncrementalSweeper* Heap::sweeper()
 {
     return m_sweeper.get();

Modified: trunk/Source/_javascript_Core/heap/Heap.h (157653 => 157654)


--- trunk/Source/_javascript_Core/heap/Heap.h	2013-10-18 23:41:24 UTC (rev 157653)
+++ trunk/Source/_javascript_Core/heap/Heap.h	2013-10-18 23:57:24 UTC (rev 157654)
@@ -110,6 +110,7 @@
         JS_EXPORT_PRIVATE void setGarbageCollectionTimerEnabled(bool);
 
         JS_EXPORT_PRIVATE IncrementalSweeper* sweeper();
+        JS_EXPORT_PRIVATE void setIncrementalSweeper(PassOwnPtr<IncrementalSweeper>);
 
         // true if collection is in progress
         inline bool isCollecting();

Modified: trunk/Source/_javascript_Core/heap/HeapTimer.h (157653 => 157654)


--- trunk/Source/_javascript_Core/heap/HeapTimer.h	2013-10-18 23:41:24 UTC (rev 157653)
+++ trunk/Source/_javascript_Core/heap/HeapTimer.h	2013-10-18 23:57:24 UTC (rev 157654)
@@ -50,7 +50,7 @@
     HeapTimer(VM*);
 #endif
     
-    virtual ~HeapTimer();
+    JS_EXPORT_PRIVATE virtual ~HeapTimer();
     virtual void doWork() = 0;
     
 protected:

Modified: trunk/Source/_javascript_Core/heap/IncrementalSweeper.h (157653 => 157654)


--- trunk/Source/_javascript_Core/heap/IncrementalSweeper.h	2013-10-18 23:41:24 UTC (rev 157653)
+++ trunk/Source/_javascript_Core/heap/IncrementalSweeper.h	2013-10-18 23:57:24 UTC (rev 157654)
@@ -27,42 +27,39 @@
 #define IncrementalSweeper_h
 
 #include "HeapTimer.h"
-#include "MarkedBlock.h"
-#include <wtf/HashSet.h>
 #include <wtf/PassOwnPtr.h>
-#include <wtf/RetainPtr.h>
 #include <wtf/Vector.h>
 
 namespace JSC {
 
 class Heap;
+class MarkedBlock;
 
 class IncrementalSweeper : public HeapTimer {
 public:
     static PassOwnPtr<IncrementalSweeper> create(Heap*);
     void startSweeping(Vector<MarkedBlock*>&);
-    virtual void doWork() OVERRIDE;
+    JS_EXPORT_PRIVATE virtual void doWork() OVERRIDE;
     void sweepNextBlock();
     void willFinishSweeping();
 
-private:
-#if USE(CF) || PLATFORM(BLACKBERRY)
+protected:
 #if USE(CF)
-    IncrementalSweeper(Heap*, CFRunLoopRef);
-#else
+    JS_EXPORT_PRIVATE IncrementalSweeper(Heap*, CFRunLoopRef);
+#elif PLATFORM(BLACKBERRY)
     IncrementalSweeper(Heap*);
+#else
+    IncrementalSweeper(VM*);
 #endif
-    
+
+#if USE(CF) || PLATFORM(BLACKBERRY)
+private:
     void doSweep(double startTime);
     void scheduleTimer();
     void cancelTimer();
     
     unsigned m_currentBlockToSweepIndex;
     Vector<MarkedBlock*>& m_blocksToSweep;
-#else
-    
-    IncrementalSweeper(VM*);
-    
 #endif
 };
 

Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.h (157653 => 157654)


--- trunk/Source/_javascript_Core/heap/MachineStackMarker.h	2013-10-18 23:41:24 UTC (rev 157653)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.h	2013-10-18 23:57:24 UTC (rev 157654)
@@ -39,7 +39,7 @@
 
         void gatherConservativeRoots(ConservativeRoots&, void* stackCurrent);
 
-        void makeUsableFromMultipleThreads();
+        JS_EXPORT_PRIVATE void makeUsableFromMultipleThreads();
         JS_EXPORT_PRIVATE void addCurrentThread(); // Only needs to be called by clients that can use the same heap from multiple threads.
 
     private:

Modified: trunk/Source/WebCore/ChangeLog (157653 => 157654)


--- trunk/Source/WebCore/ChangeLog	2013-10-18 23:41:24 UTC (rev 157653)
+++ trunk/Source/WebCore/ChangeLog	2013-10-18 23:57:24 UTC (rev 157654)
@@ -1,3 +1,14 @@
+2013-10-18  Daniel Bates  <[email protected]>
+
+        [iOS] Upstream WebSafe{GCActivityCallback, IncrementalSweeper}IOS
+        https://bugs.webkit.org/show_bug.cgi?id=123049
+
+        Reviewed by Mark Hahnenberg.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/ios/WebSafeGCActivityCallbackIOS.h: Added.
+        * platform/ios/WebSafeIncrementalSweeperIOS.h: Added.
+
 2013-10-18  Anders Carlsson  <[email protected]>
 
         Remove spaces between template angle brackets

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (157653 => 157654)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2013-10-18 23:41:24 UTC (rev 157653)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2013-10-18 23:57:24 UTC (rev 157654)
@@ -5377,6 +5377,8 @@
 		CE7B2DB41586ABAD0098B3FA /* AlternativeTextUIController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */; };
 		CE7B2DB51586ABAD0098B3FA /* TextAlternativeWithRange.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CE7B2DB61586ABAD0098B3FA /* TextAlternativeWithRange.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE7B2DB21586ABAD0098B3FA /* TextAlternativeWithRange.mm */; };
+		A502C5DF13049B3500FC7D53 /* WebSafeGCActivityCallbackIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A502C5DD13049B3500FC7D53 /* WebSafeGCActivityCallbackIOS.h */; };
+		CE95208A1811B475007A5392 /* WebSafeIncrementalSweeperIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */; };
 		CECADFC6153778FF00E37068 /* DictationAlternative.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CECADFC2153778FF00E37068 /* DictationAlternative.cpp */; };
 		CECADFC7153778FF00E37068 /* DictationAlternative.h in Headers */ = {isa = PBXBuildFile; fileRef = CECADFC3153778FF00E37068 /* DictationAlternative.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CECADFC8153778FF00E37068 /* DictationCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CECADFC4153778FF00E37068 /* DictationCommand.cpp */; };
@@ -12329,6 +12331,8 @@
 		CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AlternativeTextUIController.mm; path = mac/AlternativeTextUIController.mm; sourceTree = "<group>"; };
 		CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextAlternativeWithRange.h; path = mac/TextAlternativeWithRange.h; sourceTree = "<group>"; };
 		CE7B2DB21586ABAD0098B3FA /* TextAlternativeWithRange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TextAlternativeWithRange.mm; path = mac/TextAlternativeWithRange.mm; sourceTree = "<group>"; };
+		A502C5DD13049B3500FC7D53 /* WebSafeGCActivityCallbackIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSafeGCActivityCallbackIOS.h; path = ios/WebSafeGCActivityCallbackIOS.h; sourceTree = "<group>"; };
+		C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSafeIncrementalSweeperIOS.h; path = ios/WebSafeIncrementalSweeperIOS.h; sourceTree = "<group>"; };
 		CECADFC2153778FF00E37068 /* DictationAlternative.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictationAlternative.cpp; sourceTree = "<group>"; };
 		CECADFC3153778FF00E37068 /* DictationAlternative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictationAlternative.h; sourceTree = "<group>"; };
 		CECADFC4153778FF00E37068 /* DictationCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictationCommand.cpp; sourceTree = "<group>"; };
@@ -17018,6 +17022,8 @@
 				E45390190EAFCACA003695C8 /* PasteboardIOS.mm */,
 				C5278B0B17F212EA003A2998 /* PlatformPasteboardIOS.mm */,
 				E45390350EAFD637003695C8 /* SharedTimerIOS.mm */,
+				A502C5DD13049B3500FC7D53 /* WebSafeGCActivityCallbackIOS.h */,
+				C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */,
 			);
 			name = ios;
 			sourceTree = "<group>";
@@ -21678,6 +21684,7 @@
 				0753860314489E9800B78452 /* CachedTextTrack.h in Headers */,
 				BCB16C280979C3BD00467741 /* CachedXSLStyleSheet.h in Headers */,
 				93F1995008245E59001E9ABC /* CachePolicy.h in Headers */,
+				A502C5DF13049B3500FC7D53 /* WebSafeGCActivityCallbackIOS.h in Headers */,
 				49AE2D97134EE5F90072920A /* CalculationValue.h in Headers */,
 				B1D5ECB5134B58DA0087C78F /* CallbackFunction.h in Headers */,
 				6E4E91AD10F7FB3100A2779C /* CanvasContextAttributes.h in Headers */,
@@ -23625,6 +23632,7 @@
 				37919C240B7D188600A56998 /* PositionIterator.h in Headers */,
 				9746AF3214F4DDE6003E7A70 /* PositionOptions.h in Headers */,
 				C0F2A44113869AAB0066C534 /* preprocessor.pm in Headers */,
+				CE95208A1811B475007A5392 /* WebSafeIncrementalSweeperIOS.h in Headers */,
 				B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */,
 				A8EA7EBC0A1945D000A8EF5F /* ProcessingInstruction.h in Headers */,
 				E44613EC0CD681B500FADA75 /* ProgressEvent.h in Headers */,

Added: trunk/Source/WebCore/platform/ios/WebSafeGCActivityCallbackIOS.h (0 => 157654)


--- trunk/Source/WebCore/platform/ios/WebSafeGCActivityCallbackIOS.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/ios/WebSafeGCActivityCallbackIOS.h	2013-10-18 23:57:24 UTC (rev 157654)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebSafeGCActivityCallbackIOS_h
+#define WebSafeGCActivityCallbackIOS_h
+
+#include "WebCoreThread.h"
+#include <_javascript_Core/GCActivityCallback.h>
+
+namespace WebCore {
+
+class WebSafeGCActivityCallback FINAL : public JSC::DefaultGCActivityCallback {
+public:
+    static PassOwnPtr<WebSafeGCActivityCallback> create(JSC::Heap* heap)
+    {
+        return adoptPtr(new WebSafeGCActivityCallback(heap));
+    }
+
+    virtual ~WebSafeGCActivityCallback() OVERRIDE { }
+
+private:
+    WebSafeGCActivityCallback(JSC::Heap* heap)
+        : JSC::DefaultGCActivityCallback(heap, WebThreadRunLoop())
+    {
+    }
+};
+
+} // namespace WebCore
+
+#endif // WebSafeGCActivityCallbackIOS_h

Added: trunk/Source/WebCore/platform/ios/WebSafeIncrementalSweeperIOS.h (0 => 157654)


--- trunk/Source/WebCore/platform/ios/WebSafeIncrementalSweeperIOS.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/ios/WebSafeIncrementalSweeperIOS.h	2013-10-18 23:57:24 UTC (rev 157654)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebSafeIncrementalSweeperIOS_h
+#define WebSafeIncrementalSweeperIOS_h
+
+#include "WebCoreThread.h"
+#include <_javascript_Core/IncrementalSweeper.h>
+
+namespace WebCore {
+
+class WebSafeIncrementalSweeper FINAL : public JSC::IncrementalSweeper {
+public:
+    static PassOwnPtr<WebSafeIncrementalSweeper> create(JSC::Heap* heap)
+    {
+        return adoptPtr(new WebSafeIncrementalSweeper(heap));
+    }
+
+    virtual ~WebSafeIncrementalSweeper() OVERRIDE { }
+
+private:
+    WebSafeIncrementalSweeper(JSC::Heap* heap)
+        : JSC::IncrementalSweeper(heap, WebThreadRunLoop())
+    {
+    }
+};
+
+} // namespace WebCore
+
+#endif // WebSafeIncrementalSweeperIOS_h
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to