Changeset 43090 in webkit for trunk/JavaScriptCore
- Timestamp:
- Apr 30, 2009, 2:18:31 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r43087 r43090 1 2009-04-30 Maciej Stachowiak <[email protected]> 2 3 Reviewed by Geoff Garen. 4 5 - make BaseStrings have themselves as a base, instead of nothing, to remove common branches 6 7 ~0.7% SunSpider speedup 8 9 * runtime/UString.h: 10 (JSC::UString::Rep::Rep): For the constructor without a base, set self as base instead of null. 11 (JSC::UString::Rep::baseString): Just read m_baseString - no more branching. 12 1 13 2009-04-30 Gavin Barraclough <[email protected]> 2 14 -
trunk/JavaScriptCore/runtime/UString.h
r42680 r43090 134 134 135 135 protected: 136 // constructor for use by BaseString subclass; they are their own bases 136 137 Rep(int length) 137 138 : offset(0) … … 139 140 , rc(1) 140 141 , _hash(0) 141 , m_ nothing(0)142 , m_baseString(static_cast<BaseString*>(this)) 142 143 { 143 144 } … … 153 154 } 154 155 155 union { 156 // If !baseIsSelf() 157 BaseString* m_baseString; 158 // If baseIsSelf() 159 void* m_nothing; 160 }; 156 157 BaseString* m_baseString; 161 158 162 159 private: … … 411 408 inline UString::BaseString* UString::Rep::baseString() 412 409 { 413 return baseIsSelf() ? reinterpret_cast<BaseString*>(this) :m_baseString;410 return m_baseString; 414 411 } 415 412 416 413 inline const UString::BaseString* UString::Rep::baseString() const 417 414 { 418 return const_cast<Rep*>(this)->baseString();415 return m_baseString; 419 416 } 420 417
Note:
See TracChangeset
for help on using the changeset viewer.