Changeset 55679 in webkit for trunk/JavaScriptCore/runtime/JSString.h
- Timestamp:
- Mar 8, 2010, 12:31:02 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSString.h
r55035 r55679 42 42 JSString* jsSingleCharacterString(JSGlobalData*, UChar); 43 43 JSString* jsSingleCharacterString(ExecState*, UChar); 44 JSString* jsSingleCharacterSubstring(JSGlobalData*, const UString&, unsigned offset); 44 45 JSString* jsSingleCharacterSubstring(ExecState*, const UString&, unsigned offset); 45 46 JSString* jsSubstring(JSGlobalData*, const UString&, unsigned offset, unsigned length); … … 365 366 } 366 367 367 inline JSString* jsSingleCharacterSubstring(ExecState* exec, const UString& s, unsigned offset) 368 { 369 JSGlobalData* globalData = &exec->globalData(); 370 368 inline JSString* jsSingleCharacterSubstring(JSGlobalData* globalData, const UString& s, unsigned offset) 369 { 371 370 ASSERT(offset < static_cast<unsigned>(s.size())); 372 371 UChar c = s.data()[offset]; … … 393 392 { 394 393 ASSERT(canGetIndex(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)); 394 return jsSingleCharacterSubstring(&exec->globalData(), value(exec), i); 410 395 } 411 396 … … 461 446 inline JSString* jsString(ExecState* exec, const UString& s) { return jsString(&exec->globalData(), s); } 462 447 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); } 463 449 inline JSString* jsSubstring(ExecState* exec, const UString& s, unsigned offset, unsigned length) { return jsSubstring(&exec->globalData(), s, offset, length); } 464 450 inline JSString* jsNontrivialString(ExecState* exec, const UString& s) { return jsNontrivialString(&exec->globalData(), s); } … … 476 462 unsigned i = propertyName.toStrictUInt32(&isStrictUInt32); 477 463 if (isStrictUInt32 && i < m_length) { 478 slot.setValue( getIndex(exec, i));464 slot.setValue(jsSingleCharacterSubstring(exec, value(exec), i)); 479 465 return true; 480 466 } … … 486 472 { 487 473 if (propertyName < m_length) { 488 slot.setValue( getIndex(exec, propertyName));474 slot.setValue(jsSingleCharacterSubstring(exec, value(exec), propertyName)); 489 475 return true; 490 476 }
Note:
See TracChangeset
for help on using the changeset viewer.