📄 jsatom.h
字号:
JSAtom *parseFloatAtom; JSAtom *parseIntAtom; JSAtom *propertyIsEnumerableAtom; JSAtom *unescapeAtom; JSAtom *unevalAtom; JSAtom *unwatchAtom; JSAtom *watchAtom; } lazy;#ifdef JS_THREADSAFE JSThinLock lock; volatile uint32 tablegen;#endif#ifdef NARCISSUS JSAtom *callAtom; JSAtom *constructAtom; JSAtom *hasInstanceAtom; JSAtom *ExecutionContextAtom; JSAtom *currentAtom;#endif};#define CLASS_ATOM(cx,name) \ ((cx)->runtime->atomState.classAtoms[JSProto_##name])/* Well-known predefined strings and their atoms. */extern const char *js_type_strs[];extern const char *js_boolean_strs[];extern const char *js_proto_strs[];#define JS_PROTO(name,code,init) extern const char js_##name##_str[];#include "jsproto.tbl"#undef JS_PROTOextern const char js_anonymous_str[];extern const char js_arguments_str[];extern const char js_arity_str[];extern const char js_callee_str[];extern const char js_caller_str[];extern const char js_class_prototype_str[];extern const char js_close_str[];extern const char js_constructor_str[];extern const char js_count_str[];extern const char js_etago_str[];extern const char js_each_str[];extern const char js_eval_str[];extern const char js_fileName_str[];extern const char js_get_str[];extern const char js_getter_str[];extern const char js_index_str[];extern const char js_input_str[];extern const char js_iterator_str[];extern const char js_length_str[];extern const char js_lineNumber_str[];extern const char js_message_str[];extern const char js_name_str[];extern const char js_namespace_str[];extern const char js_next_str[];extern const char js_noSuchMethod_str[];extern const char js_object_str[];extern const char js_parent_str[];extern const char js_private_str[];extern const char js_proto_str[];extern const char js_ptagc_str[];extern const char js_qualifier_str[];extern const char js_send_str[];extern const char js_setter_str[];extern const char js_set_str[];extern const char js_space_str[];extern const char js_stack_str[];extern const char js_stago_str[];extern const char js_star_str[];extern const char js_starQualifier_str[];extern const char js_tagc_str[];extern const char js_toSource_str[];extern const char js_toString_str[];extern const char js_toLocaleString_str[];extern const char js_valueOf_str[];extern const char js_xml_str[];#ifdef NARCISSUSextern const char js_call_str[];extern const char js_construct_str[];extern const char js_hasInstance_str[];extern const char js_ExecutionContext_str[];extern const char js_current_str[];#endif/* * Initialize atom state. Return true on success, false with an out of * memory error report on failure. */extern JSBooljs_InitAtomState(JSContext *cx, JSAtomState *state);/* * Free and clear atom state (except for any interned string atoms). */extern voidjs_FreeAtomState(JSContext *cx, JSAtomState *state);/* * Interned strings are atoms that live until state's runtime is destroyed. * This function frees all interned string atoms, and then frees and clears * state's members (just as js_FreeAtomState does), unless there aren't any * interned strings in state -- in which case state must be "free" already. * * NB: js_FreeAtomState is called for each "last" context being destroyed in * a runtime, where there may yet be another context created in the runtime; * whereas js_FinishAtomState is called from JS_DestroyRuntime, when we know * that no more contexts will be created. Thus we minimize garbage during * context-free episodes on a runtime, while preserving atoms created by the * JS_Intern*String APIs for the life of the runtime. */extern voidjs_FinishAtomState(JSAtomState *state);/* * Atom garbage collection hooks. */typedef void(*JSGCThingMarker)(void *thing, void *data);extern voidjs_MarkAtomState(JSAtomState *state, JSBool keepAtoms, JSGCThingMarker mark, void *data);extern voidjs_SweepAtomState(JSAtomState *state);extern JSBooljs_InitPinnedAtoms(JSContext *cx, JSAtomState *state);extern voidjs_UnpinPinnedAtoms(JSAtomState *state);/* * Find or create the atom for an object. If we create a new atom, give it the * type indicated in flags. Return 0 on failure to allocate memory. */extern JSAtom *js_AtomizeObject(JSContext *cx, JSObject *obj, uintN flags);/* * Find or create the atom for a Boolean value. If we create a new atom, give * it the type indicated in flags. Return 0 on failure to allocate memory. */extern JSAtom *js_AtomizeBoolean(JSContext *cx, JSBool b, uintN flags);/* * Find or create the atom for an integer value. If we create a new atom, give * it the type indicated in flags. Return 0 on failure to allocate memory. */extern JSAtom *js_AtomizeInt(JSContext *cx, jsint i, uintN flags);/* * Find or create the atom for a double value. If we create a new atom, give * it the type indicated in flags. Return 0 on failure to allocate memory. */extern JSAtom *js_AtomizeDouble(JSContext *cx, jsdouble d, uintN flags);/* * Find or create the atom for a string. If we create a new atom, give it the * type indicated in flags. Return 0 on failure to allocate memory. */extern JSAtom *js_AtomizeString(JSContext *cx, JSString *str, uintN flags);extern JS_FRIEND_API(JSAtom *)js_Atomize(JSContext *cx, const char *bytes, size_t length, uintN flags);extern JS_FRIEND_API(JSAtom *)js_AtomizeChars(JSContext *cx, const jschar *chars, size_t length, uintN flags);/* * Return an existing atom for the given char array or null if the char * sequence is currently not atomized. */extern JSAtom *js_GetExistingStringAtom(JSContext *cx, const jschar *chars, size_t length);/* * This variant handles all value tag types. */extern JSAtom *js_AtomizeValue(JSContext *cx, jsval value, uintN flags);/* * Convert v to an atomized string. */extern JSAtom *js_ValueToStringAtom(JSContext *cx, jsval v);/* * Assign atom an index and insert it on al. */extern JSAtomListElement *js_IndexAtom(JSContext *cx, JSAtom *atom, JSAtomList *al);/* * Get the atom with index i from map. */extern JS_FRIEND_API(JSAtom *)js_GetAtom(JSContext *cx, JSAtomMap *map, jsatomid i);/* * For all unmapped atoms recorded in al, add a mapping from the atom's index * to its address. The GC must not run until all indexed atoms in atomLists * have been mapped by scripts connected to live objects (Function and Script * class objects have scripts as/in their private data -- the GC knows about * these two classes). */extern JS_FRIEND_API(JSBool)js_InitAtomMap(JSContext *cx, JSAtomMap *map, JSAtomList *al);/* * Free map->vector and clear map. */extern JS_FRIEND_API(void)js_FreeAtomMap(JSContext *cx, JSAtomMap *map);JS_END_EXTERN_C#endif /* jsatom_h___ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -