Changeset 37563 in webkit for trunk/JavaScriptCore
- Timestamp:
- Oct 13, 2008, 2:41:40 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r37556 r37563 1 2008-10-13 Sam Weinig <[email protected]> 2 3 Reviewed by Dan Bernstein. 4 5 Fix for https://bugs.webkit.org/show_bug.cgi?id=21577 6 5 false positive StructureID leaks 7 8 - Add leak ignore set to StructureID to selectively ignore leaking some StructureIDs. 9 - Add create method to JSGlolalData to be used when the data will be intentionally 10 leaked and ignore all leaks caused the StructureIDs stored in it. 11 12 * JavaScriptCore.exp: 13 * kjs/JSGlobalData.cpp: 14 (JSC::JSGlobalData::createLeaked): 15 * kjs/JSGlobalData.h: 16 * kjs/StructureID.cpp: 17 (JSC::StructureID::StructureID): 18 (JSC::StructureID::~StructureID): 19 (JSC::StructureID::startIgnoringLeaks): 20 (JSC::StructureID::stopIgnoringLeaks): 21 * kjs/StructureID.h: 22 1 23 2008-10-13 Marco Barisione <[email protected]> 2 24 -
trunk/JavaScriptCore/JavaScriptCore.exp
r37388 r37563 121 121 __ZN3JSC12DateInstance4infoE 122 122 __ZN3JSC12JSGlobalData10ClientDataD2Ev 123 __ZN3JSC12JSGlobalData12createLeakedEv 123 124 __ZN3JSC12JSGlobalData6createEv 124 125 __ZN3JSC12JSGlobalDataD1Ev -
trunk/JavaScriptCore/kjs/JSGlobalData.cpp
r37323 r37563 147 147 } 148 148 149 PassRefPtr<JSGlobalData> JSGlobalData::createLeaked() 150 { 151 #ifndef NDEBUG 152 StructureID::startIgnoringLeaks(); 153 RefPtr<JSGlobalData> data = create(); 154 StructureID::stopIgnoringLeaks(); 155 return data.release(); 156 #else 157 return create(); 158 #endif 159 } 160 149 161 bool JSGlobalData::sharedInstanceExists() 150 162 { -
trunk/JavaScriptCore/kjs/JSGlobalData.h
r37323 r37563 61 61 62 62 static PassRefPtr<JSGlobalData> create(); 63 static PassRefPtr<JSGlobalData> createLeaked(); 63 64 ~JSGlobalData(); 64 65 -
trunk/JavaScriptCore/kjs/StructureID.cpp
r37508 r37563 40 40 #ifndef NDEBUG 41 41 static WTF::RefCountedLeakCounter structureIDCounter("StructureID"); 42 43 static bool shouldIgnoreLeaks; 44 static HashSet<StructureID*> ignoreSet; 42 45 #endif 43 46 … … 58 61 59 62 #ifndef NDEBUG 60 structureIDCounter.increment(); 63 if (shouldIgnoreLeaks) 64 ignoreSet.add(this); 65 else 66 structureIDCounter.increment(); 61 67 #endif 62 68 } … … 73 79 74 80 #ifndef NDEBUG 75 structureIDCounter.decrement(); 81 HashSet<StructureID*>::iterator it = ignoreSet.find(this); 82 if (it != ignoreSet.end()) 83 ignoreSet.remove(it); 84 else 85 structureIDCounter.decrement(); 86 #endif 87 } 88 89 void StructureID::startIgnoringLeaks() 90 { 91 #ifndef NDEBUG 92 shouldIgnoreLeaks = true; 93 #endif 94 } 95 96 void StructureID::stopIgnoringLeaks() 97 { 98 #ifndef NDEBUG 99 shouldIgnoreLeaks = false; 76 100 #endif 77 101 } -
trunk/JavaScriptCore/kjs/StructureID.h
r37400 r37563 82 82 return adoptRef(new StructureID(prototype, typeInfo)); 83 83 } 84 85 static void startIgnoringLeaks(); 86 static void stopIgnoringLeaks(); 84 87 85 88 static PassRefPtr<StructureID> changePrototypeTransition(StructureID*, JSValue* prototype);
Note:
See TracChangeset
for help on using the changeset viewer.