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

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


Classes

struct  JSScope
struct  JSScopeProperty

Defines

#define OBJ_SCOPE(obj)   ((JSScope *)(obj)->map)
#define SCOPE_CAPACITY(scope)   JS_BIT(JS_DHASH_BITS-(scope)->hashShift)
#define SCOPE_MIDDLE_DELETE   0x0001
#define SCOPE_SEALED   0x0002
#define SCOPE_HAD_MIDDLE_DELETE(scope)   ((scope)->flags & SCOPE_MIDDLE_DELETE)
#define SCOPE_SET_MIDDLE_DELETE(scope)   ((scope)->flags |= SCOPE_MIDDLE_DELETE)
#define SCOPE_CLR_MIDDLE_DELETE(scope)   ((scope)->flags &= ~SCOPE_MIDDLE_DELETE)
#define SCOPE_IS_SEALED(scope)   ((scope)->flags & SCOPE_SEALED)
#define SCOPE_SET_SEALED(scope)   ((scope)->flags |= SCOPE_SEALED)
#define SCOPE_LAST_PROP(scope)   ((scope)->lastProp)
#define SCOPE_REMOVE_LAST_PROP(scope)
#define SPROP_COLLISION   ((jsuword)1)
#define SPROP_REMOVED   ((JSScopeProperty *) SPROP_COLLISION)
#define SPROP_IS_FREE(sprop)   ((sprop) == NULL)
#define SPROP_IS_REMOVED(sprop)   ((sprop) == SPROP_REMOVED)
#define SPROP_IS_LIVE(sprop)   ((sprop) > SPROP_REMOVED)
#define SPROP_FLAG_COLLISION(spp, sprop)
#define SPROP_HAD_COLLISION(sprop)   ((jsuword)(sprop) & SPROP_COLLISION)
#define SPROP_FETCH(spp)   SPROP_CLEAR_COLLISION(*(spp))
#define SPROP_CLEAR_COLLISION(sprop)   ((JSScopeProperty *) ((jsuword)(sprop) & ~SPROP_COLLISION))
#define SPROP_STORE_PRESERVING_COLLISION(spp, sprop)
#define SPROP_MARK   0x01
#define SPROP_IS_DUPLICATE   0x02
#define SPROP_IS_ALIAS   0x04
#define SPROP_HAS_SHORTID   0x08
#define SPROP_IS_HIDDEN   0x10
#define SPROP_USERID(sprop)
#define SPROP_INVALID_SLOT   0xffffffff
#define SPROP_HAS_VALID_SLOT(sprop, scope)   ((sprop)->slot < (scope)->map.freeslot)
#define SPROP_HAS_STUB_GETTER(sprop)   (!(sprop)->getter)
#define SPROP_HAS_STUB_SETTER(sprop)   (!(sprop)->setter)
#define SPROP_CALL_GETTER(cx, sprop, getter, obj, obj2, vp)
#define SPROP_CALL_SETTER(cx, sprop, setter, obj, obj2, vp)
#define SPROP_GET(cx, sprop, obj, obj2, vp)
#define SPROP_SET(cx, sprop, obj, obj2, vp)
#define SPROP_IS_SHARED_PERMANENT(sprop)   ((~(sprop)->attrs & (JSPROP_SHARED | JSPROP_PERMANENT)) == 0)
#define ID_TO_VALUE(id)
#define HASH_ID(id)
#define SCOPE_GET_PROPERTY(scope, id)   SPROP_FETCH(js_SearchScope(scope, id, JS_FALSE))
#define SCOPE_HAS_PROPERTY(scope, sprop)   (SCOPE_GET_PROPERTY(scope, (sprop)->id) == (sprop))
#define MARK_SCOPE_PROPERTY(sprop)   ((sprop)->flags |= SPROP_MARK)

Functions

JSScopejs_GetMutableScope (JSContext *cx, JSObject *obj)
JSScopejs_NewScope (JSContext *cx, jsrefcount nrefs, JSObjectOps *ops, JSClass *clasp, JSObject *obj)
void js_DestroyScope (JSContext *cx, JSScope *scope)
 JS_FRIEND_API (JSScopeProperty **) js_SearchScope(JSScope *scope
JSScopePropertyjs_AddScopeProperty (JSContext *cx, JSScope *scope, jsid id, JSPropertyOp getter, JSPropertyOp setter, uint32 slot, uintN attrs, uintN flags, intN shortid)
JSScopePropertyjs_ChangeScopePropertyAttrs (JSContext *cx, JSScope *scope, JSScopeProperty *sprop, uintN attrs, uintN mask, JSPropertyOp getter, JSPropertyOp setter)
JSBool js_RemoveScopeProperty (JSContext *cx, JSScope *scope, jsid id)
void js_ClearScope (JSContext *cx, JSScope *scope)
void js_SweepScopeProperties (JSRuntime *rt)
JSBool js_InitPropertyTree (JSRuntime *rt)
void js_FinishPropertyTree (JSRuntime *rt)

Variables

jsid id
jsid JSBool adding

Define Documentation

#define HASH_ID id   ) 
 

Value:

(JSID_IS_ATOM(id) ? JSID_TO_ATOM(id)->number :        \
                         JSID_IS_OBJECT(id) ? (jsatomid) JSID_CLRTAG(id) :    \
                         (jsatomid) JSID_TO_INT(id))

#define ID_TO_VALUE id   ) 
 

Value:

#define MARK_SCOPE_PROPERTY sprop   )     ((sprop)->flags |= SPROP_MARK)
 

#define OBJ_SCOPE obj   )     ((JSScope *)(obj)->map)
 

#define SCOPE_CAPACITY scope   )     JS_BIT(JS_DHASH_BITS-(scope)->hashShift)
 

#define SCOPE_CLR_MIDDLE_DELETE scope   )     ((scope)->flags &= ~SCOPE_MIDDLE_DELETE)
 

#define SCOPE_GET_PROPERTY scope,
id   )     SPROP_FETCH(js_SearchScope(scope, id, JS_FALSE))
 

#define SCOPE_HAD_MIDDLE_DELETE scope   )     ((scope)->flags & SCOPE_MIDDLE_DELETE)
 

#define SCOPE_HAS_PROPERTY scope,
sprop   )     (SCOPE_GET_PROPERTY(scope, (sprop)->id) == (sprop))
 

#define SCOPE_IS_SEALED scope   )     ((scope)->flags & SCOPE_SEALED)
 

#define SCOPE_LAST_PROP scope   )     ((scope)->lastProp)
 

#define SCOPE_MIDDLE_DELETE   0x0001
 

#define SCOPE_REMOVE_LAST_PROP scope   ) 
 

Value:

((scope)->lastProp =                  \
                                         (scope)->lastProp->parent)

#define SCOPE_SEALED   0x0002
 

#define SCOPE_SET_MIDDLE_DELETE scope   )     ((scope)->flags |= SCOPE_MIDDLE_DELETE)
 

#define SCOPE_SET_SEALED scope   )     ((scope)->flags |= SCOPE_SEALED)
 

#define SPROP_CALL_GETTER cx,
sprop,
getter,
obj,
obj2,
vp   ) 
 

Value:

#define SPROP_CALL_SETTER cx,
sprop,
setter,
obj,
obj2,
vp   ) 
 

Value:

#define SPROP_CLEAR_COLLISION sprop   )     ((JSScopeProperty *) ((jsuword)(sprop) & ~SPROP_COLLISION))
 

#define SPROP_COLLISION   ((jsuword)1)
 

#define SPROP_FETCH spp   )     SPROP_CLEAR_COLLISION(*(spp))
 

#define SPROP_FLAG_COLLISION spp,
sprop   ) 
 

Value:

(*(spp) = (JSScopeProperty *)         \
                                         ((jsuword)(sprop) | SPROP_COLLISION))

#define SPROP_GET cx,
sprop,
obj,
obj2,
vp   ) 
 

Value:

#define SPROP_HAD_COLLISION sprop   )     ((jsuword)(sprop) & SPROP_COLLISION)
 

#define SPROP_HAS_SHORTID   0x08
 

#define SPROP_HAS_STUB_GETTER sprop   )     (!(sprop)->getter)
 

#define SPROP_HAS_STUB_SETTER sprop   )     (!(sprop)->setter)
 

#define SPROP_HAS_VALID_SLOT sprop,
scope   )     ((sprop)->slot < (scope)->map.freeslot)
 

#define SPROP_INVALID_SLOT   0xffffffff
 

#define SPROP_IS_ALIAS   0x04
 

#define SPROP_IS_DUPLICATE   0x02
 

#define SPROP_IS_FREE sprop   )     ((sprop) == NULL)
 

#define SPROP_IS_HIDDEN   0x10
 

#define SPROP_IS_LIVE sprop   )     ((sprop) > SPROP_REMOVED)
 

#define SPROP_IS_REMOVED sprop   )     ((sprop) == SPROP_REMOVED)
 

#define SPROP_IS_SHARED_PERMANENT sprop   )     ((~(sprop)->attrs & (JSPROP_SHARED | JSPROP_PERMANENT)) == 0)
 

#define SPROP_MARK   0x01
 

#define SPROP_REMOVED   ((JSScopeProperty *) SPROP_COLLISION)
 

#define SPROP_SET cx,
sprop,
obj,
obj2,
vp   ) 
 

Value:

(((sprop)->attrs & JSPROP_SETTER)                                         \
     ? js_InternalGetOrSet(cx, obj, (sprop)->id,                              \
                           OBJECT_TO_JSVAL((sprop)->setter), JSACC_WRITE,     \
                           1, vp, vp)                                         \
     : ((sprop)->attrs & JSPROP_GETTER)                                       \
     ? (JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,                    \
                             JSMSG_GETTER_ONLY, NULL), JS_FALSE)              \
     : SPROP_CALL_SETTER(cx, sprop, (sprop)->setter, obj, obj2, vp))

#define SPROP_STORE_PRESERVING_COLLISION spp,
sprop   ) 
 

Value:

(*(spp) = (JSScopeProperty *) ((jsuword)(sprop)                           \
                                   | SPROP_HAD_COLLISION(*(spp))))

#define SPROP_USERID sprop   ) 
 

Value:

(((sprop)->flags & SPROP_HAS_SHORTID) ? INT_TO_JSVAL((sprop)->shortid)    \
                                          : ID_TO_VALUE((sprop)->id))


Function Documentation

JSScopeProperty* js_AddScopeProperty JSContext cx,
JSScope scope,
jsid  id,
JSPropertyOp  getter,
JSPropertyOp  setter,
uint32  slot,
uintN  attrs,
uintN  flags,
intN  shortid
 

JSScopeProperty* js_ChangeScopePropertyAttrs JSContext cx,
JSScope scope,
JSScopeProperty sprop,
uintN  attrs,
uintN  mask,
JSPropertyOp  getter,
JSPropertyOp  setter
 

void js_ClearScope JSContext cx,
JSScope scope
 

void js_DestroyScope JSContext cx,
JSScope scope
 

void js_FinishPropertyTree JSRuntime rt  ) 
 

JS_FRIEND_API JSScopeProperty **   ) 
 

JSScope* js_GetMutableScope JSContext cx,
JSObject obj
 

JSBool js_InitPropertyTree JSRuntime rt  ) 
 

JSScope* js_NewScope JSContext cx,
jsrefcount  nrefs,
JSObjectOps ops,
JSClass clasp,
JSObject obj
 

JSBool js_RemoveScopeProperty JSContext cx,
JSScope scope,
jsid  id
 

void js_SweepScopeProperties JSRuntime rt  ) 
 


Variable Documentation

jsid JSBool adding
 

jsid id
 

   Comments or Suggestions?    License Information