Bug 16457 - Change SymbolTable to use RefPtr<UString::Rep> as its key
Summary: Change SymbolTable to use RefPtr<UString::Rep> as its key
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Geoffrey Garen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-15 17:59 PST by Geoffrey Garen
Modified: 2007-12-16 17:10 PST (History)
2 users (show)

See Also:


Attachments
Patch (47.00 KB, patch)
2007-12-15 18:08 PST, Geoffrey Garen
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Garen 2007-12-15 17:59:28 PST
Do it!
Comment 1 Geoffrey Garen 2007-12-15 18:08:05 PST
Created attachment 17920 [details]
Patch
Comment 2 Darin Adler 2007-12-15 18:14:45 PST
Comment on attachment 17920 [details]
Patch

I think that the UString::Rep::nullPtr should probably be a global in SymbolTable.h and not be a member of UString::Rep rather than in ustring.h. There's no good reason that class should export a global containing a pointer to the null rep, and the patch should not have to touch ustring.h/cpp at all. The only downside I can think of is that you'd have to find a .cpp file to put the global in.

I also think that the vcproj contains the .h files, and so it should contain this one too.

You should consider fixing those. Otherwise, r=me.
Comment 3 Maciej Stachowiak 2007-12-16 14:11:04 PST
I'd suggest a typedef for T* (RawPtrKeyType?) but generally speaking this looks good.
Comment 4 Geoffrey Garen 2007-12-16 14:55:52 PST
Committed revision 28777.

I moved the nullPtr declaration into IdentifierRepHashTraits, put its definition in JSVariableObject.cpp, added RefPtrHashMap.h to the .vcproj file, and typedef'ed T* to RawKeyType.