Changeset 57120 in webkit
- Timestamp:
- Apr 5, 2010 9:18:18 PM (14 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r57108 r57120 1 2010-04-05 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Support weak maps in JSC 6 https://bugs.webkit.org/show_bug.cgi?id=37132 7 8 Expose an API to allow creation of a map for storing 9 weak JS references. 10 11 * API/JSWeakObjectMapRefInternal.h: Added. 12 (OpaqueJSWeakObjectMap::create): 13 (OpaqueJSWeakObjectMap::map): 14 (OpaqueJSWeakObjectMap::~OpaqueJSWeakObjectMap): 15 (OpaqueJSWeakObjectMap::OpaqueJSWeakObjectMap): 16 * API/JSWeakObjectMapRefPrivate.cpp: Added. 17 * API/JSWeakObjectMapRefPrivate.h: Added. 18 * JavaScriptCore.exp: 19 * JavaScriptCore.xcodeproj/project.pbxproj: 20 * runtime/JSGlobalObject.h: 21 (JSC::JSGlobalObject::registerWeakMap): 22 (JSC::JSGlobalObject::deregisterWeakMap): 23 1 24 2010-04-05 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2 25 -
trunk/JavaScriptCore/JavaScriptCore.exp
r57055 r57120 85 85 _JSValueToStringCopy 86 86 _JSValueUnprotect 87 _JSWeakObjectMapClear 88 _JSWeakObjectMapCreate 89 _JSWeakObjectMapGet 90 _JSWeakObjectMapSet 87 91 _WTFLog 88 92 _WTFLogVerbose -
trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r56825 r57120 274 274 A727FF6B0DA3092200E548D7 /* JSPropertyNameIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */; }; 275 275 A7280A2811557E3000D56957 /* JSObjectRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A79EDB0811531CD60019E912 /* JSObjectRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 276 A7482B9311671147003B0712 /* JSWeakObjectMapRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7482B791166CDEA003B0712 /* JSWeakObjectMapRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 277 A7482B9411671147003B0712 /* JSWeakObjectMapRefPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7482B7A1166CDEA003B0712 /* JSWeakObjectMapRefPrivate.cpp */; }; 278 A7482E93116A7CAD003B0712 /* JSWeakObjectMapRefInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A7482E37116A697B003B0712 /* JSWeakObjectMapRefInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; 276 279 A74B3499102A5F8E0032AB98 /* MarkStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A74B3498102A5F8E0032AB98 /* MarkStack.cpp */; }; 277 280 A766B44F0EE8DCD1009518CA /* ExecutableAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 829 832 A727FF650DA3053B00E548D7 /* JSPropertyNameIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPropertyNameIterator.h; sourceTree = "<group>"; }; 830 833 A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPropertyNameIterator.cpp; sourceTree = "<group>"; }; 834 A7482B791166CDEA003B0712 /* JSWeakObjectMapRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWeakObjectMapRefPrivate.h; sourceTree = "<group>"; }; 835 A7482B7A1166CDEA003B0712 /* JSWeakObjectMapRefPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWeakObjectMapRefPrivate.cpp; sourceTree = "<group>"; }; 836 A7482E37116A697B003B0712 /* JSWeakObjectMapRefInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWeakObjectMapRefInternal.h; sourceTree = "<group>"; }; 831 837 A74B3498102A5F8E0032AB98 /* MarkStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkStack.cpp; sourceTree = "<group>"; }; 832 838 A76EE6580FAE59D5003F069A /* NativeFunctionWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeFunctionWrapper.h; sourceTree = "<group>"; }; … … 1215 1221 E124A8F50E555775003091F1 /* OpaqueJSString.h */, 1216 1222 5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */, 1223 A7482B791166CDEA003B0712 /* JSWeakObjectMapRefPrivate.h */, 1224 A7482B7A1166CDEA003B0712 /* JSWeakObjectMapRefPrivate.cpp */, 1225 A7482E37116A697B003B0712 /* JSWeakObjectMapRefInternal.h */, 1217 1226 ); 1218 1227 path = API; … … 2021 2030 A7280A2811557E3000D56957 /* JSObjectRefPrivate.h in Headers */, 2022 2031 86565743115BE3DA00291F40 /* CString.h in Headers */, 2032 A7482B9311671147003B0712 /* JSWeakObjectMapRefPrivate.h in Headers */, 2033 A7482E93116A7CAD003B0712 /* JSWeakObjectMapRefInternal.h in Headers */, 2023 2034 ); 2024 2035 runOnlyForDeploymentPostprocessing = 0; … … 2463 2474 E1EF79AA0CE97BA60088D500 /* UTF8.cpp in Sources */, 2464 2475 86565742115BE3DA00291F40 /* CString.cpp in Sources */, 2476 A7482B9411671147003B0712 /* JSWeakObjectMapRefPrivate.cpp in Sources */, 2465 2477 ); 2466 2478 runOnlyForDeploymentPostprocessing = 0; -
trunk/JavaScriptCore/runtime/JSGlobalObject.h
r54022 r57120 26 26 #include "JSGlobalData.h" 27 27 #include "JSVariableObject.h" 28 #include "JSWeakObjectMapRefInternal.h" 28 29 #include "NativeFunctionWrapper.h" 29 30 #include "NumberPrototype.h" … … 57 58 protected: 58 59 using JSVariableObject::JSVariableObjectData; 60 typedef HashSet<RefPtr<OpaqueJSWeakObjectMap> > WeakMapSet; 59 61 60 62 struct JSGlobalObjectData : public JSVariableObjectData { … … 154 156 155 157 HashSet<GlobalCodeBlock*> codeBlocks; 158 WeakMapSet weakMaps; 156 159 }; 157 160 … … 271 274 } 272 275 276 void registerWeakMap(OpaqueJSWeakObjectMap* map) 277 { 278 d()->weakMaps.add(map); 279 } 280 281 void deregisterWeakMap(OpaqueJSWeakObjectMap* map) 282 { 283 d()->weakMaps.remove(map); 284 } 285 273 286 protected: 274 287
Note: See TracChangeset
for help on using the changeset viewer.