Changeset 51978 in webkit for trunk/JavaScriptCore/runtime/JSString.h
- Timestamp:
- Dec 10, 2009, 7:42:33 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSString.h
r51975 r51978 204 204 ASSERT(ropeLength == index); 205 205 } 206 // This constructor constructs a new string by concatenating s1 & s2.207 // This should only be called with ropeLength <= 3.208 JSString(JSGlobalData* globalData, unsigned ropeLength, JSString* s1, const UString& u2)209 : JSCell(globalData->stringStructure.get())210 , m_stringLength(s1->length() + u2.size())211 , m_ropeLength(ropeLength)212 {213 ASSERT(ropeLength <= s_maxInternalRopeLength);214 unsigned index = 0;215 appendStringInConstruct(index, s1);216 appendStringInConstruct(index, u2);217 ASSERT(ropeLength == index);218 }219 // This constructor constructs a new string by concatenating s1 & s2.220 // This should only be called with ropeLength <= 3.221 JSString(JSGlobalData* globalData, unsigned ropeLength, const UString& u1, JSString* s2)222 : JSCell(globalData->stringStructure.get())223 , m_stringLength(u1.size() + s2->length())224 , m_ropeLength(ropeLength)225 {226 ASSERT(ropeLength <= s_maxInternalRopeLength);227 unsigned index = 0;228 appendStringInConstruct(index, u1);229 appendStringInConstruct(index, s2);230 ASSERT(ropeLength == index);231 }232 206 // This constructor constructs a new string by concatenating v1, v2 & v3. 233 207 // This should only be called with ropeLength <= 3 ... which since every … … 285 259 void resolveRope(ExecState*) const; 286 260 287 void appendStringInConstruct(unsigned& index, const UString& string)288 {289 m_fibers[index++] = Rope::Fiber(string.rep()->ref());290 }291 292 261 void appendStringInConstruct(unsigned& index, JSString* jsString) 293 262 { … … 296 265 m_fibers[index++] = jsString->m_fibers[i].ref(); 297 266 } else 298 appendStringInConstruct(index, jsString->string());267 m_fibers[index++] = Rope::Fiber(jsString->string().rep()->ref()); 299 268 } 300 269 … … 343 312 344 313 friend JSValue jsString(ExecState* exec, JSString* s1, JSString* s2); 345 friend JSValue jsString(ExecState* exec, const UString& u1, JSString* s2);346 friend JSValue jsString(ExecState* exec, JSString* s1, const UString& u2);347 314 friend JSValue jsString(ExecState* exec, Register* strings, unsigned count); 348 315 };
Note:
See TracChangeset
for help on using the changeset viewer.