Changeset 184575 in webkit for trunk/Source/JavaScriptCore/runtime/JSString.h
- Timestamp:
- May 19, 2015, 10:06:23 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSString.h
r182747 r184575 31 31 #include "Structure.h" 32 32 #include <array> 33 #include <wtf/text/StringView.h> 33 34 34 35 namespace JSC { … … 144 145 AtomicString toAtomicString(ExecState*) const; 145 146 AtomicStringImpl* toExistingAtomicString(ExecState*) const; 147 StringView view(ExecState*) const; 146 148 const String& value(ExecState*) const; 147 149 const String& tryGetValue() const; … … 370 372 void resolveRopeInternal16NoSubstring(UChar*) const; 371 373 void clearFibers() const; 374 StringView view(ExecState*) const; 372 375 373 376 JS_EXPORT_PRIVATE JSString* getIndexSlowCase(ExecState*, unsigned); … … 699 702 } 700 703 704 ALWAYS_INLINE StringView JSRopeString::view(ExecState* exec) const 705 { 706 if (isSubstring()) { 707 if (is8Bit()) 708 return StringView(substringBase()->m_value.characters8() + substringOffset(), m_length); 709 return StringView(substringBase()->m_value.characters16() + substringOffset(), m_length); 710 } 711 resolveRope(exec); 712 return StringView(m_value); 713 } 714 715 ALWAYS_INLINE StringView JSString::view(ExecState* exec) const 716 { 717 if (isRope()) 718 return static_cast<const JSRopeString*>(this)->view(exec); 719 return StringView(m_value); 720 } 721 701 722 } // namespace JSC 702 723
Note:
See TracChangeset
for help on using the changeset viewer.