Bug 36075 - Clean up screwyness re static string impls & Identifiers.
Summary: Clean up screwyness re static string impls & Identifiers.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Gavin Barraclough
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-12 15:25 PST by Gavin Barraclough
Modified: 2010-03-12 15:51 PST (History)
0 users

See Also:


Attachments
The patch (14.34 KB, patch)
2010-03-12 15:26 PST, Gavin Barraclough
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2010-03-12 15:25:16 PST
Static strings [ i.e. UString() and UString("") ] are used as Identifiers, but 'isIdentifier()' returns false.  This is a little screwy, and also a little suboptimal – Identifier::add(UString("")) will unnecessarily hit addSlowCase, rather than being handled in the inline function in the header.  The performance is probably not a big issue here, but the code is a little clearer if we make all UStringImpls that are used as Identifers return true from isIdentifier().

Add missing asserts to JSC::UStringImpl re static strings, and add matching asserts to WebCore::StringImpl.
Comment 1 Gavin Barraclough 2010-03-12 15:26:18 PST
Created attachment 50638 [details]
The patch

No performance impact
Comment 2 Oliver Hunt 2010-03-12 15:30:26 PST
Comment on attachment 50638 [details]
The patch

r=me
Comment 3 Gavin Barraclough 2010-03-12 15:51:39 PST
fixed in r55943.