Changeset 96465 in webkit
- Timestamp:
- Oct 1, 2011 5:54:56 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r96164 r96465 107 107 needsFinalizer = jsClassPtr->finalize; 108 108 if (needsFinalizer) { 109 HandleSlot slot = exec->globalData(). allocateGlobalHandle();109 HandleSlot slot = exec->globalData().heap.handleHeap()->allocate(); 110 110 HandleHeap::heapFor(slot)->makeWeak(slot, m_callbackObjectData.get(), classRef()); 111 111 HandleHeap::heapFor(slot)->writeBarrier(slot, this); -
trunk/Source/JavaScriptCore/ChangeLog
r96463 r96465 1 2011-10-01 Geoffrey Garen <ggaren@apple.com> 2 3 Removed redundant helper functions for allocating Strong handles 4 https://bugs.webkit.org/show_bug.cgi?id=69218 5 6 Reviewed by Sam Weinig. 7 8 * heap/Heap.h: 9 (JSC::Heap::handleHeap): 10 * runtime/JSGlobalData.h: Removed these helper functions, since they 11 just created indirection. 12 13 * heap/StrongInlines.h: Added. Broke out a header for inline functions 14 to resolve circular dependencies created by inlining. I'm told this is 15 the future for JavaScriptCore. 16 17 * GNUmakefile.list.am: 18 * JavaScriptCore.gypi: 19 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 20 * JavaScriptCore.xcodeproj/project.pbxproj: Go forth and build. 21 22 * API/JSCallbackObjectFunctions.h: 23 (JSC::::init): 24 * runtime/WeakGCMap.h: 25 (JSC::WeakGCMap::add): 26 (JSC::WeakGCMap::set): 27 * runtime/StructureTransitionTable.h: 28 (JSC::StructureTransitionTable::setSingleTransition): 29 * heap/Local.h: 30 (JSC::::Local): 31 * heap/Strong.h: 32 (JSC::::Strong): 33 (JSC::::set): 34 * heap/Weak.h: 35 (JSC::Weak::Weak): 36 (JSC::Weak::set): Allocate handles directly instead of going through a 37 chain of forwarding functions. 38 39 * bytecompiler/BytecodeGenerator.cpp: 40 * runtime/JSGlobalData.cpp: 41 * runtime/LiteralParser.cpp: 42 * runtime/RegExpCache.cpp: Updated for header changes. 43 1 44 2011-09-30 Filip Pizlo <fpizlo@apple.com> 2 45 -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r96463 r96465 163 163 Source/JavaScriptCore/heap/MarkedSpace.h \ 164 164 Source/JavaScriptCore/heap/Strong.h \ 165 Source/JavaScriptCore/heap/StrongInlines.h \ 165 166 Source/JavaScriptCore/heap/VTableSpectrum.cpp \ 166 167 Source/JavaScriptCore/heap/VTableSpectrum.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.gypi
r96001 r96465 39 39 'heap/LocalScope.h', 40 40 'heap/Strong.h', 41 'heap/StrongInlines.h', 41 42 'heap/Weak.h', 42 43 'config.h', -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r96463 r96465 1975 1975 </File> 1976 1976 <File 1977 RelativePath="..\..\heap\StrongInlines.h" 1978 > 1979 </File> 1980 <File 1977 1981 RelativePath="..\..\heap\Handle.h" 1978 1982 > -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r96463 r96465 167 167 14469DEE107EC7E700650446 /* UString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8850255597D01FF60F7 /* UString.cpp */; }; 168 168 144836E7132DA7BE005BE785 /* ConservativeRoots.h in Headers */ = {isa = PBXBuildFile; fileRef = 149DAAF212EB559D0083B12B /* ConservativeRoots.h */; settings = {ATTRIBUTES = (Private, ); }; }; 169 145722861437E140005FDE26 /* StrongInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 145722851437E140005FDE26 /* StrongInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 169 170 146AAB380B66A94400E55F16 /* JSStringRefCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 146AAB370B66A94400E55F16 /* JSStringRefCF.cpp */; }; 170 171 146B16D812EB5B59001BEC1B /* ConservativeRoots.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 146B14DB12EB5B12001BEC1B /* ConservativeRoots.cpp */; }; … … 892 893 1440FCE20A51E46B0005F061 /* JSClassRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSClassRef.cpp; sourceTree = "<group>"; }; 893 894 14456A311314657800212CA3 /* DoublyLinkedList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DoublyLinkedList.h; sourceTree = "<group>"; }; 895 145722851437E140005FDE26 /* StrongInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StrongInlines.h; sourceTree = "<group>"; }; 894 896 145C507F0D9DF63B0088F6B9 /* CallData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallData.h; sourceTree = "<group>"; }; 895 897 146AAB2A0B66A84900E55F16 /* JSStringRefCF.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSStringRefCF.h; sourceTree = "<group>"; }; … … 1694 1696 0FC8150814043BCA00CFA603 /* WriteBarrierSupport.cpp */, 1695 1697 0FC8150914043BD200CFA603 /* WriteBarrierSupport.h */, 1698 145722851437E140005FDE26 /* StrongInlines.h */, 1696 1699 ); 1697 1700 path = heap; … … 2478 2481 86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */, 2479 2482 86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */, 2483 145722861437E140005FDE26 /* StrongInlines.h in Headers */, 2480 2484 0FD82F4B142806A100179C94 /* BitVector.h in Headers */, 2481 2485 0FD82F2B1426CA6D00179C94 /* JettisonedCodeBlocks.h in Headers */, -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r95901 r96465 35 35 #include "Interpreter.h" 36 36 #include "ScopeChain.h" 37 #include "StrongInlines.h" 37 38 #include "UString.h" 38 39 -
trunk/Source/JavaScriptCore/heap/Heap.h
r96432 r96465 119 119 template<typename Functor> typename Functor::ReturnType forEachProtectedCell(Functor&); 120 120 template<typename Functor> typename Functor::ReturnType forEachProtectedCell(); 121 122 HandleSlot allocateGlobalHandle() { return m_handleHeap.allocate(); } 123 HandleSlot allocateLocalHandle() { return m_handleStack.push(); } 124 121 122 HandleHeap* handleHeap() { return &m_handleHeap; } 125 123 HandleStack* handleStack() { return &m_handleStack; } 124 126 125 void getConservativeRegisterRoots(HashSet<JSCell*>& roots); 127 126 -
trunk/Source/JavaScriptCore/heap/Local.h
r95912 r96465 58 58 59 59 template <typename T> inline Local<T>::Local(JSGlobalData& globalData, ExternalType value) 60 : Handle<T>(globalData. allocateLocalHandle())60 : Handle<T>(globalData.heap.handleStack()->push()) 61 61 { 62 62 set(value); … … 64 64 65 65 template <typename T> inline Local<T>::Local(JSGlobalData& globalData, Handle<T> other) 66 : Handle<T>(globalData. allocateLocalHandle())66 : Handle<T>(globalData.heap.handleStack()->push()) 67 67 { 68 68 set(other.get()); -
trunk/Source/JavaScriptCore/heap/Strong.h
r95901 r96465 34 34 35 35 class JSGlobalData; 36 HandleSlot allocateGlobalHandle(JSGlobalData&);37 36 38 37 // A strongly referenced handle that prevents the object it points to from being garbage collected. … … 49 48 } 50 49 51 Strong(JSGlobalData& globalData, ExternalType value = ExternalType()) 52 : Handle<T>(allocateGlobalHandle(globalData)) 53 { 54 set(value); 55 } 50 Strong(JSGlobalData&, ExternalType = ExternalType()); 56 51 57 Strong(JSGlobalData& globalData, Handle<T> handle) 58 : Handle<T>(allocateGlobalHandle(globalData)) 59 { 60 set(handle.get()); 61 } 52 Strong(JSGlobalData&, Handle<T>); 62 53 63 54 Strong(const Strong& other) … … 96 87 } 97 88 98 void set(JSGlobalData& globalData, ExternalType value) 99 { 100 if (!slot()) 101 setSlot(allocateGlobalHandle(globalData)); 102 set(value); 103 } 89 void set(JSGlobalData&, ExternalType); 104 90 105 91 template <typename U> Strong& operator=(const Strong<U>& other) -
trunk/Source/JavaScriptCore/heap/Weak.h
r95912 r96465 48 48 49 49 Weak(JSGlobalData& globalData, ExternalType value = ExternalType(), WeakHandleOwner* weakOwner = 0, void* context = 0) 50 : Handle<T>(globalData. allocateGlobalHandle())50 : Handle<T>(globalData.heap.handleHeap()->allocate()) 51 51 { 52 52 HandleHeap::heapFor(slot())->makeWeak(slot(), weakOwner, context); … … 107 107 { 108 108 if (!slot()) { 109 setSlot(globalData. allocateGlobalHandle());109 setSlot(globalData.heap.handleHeap()->allocate()); 110 110 HandleHeap::heapFor(slot())->makeWeak(slot(), weakOwner, context); 111 111 } -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r95758 r96465 57 57 #include "RegExpObject.h" 58 58 #include "StrictEvalActivation.h" 59 #include "StrongInlines.h" 59 60 #include <wtf/Threading.h> 60 61 #include <wtf/WTFThreadData.h> -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.h
r95758 r96465 296 296 #endif 297 297 void dumpRegExpTrace(); 298 HandleSlot allocateGlobalHandle() { return heap.allocateGlobalHandle(); }299 HandleSlot allocateLocalHandle() { return heap.allocateLocalHandle(); }300 298 void clearBuiltinStructures(); 301 299 … … 321 319 }; 322 320 323 inline HandleSlot allocateGlobalHandle(JSGlobalData& globalData)324 {325 return globalData.allocateGlobalHandle();326 }327 328 321 #if ENABLE(GC_VALIDATION) 329 322 inline bool JSGlobalData::isInitializingObject() const -
trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp
r95901 r96465 30 30 #include "JSString.h" 31 31 #include "Lexer.h" 32 #include "StrongInlines.h" 32 33 #include "UStringBuilder.h" 33 34 #include <wtf/ASCIICType.h> -
trunk/Source/JavaScriptCore/runtime/RegExpCache.cpp
r95901 r96465 30 30 #include "RegExpCache.h" 31 31 #include "RegExpObject.h" 32 #include "StrongInlines.h" 32 33 33 34 namespace JSC { -
trunk/Source/JavaScriptCore/runtime/StructureTransitionTable.h
r95901 r96465 157 157 HandleSlot slot = this->slot(); 158 158 if (!slot) { 159 slot = globalData. allocateGlobalHandle();159 slot = globalData.heap.handleHeap()->allocate(); 160 160 HandleHeap::heapFor(slot)->makeWeak(slot, 0, 0); 161 161 m_data = reinterpret_cast<intptr_t>(slot) | UsingSingleSlotFlag; -
trunk/Source/JavaScriptCore/runtime/WeakGCMap.h
r95901 r96465 126 126 pair<typename MapType::iterator, bool> iter = m_map.add(key, 0); 127 127 if (iter.second) { 128 HandleSlot slot = globalData. allocateGlobalHandle();128 HandleSlot slot = globalData.heap.handleHeap()->allocate(); 129 129 iter.first->second = slot; 130 130 HandleHeap::heapFor(slot)->makeWeak(slot, this, FinalizerCallback::finalizerContextFor(key)); … … 148 148 HandleSlot slot = iter.first->second; 149 149 if (iter.second) { 150 slot = globalData. allocateGlobalHandle();150 slot = globalData.heap.handleHeap()->allocate(); 151 151 HandleHeap::heapFor(slot)->makeWeak(slot, this, key); 152 152 iter.first->second = slot; -
trunk/Source/JavaScriptGlue/ChangeLog
r96346 r96465 1 2011-10-01 Geoffrey Garen <ggaren@apple.com> 2 3 Removed redundant helper functions for allocating Strong handles 4 https://bugs.webkit.org/show_bug.cgi?id=69218 5 6 Reviewed by Sam Weinig. 7 8 * JSRun.cpp: 9 * JSValueWrapper.cpp: 10 1 11 2011-09-29 Mark Hahnenberg <mhahnenberg@apple.com> 2 12 -
trunk/Source/JavaScriptGlue/JSRun.cpp
r95108 r96465 33 33 #include <JavaScriptCore/Completion.h> 34 34 #include <JavaScriptCore/SourceCode.h> 35 #include <JavaScriptCore/StrongInlines.h> 35 36 36 37 JSGlueGlobalObject::JSGlueGlobalObject(JSGlobalData& globalData, Structure* structure, Structure* userObjectStructure, JSFlags flags) -
trunk/Source/JavaScriptGlue/JSValueWrapper.cpp
r96164 r96465 32 32 #include <JavaScriptCore/JSArray.h> 33 33 #include <JavaScriptCore/PropertyNameArray.h> 34 #include <JavaScriptCore/StrongInlines.h> 34 35 #include <pthread.h> 35 36 -
trunk/Source/WebCore/ChangeLog
r96455 r96465 1 2011-10-01 Geoffrey Garen <ggaren@apple.com> 2 3 Removed redundant helper functions for allocating Strong handles 4 https://bugs.webkit.org/show_bug.cgi?id=69218 5 6 Reviewed by Sam Weinig. 7 8 * ForwardingHeaders/heap/StrongInlines.h: Added. 9 * bindings/js/JSCallbackData.h: 10 * bindings/js/JSDOMWindowShell.cpp: 11 * bindings/js/ScheduledAction.h: 12 * bindings/js/ScriptCachedFrameData.cpp: 13 * bindings/js/ScriptController.cpp: 14 * bindings/js/ScriptState.cpp: 15 * bindings/js/ScriptValue.h: 16 * bindings/js/WorkerScriptController.cpp: 17 * bridge/runtime_root.cpp: 18 1 19 2011-10-01 Sheriff Bot <webkit.review.bot@gmail.com> 2 20 -
trunk/Source/WebCore/bindings/js/JSCallbackData.h
r85094 r96465 34 34 #include "ScriptExecutionContext.h" 35 35 #include <heap/Strong.h> 36 #include <heap/StrongInlines.h> 36 37 #include <runtime/JSObject.h> 37 38 #include <wtf/Threading.h> -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp
r96346 r96465 34 34 #include "DOMWindow.h" 35 35 #include "ScriptController.h" 36 #include <heap/StrongInlines.h> 36 37 #include <runtime/JSObject.h> 37 38 -
trunk/Source/WebCore/bindings/js/ScheduledAction.h
r84073 r96465 24 24 #include "PlatformString.h" 25 25 #include <heap/Strong.h> 26 #include <heap/StrongInlines.h> 26 27 #include <runtime/JSCell.h> 27 28 #include <wtf/PassOwnPtr.h> -
trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp
r95901 r96465 37 37 #include "Page.h" 38 38 #include "PageGroup.h" 39 #include <heap/StrongInlines.h> 39 40 #include <runtime/JSLock.h> 40 41 #include "ScriptController.h" -
trunk/Source/WebCore/bindings/js/ScriptController.cpp
r95449 r96465 45 45 #include "runtime_root.h" 46 46 #include <debugger/Debugger.h> 47 #include <heap/StrongInlines.h> 47 48 #include <runtime/InitializeThreading.h> 48 49 #include <runtime/JSLock.h> -
trunk/Source/WebCore/bindings/js/ScriptState.cpp
r95901 r96465 38 38 #include "WorkerContext.h" 39 39 #include "WorkerScriptController.h" 40 #include <heap/StrongInlines.h> 40 41 #include <interpreter/CallFrame.h> 41 42 #include <runtime/JSGlobalObject.h> -
trunk/Source/WebCore/bindings/js/ScriptValue.h
r95901 r96465 37 37 #include "ScriptState.h" 38 38 #include <heap/Strong.h> 39 #include <heap/StrongInlines.h> 39 40 #include <runtime/JSValue.h> 40 41 #include <wtf/PassRefPtr.h> -
trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp
r94918 r96465 39 39 #include "WorkerObjectProxy.h" 40 40 #include "WorkerThread.h" 41 #include <heap/StrongInlines.h> 41 42 #include <interpreter/Interpreter.h> 42 43 #include <runtime/Completion.h> -
trunk/Source/WebCore/bridge/runtime_root.cpp
r87192 r96465 29 29 #include "BridgeJSC.h" 30 30 #include "runtime_object.h" 31 #include <heap/StrongInlines.h> 31 32 #include <heap/Weak.h> 32 33 #include <runtime/JSGlobalObject.h> -
trunk/Source/WebKit2/ChangeLog
r96439 r96465 1 2011-10-01 Geoffrey Garen <ggaren@apple.com> 2 3 Removed redundant helper functions for allocating Strong handles 4 https://bugs.webkit.org/show_bug.cgi?id=69218 5 6 Reviewed by Sam Weinig. 7 8 * WebProcess/Plugins/Netscape/NPJSObject.cpp: 9 * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: 10 1 11 2011-09-30 Sam Weinig <sam@webkit.org> 2 12 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp
r95901 r96465 32 32 #include <JavaScriptCore/JSLock.h> 33 33 #include <JavaScriptCore/JSObject.h> 34 #include <JavaScriptCore/StrongInlines.h> 34 35 #include <WebCore/Frame.h> 35 36 #include <WebCore/IdentifierRep.h> -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
r95901 r96465 37 37 #include <JavaScriptCore/SourceCode.h> 38 38 #include <JavaScriptCore/Strong.h> 39 #include <JavaScriptCore/StrongInlines.h> 39 40 #include <WebCore/Frame.h> 40 41
Note: See TracChangeset
for help on using the changeset viewer.