Bug 16457

Summary: Change SymbolTable to use RefPtr<UString::Rep> as its key
Product: WebKit Reporter: Geoffrey Garen <ggaren>
Component: JavaScriptCoreAssignee: Geoffrey Garen <ggaren>
Severity: Normal CC: darin, mjs
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.4   
Description Flags
Patch darin: review+

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]
Comment 2 Darin Adler 2007-12-15 18:14:45 PST
Comment on attachment 17920 [details]

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.