Classes | Defines | Typedefs | Enumerations | Functions | Variables

jsgc.h File Reference

#include "jsprvtd.h"
#include "jspubtd.h"
#include "jsdhash.h"
#include "jsbit.h"
#include "jsutil.h"
#include "jstask.h"
Include dependency graph for jsgc.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  JSPtrTable
struct  JSGCArenaList
struct  JSGCDoubleArenaList
struct  JSGCFreeLists
struct  JSWeakRoots
class  JSFreePointerListTask

Defines

#define JSTRACE_XML   3
#define JSTRACE_LIMIT   4
#define GC_POKE(cx, oldval)   ((cx)->runtime->gcPoke = JS_TRUE)
#define IS_GC_MARKING_TRACER(trc)   ((trc)->callback == NULL)
#define JS_IS_VALID_TRACE_KIND(kind)   ((uint32)(kind) <= JSTRACE_STRING)
#define JS_CLEAR_WEAK_ROOTS(wr)   (memset((wr), 0, sizeof(JSWeakRoots)))

Typedefs

typedef struct JSPtrTable JSPtrTable
typedef enum JSGCInvocationKind JSGCInvocationKind

Enumerations

enum  JSGCInvocationKind {
  GC_NORMAL = 0, GC_LAST_CONTEXT = 1, GC_LOCK_HELD = 0x10, GC_KEEP_ATOMS = GC_LOCK_HELD,
  GC_SET_SLOT_REQUEST = GC_LOCK_HELD | 1, GC_LAST_DITCH = GC_LOCK_HELD | 2
}
enum  JSFinalizeGCThingKind {
  FINALIZE_OBJECT, FINALIZE_FUNCTION, FINALIZE_STRING, FINALIZE_EXTERNAL_STRING0,
  FINALIZE_EXTERNAL_STRING1, FINALIZE_EXTERNAL_STRING2, FINALIZE_EXTERNAL_STRING3, FINALIZE_EXTERNAL_STRING4,
  FINALIZE_EXTERNAL_STRING5, FINALIZE_EXTERNAL_STRING6, FINALIZE_EXTERNAL_STRING7, FINALIZE_EXTERNAL_STRING_LAST = FINALIZE_EXTERNAL_STRING7,
  FINALIZE_LIMIT
}

Functions

intN js_GetExternalStringGCType (JSString *str)
uint32 js_GetGCThingTraceKind (void *thing)
JSRuntimejs_GetGCStringRuntime (JSString *str)
JSBool js_InitGC (JSRuntime *rt, uint32 maxbytes)
void js_FinishGC (JSRuntime *rt)
intN js_ChangeExternalStringFinalizer (JSStringFinalizeOp oldop, JSStringFinalizeOp newop)
JSBool js_AddRoot (JSContext *cx, void *rp, const char *name)
JSBool js_AddRootRT (JSRuntime *rt, void *rp, const char *name)
JSBool js_RemoveRoot (JSRuntime *rt, void *rp)
uint32 js_MapGCRoots (JSRuntime *rt, JSGCRootMapFun map, void *data)
JSBool js_RegisterCloseableIterator (JSContext *cx, JSObject *obj)
JSBool js_NewDoubleInRootedValue (JSContext *cx, jsdouble d, jsval *vp)
jsdoublejs_NewWeaklyRootedDouble (JSContext *cx, jsdouble d)
JSBool js_ReserveObjects (JSContext *cx, size_t nobjects)
JSBool js_LockGCThingRT (JSRuntime *rt, void *thing)
void js_UnlockGCThingRT (JSRuntime *rt, void *thing)
bool js_IsAboutToBeFinalized (void *thing)
void js_CallValueTracerIfGCThing (JSTracer *trc, jsval v)
void js_TraceStackFrame (JSTracer *trc, JSStackFrame *fp)
void js_TraceRuntime (JSTracer *trc, JSBool allAtoms)
void js_TraceContext (JSTracer *trc, JSContext *acx)
void js_TriggerGC (JSContext *cx, JSBool gcLocked)
void js_GC (JSContext *cx, JSGCInvocationKind gckind)
void * js_NewFinalizableGCThing (JSContext *cx, unsigned thingKind)
void js_DestroyScriptsToGC (JSContext *cx, JSThreadData *data)
void js_FinalizeStringRT (JSRuntime *rt, JSString *str)
void js_MarkTraps (JSTracer *trc)

Variables

const uintN JS_EXTERNAL_STRING_LIMIT = 8

Define Documentation

#define GC_POKE (   cx,
  oldval 
)    ((cx)->runtime->gcPoke = JS_TRUE)
#define IS_GC_MARKING_TRACER (   trc  )     ((trc)->callback == NULL)
#define JS_CLEAR_WEAK_ROOTS (   wr  )     (memset((wr), 0, sizeof(JSWeakRoots)))
#define JS_IS_VALID_TRACE_KIND (   kind  )     ((uint32)(kind) <= JSTRACE_STRING)
#define JSTRACE_LIMIT   4
#define JSTRACE_XML   3

Typedef Documentation

typedef struct JSPtrTable JSPtrTable

Enumeration Type Documentation

Enumerator:
FINALIZE_OBJECT 
FINALIZE_FUNCTION 
FINALIZE_STRING 
FINALIZE_EXTERNAL_STRING0 
FINALIZE_EXTERNAL_STRING1 
FINALIZE_EXTERNAL_STRING2 
FINALIZE_EXTERNAL_STRING3 
FINALIZE_EXTERNAL_STRING4 
FINALIZE_EXTERNAL_STRING5 
FINALIZE_EXTERNAL_STRING6 
FINALIZE_EXTERNAL_STRING7 
FINALIZE_EXTERNAL_STRING_LAST 
FINALIZE_LIMIT 
Enumerator:
GC_NORMAL 
GC_LAST_CONTEXT 
GC_LOCK_HELD 
GC_KEEP_ATOMS 
GC_SET_SLOT_REQUEST 
GC_LAST_DITCH 

Function Documentation

JSBool js_AddRoot ( JSContext cx,
void *  rp,
const char *  name 
)
JSBool js_AddRootRT ( JSRuntime rt,
void *  rp,
const char *  name 
)
void js_CallValueTracerIfGCThing ( JSTracer trc,
jsval  v 
)
intN js_ChangeExternalStringFinalizer ( JSStringFinalizeOp  oldop,
JSStringFinalizeOp  newop 
)
void js_DestroyScriptsToGC ( JSContext cx,
JSThreadData data 
)
void js_FinalizeStringRT ( JSRuntime rt,
JSString str 
)
void js_FinishGC ( JSRuntime rt  ) 
void js_GC ( JSContext cx,
JSGCInvocationKind  gckind 
)
intN js_GetExternalStringGCType ( JSString str  ) 
JSRuntime* js_GetGCStringRuntime ( JSString str  ) 
uint32 js_GetGCThingTraceKind ( void *  thing  ) 
JSBool js_InitGC ( JSRuntime rt,
uint32  maxbytes 
)
bool js_IsAboutToBeFinalized ( void *  thing  ) 
JSBool js_LockGCThingRT ( JSRuntime rt,
void *  thing 
)
uint32 js_MapGCRoots ( JSRuntime rt,
JSGCRootMapFun  map,
void *  data 
)
void js_MarkTraps ( JSTracer trc  ) 
JSBool js_NewDoubleInRootedValue ( JSContext cx,
jsdouble  d,
jsval vp 
)
void* js_NewFinalizableGCThing ( JSContext cx,
unsigned  thingKind 
)
jsdouble* js_NewWeaklyRootedDouble ( JSContext cx,
jsdouble  d 
)
JSBool js_RegisterCloseableIterator ( JSContext cx,
JSObject obj 
)
JSBool js_RemoveRoot ( JSRuntime rt,
void *  rp 
)
JSBool js_ReserveObjects ( JSContext cx,
size_t  nobjects 
)
void js_TraceContext ( JSTracer trc,
JSContext acx 
)
void js_TraceRuntime ( JSTracer trc,
JSBool  allAtoms 
)
void js_TraceStackFrame ( JSTracer trc,
JSStackFrame fp 
)
void js_TriggerGC ( JSContext cx,
JSBool  gcLocked 
)
void js_UnlockGCThingRT ( JSRuntime rt,
void *  thing 
)

Variable Documentation