Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

vcf/JavaScriptKit/js-impl/jsatom.h File Reference


Classes

struct  JSAtom
struct  JSAtomListElement
struct  JSAtomList
struct  JSAtomMap
struct  JSAtomState

Defines

#define ATOM_PINNED   0x01
#define ATOM_INTERNED   0x02
#define ATOM_MARK   0x04
#define ATOM_HIDDEN   0x08
#define ATOM_NOCOPY   0x40
#define ATOM_TMPSTR   0x80
#define ATOM_KEY(atom)   ((jsval)(atom)->entry.key)
#define ATOM_IS_OBJECT(atom)   JSVAL_IS_OBJECT(ATOM_KEY(atom))
#define ATOM_TO_OBJECT(atom)   JSVAL_TO_OBJECT(ATOM_KEY(atom))
#define ATOM_IS_INT(atom)   JSVAL_IS_INT(ATOM_KEY(atom))
#define ATOM_TO_INT(atom)   JSVAL_TO_INT(ATOM_KEY(atom))
#define ATOM_IS_DOUBLE(atom)   JSVAL_IS_DOUBLE(ATOM_KEY(atom))
#define ATOM_TO_DOUBLE(atom)   JSVAL_TO_DOUBLE(ATOM_KEY(atom))
#define ATOM_IS_STRING(atom)   JSVAL_IS_STRING(ATOM_KEY(atom))
#define ATOM_TO_STRING(atom)   JSVAL_TO_STRING(ATOM_KEY(atom))
#define ATOM_IS_BOOLEAN(atom)   JSVAL_IS_BOOLEAN(ATOM_KEY(atom))
#define ATOM_TO_BOOLEAN(atom)   JSVAL_TO_BOOLEAN(ATOM_KEY(atom))
#define ALE_ATOM(ale)   ((JSAtom *) (ale)->entry.key)
#define ALE_INDEX(ale)   ((jsatomid) JS_PTR_TO_UINT32((ale)->entry.value))
#define ALE_JSOP(ale)   ((JSOp) (ale)->entry.value)
#define ALE_VALUE(ale)   ((jsval) (ale)->entry.value)
#define ALE_NEXT(ale)   ((JSAtomListElement *) (ale)->entry.next)
#define ALE_SET_ATOM(ale, atom)   ((ale)->entry.key = (const void *)(atom))
#define ALE_SET_INDEX(ale, index)   ((ale)->entry.value = JS_UINT32_TO_PTR(index))
#define ALE_SET_JSOP(ale, op)   ((ale)->entry.value = JS_UINT32_TO_PTR(op))
#define ALE_SET_VALUE(ale, val)   ((ale)->entry.value = (JSHashEntry *)(val))
#define ALE_SET_NEXT(ale, link)   ((ale)->entry.next = (JSHashEntry *)(link))
#define ATOM_LIST_INIT(al)
#define ATOM_LIST_SEARCH(_ale, _al, _atom)
#define ATOM_LIST_LOOKUP(_ale, _hep, _al, _atom)
#define CLASS_ATOM(cx, name)   ((cx)->runtime->atomState.classAtoms[JSProto_##name])
#define JS_PROTO(name, code, init)   extern const char js_##name##_str[];

Typedefs

typedef void(* JSGCThingMarker )(void *thing, void *data)

Functions

 JS_FRIEND_API (const char *) js_AtomToPrintableString(JSContext *cx
JSBool js_InitAtomState (JSContext *cx, JSAtomState *state)
void js_FreeAtomState (JSContext *cx, JSAtomState *state)
void js_FinishAtomState (JSAtomState *state)
void js_MarkAtomState (JSAtomState *state, JSBool keepAtoms, JSGCThingMarker mark, void *data)
void js_SweepAtomState (JSAtomState *state)
JSBool js_InitPinnedAtoms (JSContext *cx, JSAtomState *state)
void js_UnpinPinnedAtoms (JSAtomState *state)
JSAtomjs_AtomizeObject (JSContext *cx, JSObject *obj, uintN flags)
JSAtomjs_AtomizeBoolean (JSContext *cx, JSBool b, uintN flags)
JSAtomjs_AtomizeInt (JSContext *cx, jsint i, uintN flags)
JSAtomjs_AtomizeDouble (JSContext *cx, jsdouble d, uintN flags)
JSAtomjs_AtomizeString (JSContext *cx, JSString *str, uintN flags)
 JS_FRIEND_API (JSAtom *) js_Atomize(JSContext *cx
JSAtomjs_GetExistingStringAtom (JSContext *cx, const jschar *chars, size_t length)
JSAtomjs_AtomizeValue (JSContext *cx, jsval value, uintN flags)
JSAtomjs_ValueToStringAtom (JSContext *cx, jsval v)
JSAtomListElementjs_IndexAtom (JSContext *cx, JSAtom *atom, JSAtomList *al)
 JS_FRIEND_API (JSBool) js_InitAtomMap(JSContext *cx
 JS_FRIEND_API (void) js_FreeAtomMap(JSContext *cx

Variables

JSAtomatom
const char * js_type_strs []
const char * js_boolean_strs []
const char * js_proto_strs []
const char js_anonymous_str []
const char js_arguments_str []
const char js_arity_str []
const char js_callee_str []
const char js_caller_str []
const char js_class_prototype_str []
const char js_close_str []
const char js_constructor_str []
const char js_count_str []
const char js_etago_str []
const char js_each_str []
const char js_eval_str []
const char js_fileName_str []
const char js_get_str []
const char js_getter_str []
const char js_index_str []
const char js_input_str []
const char js_iterator_str []
const char js_length_str []
const char js_lineNumber_str []
const char js_message_str []
const char js_name_str []
const char js_namespace_str []
const char js_next_str []
const char js_noSuchMethod_str []
const char js_object_str []
const char js_parent_str []
const char js_private_str []
const char js_proto_str []
const char js_ptagc_str []
const char js_qualifier_str []
const char js_send_str []
const char js_setter_str []
const char js_set_str []
const char js_space_str []
const char js_stack_str []
const char js_stago_str []
const char js_star_str []
const char js_starQualifier_str []
const char js_tagc_str []
const char js_toSource_str []
const char js_toString_str []
const char js_toLocaleString_str []
const char js_valueOf_str []
const char js_xml_str []
const char * bytes
const char size_t length
const char size_t uintN flags
const jscharchars
const jschar size_t length
const jschar size_t uintN flags
JSAtomMapmap
JSAtomMap jsatomid i
JSAtomMapmap
JSAtomMap JSAtomListal
JSAtomMapmap

Define Documentation

#define ALE_ATOM ale   )     ((JSAtom *) (ale)->entry.key)
 

#define ALE_INDEX ale   )     ((jsatomid) JS_PTR_TO_UINT32((ale)->entry.value))
 

#define ALE_JSOP ale   )     ((JSOp) (ale)->entry.value)
 

#define ALE_NEXT ale   )     ((JSAtomListElement *) (ale)->entry.next)
 

#define ALE_SET_ATOM ale,
atom   )     ((ale)->entry.key = (const void *)(atom))
 

#define ALE_SET_INDEX ale,
index   )     ((ale)->entry.value = JS_UINT32_TO_PTR(index))
 

#define ALE_SET_JSOP ale,
op   )     ((ale)->entry.value = JS_UINT32_TO_PTR(op))
 

#define ALE_SET_NEXT ale,
link   )     ((ale)->entry.next = (JSHashEntry *)(link))
 

#define ALE_SET_VALUE ale,
val   )     ((ale)->entry.value = (JSHashEntry *)(val))
 

#define ALE_VALUE ale   )     ((jsval) (ale)->entry.value)
 

#define ATOM_HIDDEN   0x08
 

#define ATOM_INTERNED   0x02
 

#define ATOM_IS_BOOLEAN atom   )     JSVAL_IS_BOOLEAN(ATOM_KEY(atom))
 

#define ATOM_IS_DOUBLE atom   )     JSVAL_IS_DOUBLE(ATOM_KEY(atom))
 

#define ATOM_IS_INT atom   )     JSVAL_IS_INT(ATOM_KEY(atom))
 

#define ATOM_IS_OBJECT atom   )     JSVAL_IS_OBJECT(ATOM_KEY(atom))
 

#define ATOM_IS_STRING atom   )     JSVAL_IS_STRING(ATOM_KEY(atom))
 

#define ATOM_KEY atom   )     ((jsval)(atom)->entry.key)
 

#define ATOM_LIST_INIT al   ) 
 

Value:

((al)->list = NULL, (al)->table = NULL,           \
                             (al)->count = 0)

#define ATOM_LIST_LOOKUP _ale,
_hep,
_al,
_atom   ) 
 

Value:

JS_BEGIN_MACRO                                                            \
        if ((_al)->table) {                                                   \
            _hep = JS_HashTableRawLookup((_al)->table, _atom->number, _atom); \
            _ale = *_hep ? (JSAtomListElement *) *_hep : NULL;                \
        } else {                                                              \
            JSAtomListElement **_alep = &(_al)->list;                         \
            _hep = NULL;                                                      \
            while ((_ale = *_alep) != NULL) {                                 \
                if (ALE_ATOM(_ale) == (_atom)) {                              \
                    /* Hit, move atom's element to the front of the list. */  \
                    *_alep = ALE_NEXT(_ale);                                  \
                    ALE_SET_NEXT(_ale, (_al)->list);                          \
                    (_al)->list = _ale;                                       \
                    break;                                                    \
                }                                                             \
                _alep = (JSAtomListElement **)&_ale->entry.next;              \
            }                                                                 \
        }                                                                     \
    JS_END_MACRO

#define ATOM_LIST_SEARCH _ale,
_al,
_atom   ) 
 

Value:

JS_BEGIN_MACRO                                                            \
        JSHashEntry **_hep;                                                   \
        ATOM_LIST_LOOKUP(_ale, _hep, _al, _atom);                             \
    JS_END_MACRO

#define ATOM_MARK   0x04
 

#define ATOM_NOCOPY   0x40
 

#define ATOM_PINNED   0x01
 

#define ATOM_TMPSTR   0x80
 

#define ATOM_TO_BOOLEAN atom   )     JSVAL_TO_BOOLEAN(ATOM_KEY(atom))
 

#define ATOM_TO_DOUBLE atom   )     JSVAL_TO_DOUBLE(ATOM_KEY(atom))
 

#define ATOM_TO_INT atom   )     JSVAL_TO_INT(ATOM_KEY(atom))
 

#define ATOM_TO_OBJECT atom   )     JSVAL_TO_OBJECT(ATOM_KEY(atom))
 

#define ATOM_TO_STRING atom   )     JSVAL_TO_STRING(ATOM_KEY(atom))
 

#define CLASS_ATOM cx,
name   )     ((cx)->runtime->atomState.classAtoms[JSProto_##name])
 

#define JS_PROTO name,
code,
init   )     extern const char js_##name##_str[];
 


Typedef Documentation

typedef void(* JSGCThingMarker)(void *thing, void *data)
 


Function Documentation

JSAtom* js_AtomizeBoolean JSContext cx,
JSBool  b,
uintN  flags
 

JSAtom* js_AtomizeDouble JSContext cx,
jsdouble  d,
uintN  flags
 

JSAtom* js_AtomizeInt JSContext cx,
jsint  i,
uintN  flags
 

JSAtom* js_AtomizeObject JSContext cx,
JSObject obj,
uintN  flags
 

JSAtom* js_AtomizeString JSContext cx,
JSString str,
uintN  flags
 

JSAtom* js_AtomizeValue JSContext cx,
jsval  value,
uintN  flags
 

void js_FinishAtomState JSAtomState state  ) 
 

void js_FreeAtomState JSContext cx,
JSAtomState state
 

JS_FRIEND_API void   ) 
 

JS_FRIEND_API JSBool   ) 
 

JS_FRIEND_API JSAtom  ) 
 

JS_FRIEND_API const char *   ) 
 

JSAtom* js_GetExistingStringAtom JSContext cx,
const jschar chars,
size_t  length
 

JSAtomListElement* js_IndexAtom JSContext cx,
JSAtom atom,
JSAtomList al
 

JSBool js_InitAtomState JSContext cx,
JSAtomState state
 

JSBool js_InitPinnedAtoms JSContext cx,
JSAtomState state
 

void js_MarkAtomState JSAtomState state,
JSBool  keepAtoms,
JSGCThingMarker  mark,
void *  data
 

void js_SweepAtomState JSAtomState state  ) 
 

void js_UnpinPinnedAtoms JSAtomState state  ) 
 

JSAtom* js_ValueToStringAtom JSContext cx,
jsval  v
 


Variable Documentation

JSAtomMap JSAtomList* al
 

JSAtom* atom
 

const char* bytes
 

const jschar* chars
 

const jschar size_t uintN flags
 

const char size_t uintN flags
 

JSAtomMap jsatomid i
 

const char js_anonymous_str[]
 

const char js_arguments_str[]
 

const char js_arity_str[]
 

const char* js_boolean_strs[]
 

const char js_callee_str[]
 

const char js_caller_str[]
 

const char js_class_prototype_str[]
 

const char js_close_str[]
 

const char js_constructor_str[]
 

const char js_count_str[]
 

const char js_each_str[]
 

const char js_etago_str[]
 

const char js_eval_str[]
 

const char js_fileName_str[]
 

const char js_get_str[]
 

const char js_getter_str[]
 

const char js_index_str[]
 

const char js_input_str[]
 

const char js_iterator_str[]
 

const char js_length_str[]
 

const char js_lineNumber_str[]
 

const char js_message_str[]
 

const char js_name_str[]
 

const char js_namespace_str[]
 

const char js_next_str[]
 

const char js_noSuchMethod_str[]
 

const char js_object_str[]
 

const char js_parent_str[]
 

const char js_private_str[]
 

const char js_proto_str[]
 

const char* js_proto_strs[]
 

const char js_ptagc_str[]
 

const char js_qualifier_str[]
 

const char js_send_str[]
 

const char js_set_str[]
 

const char js_setter_str[]
 

const char js_space_str[]
 

const char js_stack_str[]
 

const char js_stago_str[]
 

const char js_star_str[]
 

const char js_starQualifier_str[]
 

const char js_tagc_str[]
 

const char js_toLocaleString_str[]
 

const char js_toSource_str[]
 

const char js_toString_str[]
 

const char* js_type_strs[]
 

const char js_valueOf_str[]
 

const char js_xml_str[]
 

const jschar size_t length
 

const char size_t length
 

JSAtomMap* map
 

JSAtomMap* map
 

JSAtomMap* map
 

   Comments or Suggestions?    License Information