Bug 724398 - specialize GCThingIsMarked to GRAY. r=billm

This commit is contained in:
Andrew McCreight 2012-02-05 19:43:35 -08:00
Родитель 90584af833
Коммит ae5be20b56
5 изменённых файлов: 15 добавлений и 19 удалений

Просмотреть файл

@ -388,6 +388,13 @@ js::TraceWeakMaps(WeakMapTracer *trc)
WatchpointMap::traceAll(trc);
}
JS_FRIEND_API(bool)
js::GCThingIsMarkedGray(void *thing)
{
JS_ASSERT(thing);
return reinterpret_cast<gc::Cell *>(thing)->isMarked(gc::GRAY);
}
JS_FRIEND_API(void)
JS_SetAccumulateTelemetryCallback(JSRuntime *rt, JSAccumulateTelemetryDataCallback callback)
{

Просмотреть файл

@ -292,6 +292,10 @@ struct WeakMapTracer {
extern JS_FRIEND_API(void)
TraceWeakMaps(WeakMapTracer *trc);
extern JS_FRIEND_API(bool)
GCThingIsMarkedGray(void *thing);
/*
* Shadow declarations of JS internal structures, for access by inline access
* functions below. Do not use these structures in any other way. When adding

Просмотреть файл

@ -856,14 +856,6 @@ IsAboutToBeFinalized(JSContext *cx, const Value &v)
return IsAboutToBeFinalized(cx, (Cell *)v.toGCThing());
}
JS_FRIEND_API(bool)
js_GCThingIsMarked(void *thing, uintN color = BLACK)
{
JS_ASSERT(thing);
AssertValidColor(thing, color);
return reinterpret_cast<Cell *>(thing)->isMarked(color);
}
/* Lifetime for type sets attached to scripts containing observed types. */
static const int64_t JIT_SCRIPT_RELEASE_TYPES_INTERVAL = 60 * 1000 * 1000;

Просмотреть файл

@ -1363,9 +1363,6 @@ IsAboutToBeFinalized(JSContext *cx, const js::gc::Cell *thing);
extern bool
IsAboutToBeFinalized(JSContext *cx, const js::Value &value);
extern JS_FRIEND_API(bool)
js_GCThingIsMarked(void *thing, uintN color);
extern void
js_TraceStackFrame(JSTracer *trc, js::StackFrame *fp);

Просмотреть файл

@ -161,19 +161,15 @@ xpc_FastGetCachedWrapper(nsWrapperCache *cache, JSObject *scope)
// The JS GC marks objects gray that are held alive directly or
// indirectly by an XPConnect root. The cycle collector explores only
// this subset of the JS heap. JSStaticAtoms cause this to crash,
// because they are statically allocated in the data segment and thus
// are not really GCThings.
// this subset of the JS heap.
inline JSBool
xpc_IsGrayGCThing(void *thing)
{
return js_GCThingIsMarked(thing, js::gc::GRAY);
return js::GCThingIsMarkedGray(thing);
}
// The cycle collector only cares about JS objects and XML objects that
// are held alive directly or indirectly by an XPConnect root. This
// version is preferred to xpc_IsGrayGCThing when it isn't known if thing
// is a JSString or not. Implemented in nsXPConnect.cpp.
// The cycle collector only cares about some kinds of GCthings that are
// reachable from an XPConnect root. Implemented in nsXPConnect.cpp.
extern JSBool
xpc_GCThingIsGrayCCThing(void *thing);