Classes | Namespaces | Defines | Typedefs | Enumerations | Functions | Variables

jsgc.h File Reference

#include <setjmp.h>
#include "jstypes.h"
#include "jsprvtd.h"
#include "jspubtd.h"
#include "jsdhash.h"
#include "jsbit.h"
#include "jsgcchunk.h"
#include "jsutil.h"
#include "jsvector.h"
#include "jsversion.h"
#include "jsobj.h"
#include "jsfun.h"
#include "jsgcstats.h"
#include "jscell.h"
Include dependency graph for jsgc.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  js::gc::ArenaHeader
union  js::gc::ThingOrCell< T >
struct  js::gc::Things< T, N, R >
struct  js::gc::Things< T, N, 0 >
struct  js::gc::Arena< T >
struct  js::gc::Arena< T >::AlignedArenaHeader
struct  js::gc::ArenaBitmap
struct  js::gc::MarkingDelay
struct  js::gc::EmptyArenaLists
struct  js::gc::ChunkInfo
struct  js::gc::Chunk
struct  js::gc::ArenaList
struct  js::gc::FreeLists
struct  js::GCPtrHasher
struct  js::RootInfo
struct  js::WrapperHasher
struct  JSPtrTable
class  js::GCHelperThread
struct  js::GCChunkHasher
struct  js::ConservativeGCThreadData
struct  js::GCMarker

Namespaces

namespace  js
namespace  js::gc

Defines

#define JS_CHECK_STACK_SIZE(limit, lval)   ((jsuword)(lval) > limit)
#define JSTRACE_XML   2
#define JSTRACE_LIMIT   3
#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)

Typedefs

typedef Vector< gc::Chunk
*, 32, SystemAllocPolicy > 
js::GCChunks
typedef HashMap< void
*, uint32, GCPtrHasher,
SystemAllocPolicy > 
js::GCLocks
typedef js::HashMap< void
*, RootInfo, js::DefaultHasher
< void * >
, js::SystemAllocPolicy
js::RootedValueMap
typedef HashMap< Value, Value,
WrapperHasher,
SystemAllocPolicy > 
js::WrapperMap
typedef struct JSPtrTable JSPtrTable
typedef enum JSGCInvocationKind JSGCInvocationKind
typedef HashSet< js::gc::Chunk
*, GCChunkHasher,
SystemAllocPolicy > 
js::GCChunkSet

Enumerations

enum  js::gc::FinalizeKind {
  js::gc::FINALIZE_OBJECT0, js::gc::FINALIZE_OBJECT2, js::gc::FINALIZE_OBJECT4, js::gc::FINALIZE_OBJECT8,
  js::gc::FINALIZE_OBJECT12, js::gc::FINALIZE_OBJECT16, js::gc::FINALIZE_OBJECT_LAST = FINALIZE_OBJECT16, js::gc::FINALIZE_FUNCTION,
  js::gc::FINALIZE_SHORT_STRING, js::gc::FINALIZE_STRING, js::gc::FINALIZE_EXTERNAL_STRING, js::gc::FINALIZE_LIMIT
}
enum  JSGCInvocationKind { GC_NORMAL = 0, GC_LAST_CONTEXT = 1 }

Functions

void js_TraceXML (JSTracer *trc, JSXML *thing)
void js::gc::js_static_assert (int arg[(sizeof(Arena< FreeCell >)==4096)?1:-1])
void js::gc::js_static_assert (int arg[(Arena< FreeCell >::ArenaSize%Cell::CellSize==0)?1:-1])
void js::gc::js_static_assert (int arg[(ArenaBitmap::BitCount%(8 *8)==0)?1:-1])
void js::gc::js_static_assert (int arg[(sizeof(Chunk)<=GC_CHUNK_SIZE)?1:-1])
void js::gc::js_static_assert (int arg[(sizeof(Chunk)+Chunk::BytesPerArena > GC_CHUNK_SIZE)?1:-1])
void js::js_static_assert (int arg[(sizeof(HashNumber)==4)?1:-1])
bool RefillFinalizableFreeList (JSContext *cx, unsigned thingKind)
intN js_GetExternalStringGCType (JSString *str)
uint32 js_GetGCThingTraceKind (void *thing)
JSBool js_InitGC (JSRuntime *rt, uint32 maxbytes)
void js_FinishGC (JSRuntime *rt)
JSBool js_AddRoot (JSContext *cx, js::Value *vp, const char *name)
JSBool js_AddGCThingRoot (JSContext *cx, void **rp, const char *name)
uint32 js_MapGCRoots (JSRuntime *rt, JSGCRootMapFun map, void *data)
JSBool js_RegisterCloseableIterator (JSContext *cx, JSObject *obj)
JSBool js_ReserveObjects (JSContext *cx, size_t nobjects)
JSBool js_LockGCThingRT (JSRuntime *rt, void *thing)
void js_UnlockGCThingRT (JSRuntime *rt, void *thing)
bool IsAboutToBeFinalized (JSContext *cx, void *thing)
bool js_GCThingIsMarked (void *thing, uint32 color)
void js_TraceStackFrame (JSTracer *trc, JSStackFrame *fp)
void js::MarkRuntime (JSTracer *trc)
void js::TraceRuntime (JSTracer *trc)
void js::MarkContext (JSTracer *trc, JSContext *acx)
void js::TriggerGC (JSRuntime *rt)
void js::TriggerCompartmentGC (JSCompartment *comp)
void js::MaybeGC (JSContext *cx)
void js_GC (JSContext *cx, JSCompartment *comp, JSGCInvocationKind gckind)
void js_WaitForGC (JSRuntime *rt)
void js_DestroyScriptsToGC (JSContext *cx, JSCompartment *comp)
void js::MarkStackRangeConservatively (JSTracer *trc, Value *begin, Value *end)
void js_FinalizeStringRT (JSRuntime *rt, JSString *str)
void js_MarkTraps (JSTracer *trc)
bool js::gc::SetProtoCheckingForCycles (JSContext *cx, JSObject *obj, JSObject *proto)
JSCompartmentjs::gc::NewCompartment (JSContext *cx, JSPrincipals *principals)

Variables

const uintN js::gc::JS_FINALIZE_OBJECT_LIMIT = 6
const size_t js::gc::GC_ARENA_ALLOCATION_TRIGGER = 30 * js::GC_CHUNK_SIZE
const float js::gc::GC_HEAP_GROWTH_FACTOR = 3.0f

Define Documentation

#define GC_POKE (   cx,
  oldval 
)    ((cx)->runtime->gcPoke = JS_TRUE)
#define IS_GC_MARKING_TRACER (   trc  )     ((trc)->callback == NULL)
#define JS_CHECK_STACK_SIZE (   limit,
  lval 
)    ((jsuword)(lval) > limit)
#define JS_IS_VALID_TRACE_KIND (   kind  )     ((uint32)(kind) <= JSTRACE_STRING)
#define JSTRACE_LIMIT   3
#define JSTRACE_XML   2

Typedef Documentation

typedef struct JSPtrTable JSPtrTable

Enumeration Type Documentation

Enumerator:
GC_NORMAL 
GC_LAST_CONTEXT 

Function Documentation

bool IsAboutToBeFinalized ( JSContext cx,
void *  thing 
)
JSBool js_AddGCThingRoot ( JSContext cx,
void **  rp,
const char *  name 
)
JSBool js_AddRoot ( JSContext cx,
js::Value vp,
const char *  name 
)
void js_DestroyScriptsToGC ( JSContext cx,
JSCompartment comp 
)
void js_FinalizeStringRT ( JSRuntime rt,
JSString str 
)
void js_FinishGC ( JSRuntime rt  ) 
void js_GC ( JSContext cx,
JSCompartment comp,
JSGCInvocationKind  gckind 
)
bool js_GCThingIsMarked ( void *  thing,
uint32  color 
)
intN js_GetExternalStringGCType ( JSString str  ) 
uint32 js_GetGCThingTraceKind ( void *  thing  ) 
JSBool js_InitGC ( JSRuntime rt,
uint32  maxbytes 
)
JSBool js_LockGCThingRT ( JSRuntime rt,
void *  thing 
)
uint32 js_MapGCRoots ( JSRuntime rt,
JSGCRootMapFun  map,
void *  data 
)
void js_MarkTraps ( JSTracer trc  ) 
JSBool js_RegisterCloseableIterator ( JSContext cx,
JSObject obj 
)
JSBool js_ReserveObjects ( JSContext cx,
size_t  nobjects 
)
void js_TraceStackFrame ( JSTracer trc,
JSStackFrame fp 
)
void js_TraceXML ( JSTracer trc,
JSXML thing 
)
void js_UnlockGCThingRT ( JSRuntime rt,
void *  thing 
)
void js_WaitForGC ( JSRuntime rt  ) 
bool RefillFinalizableFreeList ( JSContext cx,
unsigned  thingKind 
)