Changeset 56021 in webkit for trunk/JavaScriptCore/runtime/JSString.h
- Timestamp:
- Mar 15, 2010, 3:59:45 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSString.h
r55679 r56021 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); … … 241 240 bool canGetIndex(unsigned i) { return i < m_length; } 242 241 JSString* getIndex(ExecState*, unsigned); 242 JSString* getIndexSlowCase(ExecState*, unsigned); 243 243 244 244 static PassRefPtr<Structure> createStructure(JSValue proto) { return Structure::create(proto, TypeInfo(StringType, OverridesGetOwnPropertySlot | NeedsThisConversion), AnonymousSlotCount); } … … 366 366 } 367 367 368 inline JSString* jsSingleCharacterSubstring(JSGlobalData* globalData, const UString& s, unsigned offset) 369 { 368 inline JSString* jsSingleCharacterSubstring(ExecState* exec, const UString& s, unsigned offset) 369 { 370 JSGlobalData* globalData = &exec->globalData(); 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 getIndexSlowCase(exec, i); 397 ASSERT(i < m_value.size()); 398 return jsSingleCharacterSubstring(exec, value(exec), i); 395 399 } 396 400 … … 446 450 inline JSString* jsString(ExecState* exec, const UString& s) { return jsString(&exec->globalData(), s); } 447 451 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 452 inline JSString* jsSubstring(ExecState* exec, const UString& s, unsigned offset, unsigned length) { return jsSubstring(&exec->globalData(), s, offset, length); } 450 453 inline JSString* jsNontrivialString(ExecState* exec, const UString& s) { return jsNontrivialString(&exec->globalData(), s); } … … 462 465 unsigned i = propertyName.toStrictUInt32(&isStrictUInt32); 463 466 if (isStrictUInt32 && i < m_length) { 464 slot.setValue( jsSingleCharacterSubstring(exec, value(exec), i));467 slot.setValue(getIndex(exec, i)); 465 468 return true; 466 469 } … … 472 475 { 473 476 if (propertyName < m_length) { 474 slot.setValue( jsSingleCharacterSubstring(exec, value(exec), propertyName));477 slot.setValue(getIndex(exec, propertyName)); 475 478 return true; 476 479 }
Note:
See TracChangeset
for help on using the changeset viewer.