/[jscoverage]/trunk/js/jspubtd.h
ViewVC logotype

Diff of /trunk/js/jspubtd.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 459 by siliconforks, Thu Oct 23 19:03:33 2008 UTC revision 460 by siliconforks, Sat Sep 26 23:15:22 2009 UTC
# Line 139  Line 139 
139  typedef struct JSFunctionSpec    JSFunctionSpec;  typedef struct JSFunctionSpec    JSFunctionSpec;
140  typedef struct JSTracer          JSTracer;  typedef struct JSTracer          JSTracer;
141  typedef struct JSIdArray         JSIdArray;  typedef struct JSIdArray         JSIdArray;
142  typedef struct JSProperty        JSProperty;  typedef struct JSPropertyDescriptor JSPropertyDescriptor;
143  typedef struct JSPropertySpec    JSPropertySpec;  typedef struct JSPropertySpec    JSPropertySpec;
144  typedef struct JSObject          JSObject;  typedef struct JSObject          JSObject;
145  typedef struct JSObjectMap       JSObjectMap;  typedef struct JSObjectMap       JSObjectMap;
146  typedef struct JSObjectOps       JSObjectOps;  typedef struct JSObjectOps       JSObjectOps;
 typedef struct JSXMLObjectOps    JSXMLObjectOps;  
147  typedef struct JSRuntime         JSRuntime;  typedef struct JSRuntime         JSRuntime;
148  typedef struct JSRuntime         JSTaskState;   /* XXX deprecated name */  typedef struct JSRuntime         JSTaskState;   /* XXX deprecated name */
149  typedef struct JSScript          JSScript;  typedef struct JSScript          JSScript;
# Line 295  Line 294 
294   * a JSClass *clasp parameter to JS_NewObject, etc.  Most host objects do not   * a JSClass *clasp parameter to JS_NewObject, etc.  Most host objects do not
295   * need to implement the larger JSObjectOps, and can share the common JSScope   * need to implement the larger JSObjectOps, and can share the common JSScope
296   * code and data used by the native (js_ObjectOps, see jsobj.c) ops.   * code and data used by the native (js_ObjectOps, see jsobj.c) ops.
  *  
  * Further extension to preserve API compatibility: if this function returns  
  * a pointer to JSXMLObjectOps.base, not to JSObjectOps, then the engine calls  
  * extended hooks needed for E4X.  
297   */   */
298  typedef JSObjectOps *  typedef JSObjectOps *
299  (* JSGetObjectOps)(JSContext *cx, JSClass *clasp);  (* JSGetObjectOps)(JSContext *cx, JSClass *clasp);
# Line 418  Line 413 
413  typedef uint32  typedef uint32
414  (* JSReserveSlotsOp)(JSContext *cx, JSObject *obj);  (* JSReserveSlotsOp)(JSContext *cx, JSObject *obj);
415    
416  /* JSObjectOps function pointer typedefs. */  /* JSExtendedClass function pointer typedefs. */
   
 /*  
  * Create a new subclass of JSObjectMap (see jsobj.h), with the nrefs and ops  
  * members initialized from the same-named parameters, and with the nslots and  
  * freeslot members initialized according to ops and clasp.  Return null on  
  * error, non-null on success.  
  *  
  * JSObjectMaps are reference-counted by generic code in the engine.  Usually,  
  * the nrefs parameter to JSObjectOps.newObjectMap will be 1, to count the ref  
  * returned to the caller on success.  After a successful construction, some  
  * number of js_HoldObjectMap and js_DropObjectMap calls ensue.  When nrefs  
  * reaches 0 due to a js_DropObjectMap call, JSObjectOps.destroyObjectMap will  
  * be called to dispose of the map.  
  */  
 typedef JSObjectMap *  
 (* JSNewObjectMapOp)(JSContext *cx, jsrefcount nrefs, JSObjectOps *ops,  
                      JSClass *clasp, JSObject *obj);  
   
 /*  
  * Generic type for an infallible JSObjectMap operation, used currently by  
  * JSObjectOps.destroyObjectMap.  
  */  
 typedef void  
 (* JSObjectMapOp)(JSContext *cx, JSObjectMap *map);  
   
 /*  
  * Look for id in obj and its prototype chain, returning false on error or  
  * exception, true on success.  On success, return null in *propp if id was  
  * not found.  If id was found, return the first object searching from obj  
  * along its prototype chain in which id names a direct property in *objp, and  
  * return a non-null, opaque property pointer in *propp.  
  *  
  * If JSLookupPropOp succeeds and returns with *propp non-null, that pointer  
  * may be passed as the prop parameter to a JSAttributesOp, as a short-cut  
  * that bypasses id re-lookup.  In any case, a non-null *propp result after a  
  * successful lookup must be dropped via JSObjectOps.dropProperty.  
  *  
  * NB: successful return with non-null *propp means the implementation may  
  * have locked *objp and added a reference count associated with *propp, so  
  * callers should not risk deadlock by nesting or interleaving other lookups  
  * or any obj-bearing ops before dropping *propp.  
  */  
 typedef JSBool  
 (* JSLookupPropOp)(JSContext *cx, JSObject *obj, jsid id, JSObject **objp,  
                    JSProperty **propp);  
   
 /*  
  * Define obj[id], a direct property of obj named id, having the given initial  
  * value, with the specified getter, setter, and attributes.  If the propp out  
  * param is non-null, *propp on successful return contains an opaque property  
  * pointer usable as a speedup hint with JSAttributesOp.  But note that propp  
  * may be null, indicating that the caller is not interested in recovering an  
  * opaque pointer to the newly-defined property.  
  *  
  * If propp is non-null and JSDefinePropOp succeeds, its caller must be sure  
  * to drop *propp using JSObjectOps.dropProperty in short order, just as with  
  * JSLookupPropOp.  
  */  
 typedef JSBool  
 (* JSDefinePropOp)(JSContext *cx, JSObject *obj, jsid id, jsval value,  
                    JSPropertyOp getter, JSPropertyOp setter, uintN attrs,  
                    JSProperty **propp);  
417    
 /*  
  * Get, set, or delete obj[id], returning false on error or exception, true  
  * on success.  If getting or setting, the new value is returned in *vp on  
  * success.  If deleting without error, *vp will be JSVAL_FALSE if obj[id] is  
  * permanent, and JSVAL_TRUE if id named a direct property of obj that was in  
  * fact deleted, or if id names no direct property of obj (id could name a  
  * prototype property, or no property in obj or its prototype chain).  
  */  
 typedef JSBool  
 (* JSPropertyIdOp)(JSContext *cx, JSObject *obj, jsid id, jsval *vp);  
   
 /*  
  * Get or set attributes of the property obj[id].  Return false on error or  
  * exception, true with current attributes in *attrsp.  If prop is non-null,  
  * it must come from the *propp out parameter of a prior JSDefinePropOp or  
  * JSLookupPropOp call.  
  */  
 typedef JSBool  
 (* JSAttributesOp)(JSContext *cx, JSObject *obj, jsid id, JSProperty *prop,  
                    uintN *attrsp);  
   
 /*  
  * JSObjectOps.checkAccess type: check whether obj[id] may be accessed per  
  * mode, returning false on error/exception, true on success with obj[id]'s  
  * last-got value in *vp, and its attributes in *attrsp.  
  */  
418  typedef JSBool  typedef JSBool
419  (* JSCheckAccessIdOp)(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,  (* JSEqualityOp)(JSContext *cx, JSObject *obj, jsval v, JSBool *bp);
                       jsval *vp, uintN *attrsp);  
420    
421  /*  /*
422   * A generic type for functions mapping an object to another object, or null   * A generic type for functions mapping an object to another object, or null
# Line 527  Line 433 
433  typedef JSObject *  typedef JSObject *
434  (* JSIteratorOp)(JSContext *cx, JSObject *obj, JSBool keysonly);  (* JSIteratorOp)(JSContext *cx, JSObject *obj, JSBool keysonly);
435    
 /*  
  * A generic type for functions taking a context, object, and property, with  
  * no return value.  Used by JSObjectOps.dropProperty currently (see above,  
  * JSDefinePropOp and JSLookupPropOp, for the object-locking protocol in which  
  * dropProperty participates).  
  */  
 typedef void  
 (* JSPropertyRefOp)(JSContext *cx, JSObject *obj, JSProperty *prop);  
   
 /*  
  * Function pointer type for JSObjectOps.setProto and JSObjectOps.setParent.  
  * These hooks must check for cycles without deadlocking, and otherwise take  
  * special steps. See jsobj.c and jsgc.c for details.  
  */  
 typedef JSBool  
 (* JSSetObjectSlotOp)(JSContext *cx, JSObject *obj, uint32 slot,  
                       JSObject *pobj);  
   
 /*  
  * Get and set a required slot, one that should already have been allocated.  
  * These operations are infallible, so required slots must be pre-allocated,  
  * or implementations must suppress out-of-memory errors.  The native ops  
  * (js_ObjectOps, see jsobj.c) access slots reserved by including a call to  
  * the JSCLASS_HAS_RESERVED_SLOTS(n) macro in the JSClass.flags initializer.  
  *  
  * NB: the slot parameter is a zero-based index into obj slots, unlike the  
  * index parameter to the JS_GetReservedSlot and JS_SetReservedSlot API entry  
  * points, which is a zero-based index into the JSCLASS_RESERVED_SLOTS(clasp)  
  * reserved slots that come after the initial well-known slots: proto, parent,  
  * class, and optionally, the private data slot.  
  */  
 typedef jsval  
 (* JSGetRequiredSlotOp)(JSContext *cx, JSObject *obj, uint32 slot);  
   
 typedef JSBool  
 (* JSSetRequiredSlotOp)(JSContext *cx, JSObject *obj, uint32 slot, jsval v);  
   
 typedef JSObject *  
 (* JSGetMethodOp)(JSContext *cx, JSObject *obj, jsid id, jsval *vp);  
   
 typedef JSBool  
 (* JSSetMethodOp)(JSContext *cx, JSObject *obj, jsid id, jsval *vp);  
   
 typedef JSBool  
 (* JSEnumerateValuesOp)(JSContext *cx, JSObject *obj, JSIterateOp enum_op,  
                         jsval *statep, jsid *idp, jsval *vp);  
   
 typedef JSBool  
 (* JSEqualityOp)(JSContext *cx, JSObject *obj, jsval v, JSBool *bp);  
   
 typedef JSBool  
 (* JSConcatenateOp)(JSContext *cx, JSObject *obj, jsval v, jsval *vp);  
   
436  /* Typedef for native functions called by the JS VM. */  /* Typedef for native functions called by the JS VM. */
437    
438  typedef JSBool  typedef JSBool
# Line 613  Line 466 
466  typedef JSBool  typedef JSBool
467  (* JSContextCallback)(JSContext *cx, uintN contextOp);  (* JSContextCallback)(JSContext *cx, uintN contextOp);
468    
469    #ifndef JS_THREADSAFE
470    typedef void
471    (* JSHeartbeatCallback)(JSRuntime *rt);
472    #endif
473    
474  typedef enum JSGCStatus {  typedef enum JSGCStatus {
475      JSGC_BEGIN,      JSGC_BEGIN,
476      JSGC_END,      JSGC_END,

Legend:
Removed from v.459  
changed lines
  Added in v.460

  ViewVC Help
Powered by ViewVC 1.1.24