Changeset 55035 in webkit for trunk/JavaScriptCore/runtime/JSString.h
- Timestamp:
- Feb 19, 2010, 3:36:09 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSString.h
r54925 r55035 42 42 JSString* jsSingleCharacterString(JSGlobalData*, UChar); 43 43 JSString* jsSingleCharacterString(ExecState*, UChar); 44 JSString* jsSingleCharacterSubstring(JSGlobalData*, const UString&, unsigned offset);45 44 JSString* jsSingleCharacterSubstring(ExecState*, const UString&, unsigned offset); 46 45 JSString* jsSubstring(JSGlobalData*, const UString&, unsigned offset, unsigned length); … … 366 365 } 367 366 368 inline JSString* jsSingleCharacterSubstring(JSGlobalData* globalData, const UString& s, unsigned offset) 369 { 367 inline JSString* jsSingleCharacterSubstring(ExecState* exec, const UString& s, unsigned offset) 368 { 369 JSGlobalData* globalData = &exec->globalData(); 370 370 371 ASSERT(offset < static_cast<unsigned>(s.size())); 371 372 UChar c = s.data()[offset]; … … 392 393 { 393 394 ASSERT(canGetIndex(i)); 394 return jsSingleCharacterSubstring(&exec->globalData(), value(exec), i); 395 if (!isRope()) 396 return jsSingleCharacterSubstring(exec, m_value, i); 397 398 if (i < m_other.m_fibers[0]->length()) 399 return jsString(exec, singleCharacterSubstring(m_other.m_fibers[0], i)); 400 i -= m_other.m_fibers[0]->length(); 401 402 ASSERT(m_fiberCount >= 2); 403 if (i < m_other.m_fibers[1]->length()) 404 return jsString(exec, singleCharacterSubstring(m_other.m_fibers[1], i)); 405 i -= m_other.m_fibers[1]->length(); 406 407 ASSERT(m_fiberCount == 3); 408 ASSERT(i < m_other.m_fibers[2]->length()); 409 return jsString(exec, singleCharacterSubstring(m_other.m_fibers[2], i)); 395 410 } 396 411 … … 446 461 inline JSString* jsString(ExecState* exec, const UString& s) { return jsString(&exec->globalData(), s); } 447 462 inline JSString* jsSingleCharacterString(ExecState* exec, UChar c) { return jsSingleCharacterString(&exec->globalData(), c); } 448 inline JSString* jsSingleCharacterSubstring(ExecState* exec, const UString& s, unsigned offset) { return jsSingleCharacterSubstring(&exec->globalData(), s, offset); }449 463 inline JSString* jsSubstring(ExecState* exec, const UString& s, unsigned offset, unsigned length) { return jsSubstring(&exec->globalData(), s, offset, length); } 450 464 inline JSString* jsNontrivialString(ExecState* exec, const UString& s) { return jsNontrivialString(&exec->globalData(), s); } … … 462 476 unsigned i = propertyName.toStrictUInt32(&isStrictUInt32); 463 477 if (isStrictUInt32 && i < m_length) { 464 slot.setValue( jsSingleCharacterSubstring(exec, value(exec), i));478 slot.setValue(getIndex(exec, i)); 465 479 return true; 466 480 } … … 472 486 { 473 487 if (propertyName < m_length) { 474 slot.setValue( jsSingleCharacterSubstring(exec, value(exec), propertyName));488 slot.setValue(getIndex(exec, propertyName)); 475 489 return true; 476 490 }
Note:
See TracChangeset
for help on using the changeset viewer.