Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends

JSString Struct Reference

#include <jsstr.h>

Inheritance diagram for JSString:
Collaboration diagram for JSString:

List of all members.

Public Types

typedef uint8 SmallChar

Public Member Functions

size_t buildLengthAndFlags (size_t length, size_t flags)
js::gc::CellasCell ()
js::gc::FreeCellasFreeCell ()
bool isDependent () const
bool isFlat () const
bool isExtensible () const
bool isAtomized () const
bool isRope () const
size_t length () const
bool empty () const
const jschargetChars (JSContext *cx)
const jschargetCharsZ (JSContext *cx)
void initFlatNotTerminated (jschar *chars, size_t length)
void initFlat (jschar *chars, size_t length)
void initShortString (const jschar *chars, size_t length)
void initFlatExtensible (jschar *chars, size_t length, size_t cap)
JSFlatStringassertIsFlat ()
const jscharflatChars () const
size_t flatLength () const
void flatSetAtomized ()
void flatClearExtensible ()
void initDependent (JSString *base, const jschar *chars, size_t length)
JSLinearStringdependentBase () const
const jschardependentChars ()
size_t dependentLength () const
const jscharundepend (JSContext *cx)
const jscharnonRopeChars () const
void initRopeNode (JSString *left, JSString *right, size_t length)
JSStringropeLeft () const
JSStringropeRight () const
void finishTraversalConversion (JSString *base, const jschar *baseBegin, const jschar *end)
const jscharflatten (JSContext *maybecx)
JSLinearStringensureLinear (JSContext *cx)
bool isLinear () const
JSLinearStringassertIsLinear ()
void finalize (JSContext *cx)

Static Public Member Functions

static bool fitsInSmallChar (jschar c)
static bool isUnitString (void *ptr)
static bool isLength2String (void *ptr)
static bool isHundredString (void *ptr)
static bool isStatic (void *ptr)
static JSFlatStringunitString (jschar c)
static JSLinearStringgetUnitString (JSContext *cx, JSString *str, size_t index)
static JSFlatStringlength2String (jschar c1, jschar c2)
static JSFlatStringlength2String (uint32 i)
static JSFlatStringintString (jsint i)
static JSFlatStringlookupStaticString (const jschar *chars, size_t length)
static size_t offsetOfLengthAndFlags ()
static size_t offsetOfChars ()
static void staticAsserts ()

Public Attributes

size_t lengthAndFlags
union {
   const jschar *   chars
   JSString *   left
u
union {
   jschar   inlineStorage [4]
   struct {
      union {
         JSString *   right
         JSString *   base
         size_t   capacity
      } 
      union {
         JSString *   parent
         size_t   reserved
      } 
   }   s
   size_t   externalStringType
}; 

Static Public Attributes

static const size_t TYPE_FLAGS_MASK = (((JSUint32)1 << ( 4 )) - 1)
static const size_t LENGTH_SHIFT = 4
static const size_t TYPE_MASK = (((JSUint32)1 << ( 2 )) - 1)
static const size_t FLAT = 0x0
static const size_t DEPENDENT = 0x1
static const size_t ROPE = 0x2
static const size_t DEPENDENT_BIT = ((JSUint32)1 << ( 0 ))
static const size_t ROPE_BIT = ((JSUint32)1 << ( 1 ))
static const size_t ATOMIZED = ((JSUint32)1 << ( 2 ))
static const size_t EXTENSIBLE = ((JSUint32)1 << ( 3 ))
static const size_t MAX_LENGTH = (1 << 28) - 1
static const SmallChar INVALID_SMALL_CHAR = -1
static const jschar fromSmallChar []
static const SmallChar toSmallChar []
static const JSString unitStringTable []
static const JSString length2StringTable []
static const JSString hundredStringTable []
static const JSString *const intStringTable []

Friends

class js::TraceRecorder
class js::mjit::Compiler
JSAtomjs_AtomizeString (JSContext *cx, JSString *str, uintN flags)

Member Typedef Documentation


Member Function Documentation

js::gc::Cell* JSString::asCell (  )  [inline]
js::gc::FreeCell* JSString::asFreeCell (  )  [inline]
JSFlatString* JSString::assertIsFlat (  )  [inline]
JSLinearString* JSString::assertIsLinear (  )  [inline]
size_t JSString::buildLengthAndFlags ( size_t  length,
size_t  flags 
) [inline]
JSLinearString* JSString::dependentBase (  )  const [inline]
const jschar* JSString::dependentChars (  )  [inline]
size_t JSString::dependentLength (  )  const [inline]
bool JSString::empty (  )  const [inline]
JSLinearString* JSString::ensureLinear ( JSContext cx  )  [inline]
void JSString::finalize ( JSContext cx  )  [inline]

Reimplemented in JSExternalString.

void JSString::finishTraversalConversion ( JSString base,
const jschar baseBegin,
const jschar end 
) [inline]
static bool JSString::fitsInSmallChar ( jschar  c  )  [inline, static]
const jschar* JSString::flatChars (  )  const [inline]
void JSString::flatClearExtensible (  )  [inline]
size_t JSString::flatLength (  )  const [inline]
void JSString::flatSetAtomized (  )  [inline]
const jschar* JSString::flatten ( JSContext maybecx  ) 
const jschar* JSString::getChars ( JSContext cx  )  [inline]
const jschar* JSString::getCharsZ ( JSContext cx  )  [inline]
static JSLinearString* JSString::getUnitString ( JSContext cx,
JSString str,
size_t  index 
) [static]
void JSString::initDependent ( JSString base,
const jschar chars,
size_t  length 
) [inline]
void JSString::initFlat ( jschar chars,
size_t  length 
) [inline]
void JSString::initFlatExtensible ( jschar chars,
size_t  length,
size_t  cap 
) [inline]
void JSString::initFlatNotTerminated ( jschar chars,
size_t  length 
) [inline]
void JSString::initRopeNode ( JSString left,
JSString right,
size_t  length 
) [inline]
void JSString::initShortString ( const jschar chars,
size_t  length 
) [inline]
static JSFlatString* JSString::intString ( jsint  i  )  [static]
bool JSString::isAtomized (  )  const [inline]
bool JSString::isDependent (  )  const [inline]
bool JSString::isExtensible (  )  const [inline]
bool JSString::isFlat (  )  const [inline]
static bool JSString::isHundredString ( void *  ptr  )  [inline, static]
static bool JSString::isLength2String ( void *  ptr  )  [inline, static]
bool JSString::isLinear (  )  const [inline]
bool JSString::isRope (  )  const [inline]
static bool JSString::isStatic ( void *  ptr  )  [inline, static]
static bool JSString::isUnitString ( void *  ptr  )  [inline, static]
size_t JSString::length (  )  const [inline]
static JSFlatString* JSString::length2String ( jschar  c1,
jschar  c2 
) [static]
static JSFlatString* JSString::length2String ( uint32  i  )  [static]
static JSFlatString* JSString::lookupStaticString ( const jschar chars,
size_t  length 
) [static]
const jschar* JSString::nonRopeChars (  )  const [inline]
static size_t JSString::offsetOfChars (  )  [inline, static]
static size_t JSString::offsetOfLengthAndFlags (  )  [inline, static]
JSString* JSString::ropeLeft (  )  const [inline]
JSString* JSString::ropeRight (  )  const [inline]
static void JSString::staticAsserts (  )  [inline, static]
const jschar* JSString::undepend ( JSContext cx  ) 
static JSFlatString* JSString::unitString ( jschar  c  )  [static]

Friends And Related Function Documentation

friend class js::mjit::Compiler [friend]
friend class js::TraceRecorder [friend]
JSAtom* js_AtomizeString ( JSContext cx,
JSString str,
uintN  flags 
) [friend]

Member Data Documentation

union { ... }
const size_t JSString::ATOMIZED = ((JSUint32)1 << ( 2 )) [static]
const size_t JSString::DEPENDENT = 0x1 [static]
const size_t JSString::DEPENDENT_BIT = ((JSUint32)1 << ( 0 )) [static]
const size_t JSString::EXTENSIBLE = ((JSUint32)1 << ( 3 )) [static]
const size_t JSString::FLAT = 0x0 [static]
const jschar JSString::fromSmallChar[] [static]
const JSString* const JSString::intStringTable[] [static]
const size_t JSString::LENGTH_SHIFT = 4 [static]
const size_t JSString::MAX_LENGTH = (1 << 28) - 1 [static]
const size_t JSString::ROPE = 0x2 [static]
const size_t JSString::ROPE_BIT = ((JSUint32)1 << ( 1 )) [static]
struct { ... } JSString::s
const SmallChar JSString::toSmallChar[] [static]
const size_t JSString::TYPE_FLAGS_MASK = (((JSUint32)1 << ( 4 )) - 1) [static]
const size_t JSString::TYPE_MASK = (((JSUint32)1 << ( 2 )) - 1) [static]
union { ... } JSString::u

The documentation for this struct was generated from the following file: