Changeset 51975 in webkit for trunk/JavaScriptCore/runtime/JSString.h
- Timestamp:
- Dec 10, 2009, 6:07:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSString.h
r51964 r51975 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 } 206 232 // This constructor constructs a new string by concatenating v1, v2 & v3. 207 233 // This should only be called with ropeLength <= 3 ... which since every … … 259 285 void resolveRope(ExecState*) const; 260 286 287 void appendStringInConstruct(unsigned& index, const UString& string) 288 { 289 m_fibers[index++] = Rope::Fiber(string.rep()->ref()); 290 } 291 261 292 void appendStringInConstruct(unsigned& index, JSString* jsString) 262 293 { … … 265 296 m_fibers[index++] = jsString->m_fibers[i].ref(); 266 297 } else 267 m_fibers[index++] = Rope::Fiber(jsString->string().rep()->ref());298 appendStringInConstruct(index, jsString->string()); 268 299 } 269 300 … … 312 343 313 344 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); 314 347 friend JSValue jsString(ExecState* exec, Register* strings, unsigned count); 315 348 };
Note:
See TracChangeset
for help on using the changeset viewer.