Changeset 96465 in webkit for trunk/Source/JavaScriptCore/heap
- Timestamp:
- Oct 1, 2011, 5:54:56 PM (14 years ago)
- Location:
- trunk/Source/JavaScriptCore/heap
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.