Title: [96465] trunk/Source
Revision
96465
Author
[email protected]
Date
2011-10-01 17:54:56 -0700 (Sat, 01 Oct 2011)

Log Message

Removed redundant helper functions for allocating Strong handles
https://bugs.webkit.org/show_bug.cgi?id=69218

Reviewed by Sam Weinig.

../_javascript_Core: 

* heap/Heap.h:
(JSC::Heap::handleHeap):
* runtime/JSGlobalData.h: Removed these helper functions, since they
just created indirection.

* heap/StrongInlines.h: Added. Broke out a header for inline functions
to resolve circular dependencies created by inlining. I'm told this is
the future for _javascript_Core.

* GNUmakefile.list.am:
* _javascript_Core.gypi:
* _javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj:
* _javascript_Core.xcodeproj/project.pbxproj: Go forth and build.

* API/JSCallbackObjectFunctions.h:
(JSC::::init):
* runtime/WeakGCMap.h:
(JSC::WeakGCMap::add):
(JSC::WeakGCMap::set):
* runtime/StructureTransitionTable.h:
(JSC::StructureTransitionTable::setSingleTransition):
* heap/Local.h:
(JSC::::Local):
* heap/Strong.h:
(JSC::::Strong):
(JSC::::set):
* heap/Weak.h:
(JSC::Weak::Weak):
(JSC::Weak::set): Allocate handles directly instead of going through a
chain of forwarding functions.

* bytecompiler/BytecodeGenerator.cpp:
* runtime/JSGlobalData.cpp:
* runtime/LiteralParser.cpp:
* runtime/RegExpCache.cpp: Updated for header changes.

../_javascript_Glue: 

* JSRun.cpp:
* JSValueWrapper.cpp:

../WebCore: 

* ForwardingHeaders/heap/StrongInlines.h: Added.
* bindings/js/JSCallbackData.h:
* bindings/js/JSDOMWindowShell.cpp:
* bindings/js/ScheduledAction.h:
* bindings/js/ScriptCachedFrameData.cpp:
* bindings/js/ScriptController.cpp:
* bindings/js/ScriptState.cpp:
* bindings/js/ScriptValue.h:
* bindings/js/WorkerScriptController.cpp:
* bridge/runtime_root.cpp:

../WebKit2: 

* WebProcess/Plugins/Netscape/NPJSObject.cpp:
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/_javascript_Core/API/JSCallbackObjectFunctions.h (96464 => 96465)


--- trunk/Source/_javascript_Core/API/JSCallbackObjectFunctions.h	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/API/JSCallbackObjectFunctions.h	2011-10-02 00:54:56 UTC (rev 96465)
@@ -106,7 +106,7 @@
     for (JSClassRef jsClassPtr = classRef(); jsClassPtr && !needsFinalizer; jsClassPtr = jsClassPtr->parentClass)
         needsFinalizer = jsClassPtr->finalize;
     if (needsFinalizer) {
-        HandleSlot slot = exec->globalData().allocateGlobalHandle();
+        HandleSlot slot = exec->globalData().heap.handleHeap()->allocate();
         HandleHeap::heapFor(slot)->makeWeak(slot, m_callbackObjectData.get(), classRef());
         HandleHeap::heapFor(slot)->writeBarrier(slot, this);
         *slot = this;

Modified: trunk/Source/_javascript_Core/ChangeLog (96464 => 96465)


--- trunk/Source/_javascript_Core/ChangeLog	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-10-02 00:54:56 UTC (rev 96465)
@@ -1,3 +1,46 @@
+2011-10-01  Geoffrey Garen  <[email protected]>
+
+        Removed redundant helper functions for allocating Strong handles
+        https://bugs.webkit.org/show_bug.cgi?id=69218
+
+        Reviewed by Sam Weinig.
+
+        * heap/Heap.h:
+        (JSC::Heap::handleHeap):
+        * runtime/JSGlobalData.h: Removed these helper functions, since they
+        just created indirection.
+
+        * heap/StrongInlines.h: Added. Broke out a header for inline functions
+        to resolve circular dependencies created by inlining. I'm told this is
+        the future for _javascript_Core.
+
+        * GNUmakefile.list.am:
+        * _javascript_Core.gypi:
+        * _javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj:
+        * _javascript_Core.xcodeproj/project.pbxproj: Go forth and build.
+
+        * API/JSCallbackObjectFunctions.h:
+        (JSC::::init):
+        * runtime/WeakGCMap.h:
+        (JSC::WeakGCMap::add):
+        (JSC::WeakGCMap::set):
+        * runtime/StructureTransitionTable.h:
+        (JSC::StructureTransitionTable::setSingleTransition):
+        * heap/Local.h:
+        (JSC::::Local):
+        * heap/Strong.h:
+        (JSC::::Strong):
+        (JSC::::set):
+        * heap/Weak.h:
+        (JSC::Weak::Weak):
+        (JSC::Weak::set): Allocate handles directly instead of going through a
+        chain of forwarding functions.
+
+        * bytecompiler/BytecodeGenerator.cpp:
+        * runtime/JSGlobalData.cpp:
+        * runtime/LiteralParser.cpp:
+        * runtime/RegExpCache.cpp: Updated for header changes.
+
 2011-09-30  Filip Pizlo  <[email protected]>
 
         All of JSC's heuristics should be in one place for easier tuning

Modified: trunk/Source/_javascript_Core/GNUmakefile.list.am (96464 => 96465)


--- trunk/Source/_javascript_Core/GNUmakefile.list.am	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/GNUmakefile.list.am	2011-10-02 00:54:56 UTC (rev 96465)
@@ -162,6 +162,7 @@
 	Source/_javascript_Core/heap/MarkedSpace.cpp \
 	Source/_javascript_Core/heap/MarkedSpace.h \
 	Source/_javascript_Core/heap/Strong.h \
+	Source/_javascript_Core/heap/StrongInlines.h \
 	Source/_javascript_Core/heap/VTableSpectrum.cpp \
 	Source/_javascript_Core/heap/VTableSpectrum.h \
 	Source/_javascript_Core/heap/Weak.h \

Modified: trunk/Source/_javascript_Core/_javascript_Core.gypi (96464 => 96465)


--- trunk/Source/_javascript_Core/_javascript_Core.gypi	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/_javascript_Core.gypi	2011-10-02 00:54:56 UTC (rev 96465)
@@ -38,6 +38,7 @@
             'heap/Local.h',
             'heap/LocalScope.h',
             'heap/Strong.h',
+            'heap/StrongInlines.h',
             'heap/Weak.h',
             'config.h',
             'debugger/Debugger.h',

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj (96464 => 96465)


--- trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj	2011-10-02 00:54:56 UTC (rev 96465)
@@ -1974,6 +1974,10 @@
                                     >
                             </File>
                             <File
+                                    RelativePath="..\..\heap\StrongInlines.h"
+                                    >
+                            </File>
+                            <File
                                     RelativePath="..\..\heap\Handle.h"
                                     >
                             </File>

Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (96464 => 96465)


--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2011-10-02 00:54:56 UTC (rev 96465)
@@ -166,6 +166,7 @@
 		14469DED107EC7E700650446 /* StringPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC18C3C50E16EE3300B34460 /* StringPrototype.cpp */; };
 		14469DEE107EC7E700650446 /* UString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8850255597D01FF60F7 /* UString.cpp */; };
 		144836E7132DA7BE005BE785 /* ConservativeRoots.h in Headers */ = {isa = PBXBuildFile; fileRef = 149DAAF212EB559D0083B12B /* ConservativeRoots.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		145722861437E140005FDE26 /* StrongInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 145722851437E140005FDE26 /* StrongInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		146AAB380B66A94400E55F16 /* JSStringRefCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 146AAB370B66A94400E55F16 /* JSStringRefCF.cpp */; };
 		146B16D812EB5B59001BEC1B /* ConservativeRoots.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 146B14DB12EB5B12001BEC1B /* ConservativeRoots.cpp */; };
 		146FE51211A710430087AE66 /* JITCall32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 146FE51111A710430087AE66 /* JITCall32_64.cpp */; };
@@ -891,6 +892,7 @@
 		1440FCE10A51E46B0005F061 /* JSClassRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSClassRef.h; sourceTree = "<group>"; };
 		1440FCE20A51E46B0005F061 /* JSClassRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSClassRef.cpp; sourceTree = "<group>"; };
 		14456A311314657800212CA3 /* DoublyLinkedList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DoublyLinkedList.h; sourceTree = "<group>"; };
+		145722851437E140005FDE26 /* StrongInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StrongInlines.h; sourceTree = "<group>"; };
 		145C507F0D9DF63B0088F6B9 /* CallData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallData.h; sourceTree = "<group>"; };
 		146AAB2A0B66A84900E55F16 /* JSStringRefCF.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSStringRefCF.h; sourceTree = "<group>"; };
 		146AAB370B66A94400E55F16 /* JSStringRefCF.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSStringRefCF.cpp; sourceTree = "<group>"; };
@@ -1693,6 +1695,7 @@
 				0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */,
 				0FC8150814043BCA00CFA603 /* WriteBarrierSupport.cpp */,
 				0FC8150914043BD200CFA603 /* WriteBarrierSupport.h */,
+				145722851437E140005FDE26 /* StrongInlines.h */,
 			);
 			path = heap;
 			sourceTree = "<group>";
@@ -2477,6 +2480,7 @@
 				BC257DE80E1F51C50016B6C9 /* Arguments.h in Headers */,
 				86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */,
 				86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */,
+				145722861437E140005FDE26 /* StrongInlines.h in Headers */,
 				0FD82F4B142806A100179C94 /* BitVector.h in Headers */,
 				0FD82F2B1426CA6D00179C94 /* JettisonedCodeBlocks.h in Headers */,
 				0FD82EF51423075B00179C94 /* DFGIntrinsic.h in Headers */,

Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp (96464 => 96465)


--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -34,6 +34,7 @@
 #include "JSFunction.h"
 #include "Interpreter.h"
 #include "ScopeChain.h"
+#include "StrongInlines.h"
 #include "UString.h"
 
 using namespace std;

Modified: trunk/Source/_javascript_Core/heap/Heap.h (96464 => 96465)


--- trunk/Source/_javascript_Core/heap/Heap.h	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/heap/Heap.h	2011-10-02 00:54:56 UTC (rev 96465)
@@ -118,11 +118,10 @@
         
         template<typename Functor> typename Functor::ReturnType forEachProtectedCell(Functor&);
         template<typename Functor> typename Functor::ReturnType forEachProtectedCell();
-        
-        HandleSlot allocateGlobalHandle() { return m_handleHeap.allocate(); }
-        HandleSlot allocateLocalHandle() { return m_handleStack.push(); }
 
+        HandleHeap* handleHeap() { return &m_handleHeap; }
         HandleStack* handleStack() { return &m_handleStack; }
+
         void getConservativeRegisterRoots(HashSet<JSCell*>& roots);
 
     private:

Modified: trunk/Source/_javascript_Core/heap/Local.h (96464 => 96465)


--- trunk/Source/_javascript_Core/heap/Local.h	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/heap/Local.h	2011-10-02 00:54:56 UTC (rev 96465)
@@ -57,13 +57,13 @@
 };
 
 template <typename T> inline Local<T>::Local(JSGlobalData& globalData, ExternalType value)
-    : Handle<T>(globalData.allocateLocalHandle())
+    : Handle<T>(globalData.heap.handleStack()->push())
 {
     set(value);
 }
 
 template <typename T> inline Local<T>::Local(JSGlobalData& globalData, Handle<T> other)
-    : Handle<T>(globalData.allocateLocalHandle())
+    : Handle<T>(globalData.heap.handleStack()->push())
 {
     set(other.get());
 }

Modified: trunk/Source/_javascript_Core/heap/Strong.h (96464 => 96465)


--- trunk/Source/_javascript_Core/heap/Strong.h	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/heap/Strong.h	2011-10-02 00:54:56 UTC (rev 96465)
@@ -33,7 +33,6 @@
 namespace JSC {
 
 class JSGlobalData;
-HandleSlot allocateGlobalHandle(JSGlobalData&);
 
 // A strongly referenced handle that prevents the object it points to from being garbage collected.
 template <typename T> class Strong : public Handle<T> {
@@ -48,17 +47,9 @@
     {
     }
     
-    Strong(JSGlobalData& globalData, ExternalType value = ExternalType())
-        : Handle<T>(allocateGlobalHandle(globalData))
-    {
-        set(value);
-    }
+    Strong(JSGlobalData&, ExternalType = ExternalType());
 
-    Strong(JSGlobalData& globalData, Handle<T> handle)
-        : Handle<T>(allocateGlobalHandle(globalData))
-    {
-        set(handle.get());
-    }
+    Strong(JSGlobalData&, Handle<T>);
     
     Strong(const Strong& other)
         : Handle<T>()
@@ -95,12 +86,7 @@
         Handle<T>::swap(other);
     }
 
-    void set(JSGlobalData& globalData, ExternalType value)
-    {
-        if (!slot())
-            setSlot(allocateGlobalHandle(globalData));
-        set(value);
-    }
+    void set(JSGlobalData&, ExternalType);
 
     template <typename U> Strong& operator=(const Strong<U>& other)
     {

Added: trunk/Source/_javascript_Core/heap/StrongInlines.h (0 => 96465)


--- trunk/Source/_javascript_Core/heap/StrongInlines.h	                        (rev 0)
+++ trunk/Source/_javascript_Core/heap/StrongInlines.h	2011-10-02 00:54:56 UTC (rev 96465)
@@ -0,0 +1,55 @@
+/*
+ * 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 StrongInlines_h
+#define StrongInlines_h
+
+namespace JSC {
+
+template <typename T>
+inline Strong<T>::Strong(JSGlobalData& globalData, ExternalType value)
+    : Handle<T>(globalData.heap.handleHeap()->allocate())
+{
+    set(value);
+}
+
+template <typename T>
+inline Strong<T>::Strong(JSGlobalData& globalData, Handle<T> handle)
+    : Handle<T>(globalData.heap.handleHeap()->allocate())
+{
+    set(handle.get());
+}
+
+template <typename T>
+inline void Strong<T>::set(JSGlobalData& globalData, ExternalType value)
+{
+    if (!slot())
+        setSlot(globalData.heap.handleHeap()->allocate());
+    set(value);
+}
+
+} // namespace JSC
+    
+#endif // StrongInlines_h

Modified: trunk/Source/_javascript_Core/heap/Weak.h (96464 => 96465)


--- trunk/Source/_javascript_Core/heap/Weak.h	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/heap/Weak.h	2011-10-02 00:54:56 UTC (rev 96465)
@@ -47,7 +47,7 @@
     }
 
     Weak(JSGlobalData& globalData, ExternalType value = ExternalType(), WeakHandleOwner* weakOwner = 0, void* context = 0)
-        : Handle<T>(globalData.allocateGlobalHandle())
+        : Handle<T>(globalData.heap.handleHeap()->allocate())
     {
         HandleHeap::heapFor(slot())->makeWeak(slot(), weakOwner, context);
         set(value);
@@ -106,7 +106,7 @@
     void set(JSGlobalData& globalData, ExternalType value, WeakHandleOwner* weakOwner = 0, void* context = 0)
     {
         if (!slot()) {
-            setSlot(globalData.allocateGlobalHandle());
+            setSlot(globalData.heap.handleHeap()->allocate());
             HandleHeap::heapFor(slot())->makeWeak(slot(), weakOwner, context);
         }
         ASSERT(HandleHeap::heapFor(slot())->hasWeakOwner(slot(), weakOwner));

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp (96464 => 96465)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -56,6 +56,7 @@
 #include "RegExpCache.h"
 #include "RegExpObject.h"
 #include "StrictEvalActivation.h"
+#include "StrongInlines.h"
 #include <wtf/Threading.h>
 #include <wtf/WTFThreadData.h>
 #if PLATFORM(MAC)

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.h (96464 => 96465)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2011-10-02 00:54:56 UTC (rev 96465)
@@ -295,8 +295,6 @@
         void addRegExpToTrace(PassRefPtr<RegExp> regExp);
 #endif
         void dumpRegExpTrace();
-        HandleSlot allocateGlobalHandle() { return heap.allocateGlobalHandle(); }
-        HandleSlot allocateLocalHandle() { return heap.allocateLocalHandle(); }
         void clearBuiltinStructures();
 
         bool isCollectorBusy() { return heap.isBusy(); }
@@ -320,11 +318,6 @@
 #endif
     };
 
-    inline HandleSlot allocateGlobalHandle(JSGlobalData& globalData)
-    {
-        return globalData.allocateGlobalHandle();
-    }
-
 #if ENABLE(GC_VALIDATION)
     inline bool JSGlobalData::isInitializingObject() const
     {

Modified: trunk/Source/_javascript_Core/runtime/LiteralParser.cpp (96464 => 96465)


--- trunk/Source/_javascript_Core/runtime/LiteralParser.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/runtime/LiteralParser.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -29,6 +29,7 @@
 #include "JSArray.h"
 #include "JSString.h"
 #include "Lexer.h"
+#include "StrongInlines.h"
 #include "UStringBuilder.h"
 #include <wtf/ASCIICType.h>
 #include <wtf/dtoa.h>

Modified: trunk/Source/_javascript_Core/runtime/RegExpCache.cpp (96464 => 96465)


--- trunk/Source/_javascript_Core/runtime/RegExpCache.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/runtime/RegExpCache.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -29,6 +29,7 @@
 
 #include "RegExpCache.h"
 #include "RegExpObject.h"
+#include "StrongInlines.h"
 
 namespace JSC {
 

Modified: trunk/Source/_javascript_Core/runtime/StructureTransitionTable.h (96464 => 96465)


--- trunk/Source/_javascript_Core/runtime/StructureTransitionTable.h	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/runtime/StructureTransitionTable.h	2011-10-02 00:54:56 UTC (rev 96465)
@@ -156,7 +156,7 @@
         ASSERT(isUsingSingleSlot());
         HandleSlot slot = this->slot();
         if (!slot) {
-            slot = globalData.allocateGlobalHandle();
+            slot = globalData.heap.handleHeap()->allocate();
             HandleHeap::heapFor(slot)->makeWeak(slot, 0, 0);
             m_data = reinterpret_cast<intptr_t>(slot) | UsingSingleSlotFlag;
         }

Modified: trunk/Source/_javascript_Core/runtime/WeakGCMap.h (96464 => 96465)


--- trunk/Source/_javascript_Core/runtime/WeakGCMap.h	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Core/runtime/WeakGCMap.h	2011-10-02 00:54:56 UTC (rev 96465)
@@ -125,7 +125,7 @@
     {
         pair<typename MapType::iterator, bool> iter = m_map.add(key, 0);
         if (iter.second) {
-            HandleSlot slot = globalData.allocateGlobalHandle();
+            HandleSlot slot = globalData.heap.handleHeap()->allocate();
             iter.first->second = slot;
             HandleHeap::heapFor(slot)->makeWeak(slot, this, FinalizerCallback::finalizerContextFor(key));
             HandleHeap::heapFor(slot)->writeBarrier(slot, value);
@@ -147,7 +147,7 @@
         pair<typename MapType::iterator, bool> iter = m_map.add(key, 0);
         HandleSlot slot = iter.first->second;
         if (iter.second) {
-            slot = globalData.allocateGlobalHandle();
+            slot = globalData.heap.handleHeap()->allocate();
             HandleHeap::heapFor(slot)->makeWeak(slot, this, key);
             iter.first->second = slot;
         }

Modified: trunk/Source/_javascript_Glue/ChangeLog (96464 => 96465)


--- trunk/Source/_javascript_Glue/ChangeLog	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Glue/ChangeLog	2011-10-02 00:54:56 UTC (rev 96465)
@@ -1,3 +1,13 @@
+2011-10-01  Geoffrey Garen  <[email protected]>
+
+        Removed redundant helper functions for allocating Strong handles
+        https://bugs.webkit.org/show_bug.cgi?id=69218
+
+        Reviewed by Sam Weinig.
+
+        * JSRun.cpp:
+        * JSValueWrapper.cpp:
+
 2011-09-29  Mark Hahnenberg  <[email protected]>
 
         De-virtualize JSCell::visitChildrenVirtual and remove all other visitChildrenVirtual methods

Modified: trunk/Source/_javascript_Glue/JSRun.cpp (96464 => 96465)


--- trunk/Source/_javascript_Glue/JSRun.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Glue/JSRun.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -32,6 +32,7 @@
 #include "UserObjectImp.h"
 #include <_javascript_Core/Completion.h>
 #include <_javascript_Core/SourceCode.h>
+#include <_javascript_Core/StrongInlines.h>
 
 JSGlueGlobalObject::JSGlueGlobalObject(JSGlobalData& globalData, Structure* structure, Structure* userObjectStructure, JSFlags flags)
     : JSGlobalObject(globalData, structure)

Modified: trunk/Source/_javascript_Glue/JSValueWrapper.cpp (96464 => 96465)


--- trunk/Source/_javascript_Glue/JSValueWrapper.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/_javascript_Glue/JSValueWrapper.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -31,6 +31,7 @@
 #include "JSRun.h"
 #include <_javascript_Core/JSArray.h>
 #include <_javascript_Core/PropertyNameArray.h>
+#include <_javascript_Core/StrongInlines.h>
 #include <pthread.h>
 
 JSValueWrapper::JSValueWrapper(JSValue inValue)

Modified: trunk/Source/WebCore/ChangeLog (96464 => 96465)


--- trunk/Source/WebCore/ChangeLog	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/WebCore/ChangeLog	2011-10-02 00:54:56 UTC (rev 96465)
@@ -1,3 +1,21 @@
+2011-10-01  Geoffrey Garen  <[email protected]>
+
+        Removed redundant helper functions for allocating Strong handles
+        https://bugs.webkit.org/show_bug.cgi?id=69218
+
+        Reviewed by Sam Weinig.
+
+        * ForwardingHeaders/heap/StrongInlines.h: Added.
+        * bindings/js/JSCallbackData.h:
+        * bindings/js/JSDOMWindowShell.cpp:
+        * bindings/js/ScheduledAction.h:
+        * bindings/js/ScriptCachedFrameData.cpp:
+        * bindings/js/ScriptController.cpp:
+        * bindings/js/ScriptState.cpp:
+        * bindings/js/ScriptValue.h:
+        * bindings/js/WorkerScriptController.cpp:
+        * bridge/runtime_root.cpp:
+
 2011-10-01  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r96421.

Added: trunk/Source/WebCore/ForwardingHeaders/heap/StrongInlines.h (0 => 96465)


--- trunk/Source/WebCore/ForwardingHeaders/heap/StrongInlines.h	                        (rev 0)
+++ trunk/Source/WebCore/ForwardingHeaders/heap/StrongInlines.h	2011-10-02 00:54:56 UTC (rev 96465)
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_StrongInlines_h
+#define WebCore_FWD_StrongInlines_h
+#include <_javascript_Core/StrongInlines.h>
+#endif

Modified: trunk/Source/WebCore/bindings/js/JSCallbackData.h (96464 => 96465)


--- trunk/Source/WebCore/bindings/js/JSCallbackData.h	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/WebCore/bindings/js/JSCallbackData.h	2011-10-02 00:54:56 UTC (rev 96465)
@@ -33,6 +33,7 @@
 #include "JSDOMGlobalObject.h"
 #include "ScriptExecutionContext.h"
 #include <heap/Strong.h>
+#include <heap/StrongInlines.h>
 #include <runtime/JSObject.h>
 #include <wtf/Threading.h>
 

Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp (96464 => 96465)


--- trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -33,6 +33,7 @@
 #include "JSDOMWindow.h"
 #include "DOMWindow.h"
 #include "ScriptController.h"
+#include <heap/StrongInlines.h>
 #include <runtime/JSObject.h>
 
 using namespace JSC;

Modified: trunk/Source/WebCore/bindings/js/ScheduledAction.h (96464 => 96465)


--- trunk/Source/WebCore/bindings/js/ScheduledAction.h	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/WebCore/bindings/js/ScheduledAction.h	2011-10-02 00:54:56 UTC (rev 96465)
@@ -23,6 +23,7 @@
 #include "JSDOMBinding.h"
 #include "PlatformString.h"
 #include <heap/Strong.h>
+#include <heap/StrongInlines.h>
 #include <runtime/JSCell.h>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/Vector.h>

Modified: trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp (96464 => 96465)


--- trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -36,6 +36,7 @@
 #include "GCController.h"
 #include "Page.h"
 #include "PageGroup.h"
+#include <heap/StrongInlines.h>
 #include <runtime/JSLock.h>
 #include "ScriptController.h"
 

Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (96464 => 96465)


--- trunk/Source/WebCore/bindings/js/ScriptController.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -44,6 +44,7 @@
 #include "npruntime_impl.h"
 #include "runtime_root.h"
 #include <debugger/Debugger.h>
+#include <heap/StrongInlines.h>
 #include <runtime/InitializeThreading.h>
 #include <runtime/JSLock.h>
 #include <wtf/Threading.h>

Modified: trunk/Source/WebCore/bindings/js/ScriptState.cpp (96464 => 96465)


--- trunk/Source/WebCore/bindings/js/ScriptState.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/WebCore/bindings/js/ScriptState.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -37,6 +37,7 @@
 #include "Page.h"
 #include "WorkerContext.h"
 #include "WorkerScriptController.h"
+#include <heap/StrongInlines.h>
 #include <interpreter/CallFrame.h>
 #include <runtime/JSGlobalObject.h>
 

Modified: trunk/Source/WebCore/bindings/js/ScriptValue.h (96464 => 96465)


--- trunk/Source/WebCore/bindings/js/ScriptValue.h	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/WebCore/bindings/js/ScriptValue.h	2011-10-02 00:54:56 UTC (rev 96465)
@@ -36,6 +36,7 @@
 #include "SerializedScriptValue.h"
 #include "ScriptState.h"
 #include <heap/Strong.h>
+#include <heap/StrongInlines.h>
 #include <runtime/JSValue.h>
 #include <wtf/PassRefPtr.h>
 

Modified: trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp (96464 => 96465)


--- trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -38,6 +38,7 @@
 #include "WorkerContext.h"
 #include "WorkerObjectProxy.h"
 #include "WorkerThread.h"
+#include <heap/StrongInlines.h>
 #include <interpreter/Interpreter.h>
 #include <runtime/Completion.h>
 #include <runtime/ExceptionHelpers.h>

Modified: trunk/Source/WebCore/bridge/runtime_root.cpp (96464 => 96465)


--- trunk/Source/WebCore/bridge/runtime_root.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/WebCore/bridge/runtime_root.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -28,6 +28,7 @@
 
 #include "BridgeJSC.h"
 #include "runtime_object.h"
+#include <heap/StrongInlines.h>
 #include <heap/Weak.h>
 #include <runtime/JSGlobalObject.h>
 #include <wtf/HashCountedSet.h>

Modified: trunk/Source/WebKit2/ChangeLog (96464 => 96465)


--- trunk/Source/WebKit2/ChangeLog	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/WebKit2/ChangeLog	2011-10-02 00:54:56 UTC (rev 96465)
@@ -1,3 +1,13 @@
+2011-10-01  Geoffrey Garen  <[email protected]>
+
+        Removed redundant helper functions for allocating Strong handles
+        https://bugs.webkit.org/show_bug.cgi?id=69218
+
+        Reviewed by Sam Weinig.
+
+        * WebProcess/Plugins/Netscape/NPJSObject.cpp:
+        * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
+
 2011-09-30  Sam Weinig  <[email protected]>
 
         Add support for eventSender.mouseScrollBy in WTR

Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp (96464 => 96465)


--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -31,6 +31,7 @@
 #include "NPRuntimeUtilities.h"
 #include <_javascript_Core/JSLock.h>
 #include <_javascript_Core/JSObject.h>
+#include <_javascript_Core/StrongInlines.h>
 #include <WebCore/Frame.h>  
 #include <WebCore/IdentifierRep.h>
 #include <wtf/text/WTFString.h>

Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp (96464 => 96465)


--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp	2011-10-01 22:08:07 UTC (rev 96464)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp	2011-10-02 00:54:56 UTC (rev 96465)
@@ -36,6 +36,7 @@
 #include <_javascript_Core/JSLock.h>
 #include <_javascript_Core/SourceCode.h>
 #include <_javascript_Core/Strong.h>
+#include <_javascript_Core/StrongInlines.h>
 #include <WebCore/Frame.h>
 
 using namespace JSC;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to