Bug 692267 - Remove jsgc.h from INSTALLED_HEADERS (r=terrence)

This commit is contained in:
Bill McCloskey 2012-10-26 11:17:24 -07:00
Родитель fc2126e5b2
Коммит a6cd2f8c4f
16 изменённых файлов: 83 добавлений и 61 удалений

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

@ -28,7 +28,6 @@
#ifdef MOZ_MEDIA
#include "nsHTMLMediaElement.h"
#endif // MOZ_MEDIA
#include "jsgc.h"
#include "nsWrapperCacheInlines.h"
#include "nsObjectLoadingContent.h"
#include "nsDOMMutationObserver.h"

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

@ -7,7 +7,6 @@
#include "nsIXPConnect.h"
#include "nsThreadUtils.h"
#include "jsapi.h"
#include "jsgc.h"
#include "jsfriendapi.h"
#include "jsdbgapi.h"
#include "mozilla/ModuleUtils.h"

29
js/public/HeapAPI.h Normal file
Просмотреть файл

@ -0,0 +1,29 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef js_heap_api_h___
#define js_heap_api_h___
#include "gc/Heap.h"
namespace js {
static inline JSCompartment *
GetGCThingCompartment(void *thing)
{
JS_ASSERT(thing);
return reinterpret_cast<gc::Cell *>(thing)->compartment();
}
static inline JSCompartment *
GetObjectCompartment(JSObject *obj)
{
return GetGCThingCompartment(obj);
}
} /* namespace js */
#endif /* js_heap_api_h___ */

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

@ -161,7 +161,6 @@ INSTALLED_HEADERS = \
jsdbgapi.h \
jsdhash.h \
jsfriendapi.h \
jsgc.h \
jslock.h \
json.h \
jsproxy.h \
@ -187,11 +186,8 @@ EXPORTS_ds = \
$(NULL)
EXPORTS_gc = \
Barrier.h \
Heap.h \
Root.h \
Statistics.h \
StoreBuffer.h \
$(NULL)
######################################################
@ -212,6 +208,7 @@ EXPORTS_NAMESPACES += js
# LegacyIntTypes.h below is deliberately exempted from this requirement.
EXPORTS_js = \
HashTable.h \
HeapAPI.h \
LegacyIntTypes.h \
MemoryMetrics.h \
TemplateLib.h \

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

@ -1026,7 +1026,6 @@ Cell::isAligned() const
#endif
} /* namespace gc */
} /* namespace js */
#endif /* gc_heap_h___ */

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

@ -19,6 +19,7 @@
#include "jsval.h"
#include "js/HashTable.h"
#include "js/HeapAPI.h"
#include "js/MemoryMetrics.h"
#include "js/TemplateLib.h"
#include "js/Utility.h"

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

@ -522,6 +522,19 @@ js::GCThingIsMarkedGray(void *thing)
return reinterpret_cast<gc::Cell *>(thing)->isMarked(gc::GRAY);
}
JS_FRIEND_API(JSGCTraceKind)
js::GCThingTraceKind(void *thing)
{
JS_ASSERT(thing);
return gc::GetGCThingTraceKind(thing);
}
JS_FRIEND_API(void)
js::UnmarkGrayGCThing(void *thing)
{
static_cast<js::gc::Cell *>(thing)->unmark(js::gc::GRAY);
}
JS_FRIEND_API(void)
js::VisitGrayWrapperTargets(JSCompartment *comp, GCThingCallback *callback, void *closure)
{

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

@ -8,13 +8,22 @@
#define jsfriendapi_h___
#include "jsclass.h"
#include "jscpucfg.h"
#include "jspubtd.h"
#include "jsprvtd.h"
#include "js/HeapAPI.h"
#include "mozilla/GuardObjects.h"
JS_BEGIN_EXTERN_C
#if JS_STACK_GROWTH_DIRECTION > 0
# define JS_CHECK_STACK_SIZE(limit, lval) ((uintptr_t)(lval) < limit)
#else
# define JS_CHECK_STACK_SIZE(limit, lval) ((uintptr_t)(lval) > limit)
#endif
extern JS_FRIEND_API(void)
JS_SetGrayGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);
@ -259,6 +268,9 @@ TraceWeakMaps(WeakMapTracer *trc);
extern JS_FRIEND_API(bool)
GCThingIsMarkedGray(void *thing);
JS_FRIEND_API(void)
UnmarkGrayGCThing(void *thing);
typedef void
(GCThingCallback)(void *closure, void *gcthing);
@ -268,6 +280,15 @@ VisitGrayWrapperTargets(JSCompartment *comp, GCThingCallback *callback, void *cl
extern JS_FRIEND_API(JSObject *)
GetWeakmapKeyDelegate(JSObject *key);
JS_FRIEND_API(JSGCTraceKind)
GCThingTraceKind(void *thing);
/*
* Invoke cellCallback on every gray JS_OBJECT in the given compartment.
*/
extern JS_FRIEND_API(void)
IterateGrayObjects(JSCompartment *compartment, GCThingCallback *cellCallback, void *data);
/*
* Shadow declarations of JS internal structures, for access by inline access
* functions below. Do not use these structures in any other way. When adding

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

@ -3133,7 +3133,7 @@ GCHelperThread::startBackgroundAllocationIfIdle()
#endif /* JS_THREADSAFE */
}
JS_FRIEND_API(void)
void
GCHelperThread::replenishAndFreeLater(void *ptr)
{
JS_ASSERT(freeCursor == freeCursorEnd);

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

@ -31,12 +31,6 @@
struct JSCompartment;
#if JS_STACK_GROWTH_DIRECTION > 0
# define JS_CHECK_STACK_SIZE(limit, lval) ((uintptr_t)(lval) < limit)
#else
# define JS_CHECK_STACK_SIZE(limit, lval) ((uintptr_t)(lval) > limit)
#endif
namespace js {
class GCHelperThread;
@ -482,9 +476,6 @@ typedef js::HashMap<void *,
} /* namespace js */
extern JS_FRIEND_API(JSGCTraceKind)
js_GetGCThingTraceKind(void *thing);
extern JSBool
js_InitGC(JSRuntime *rt, uint32_t maxbytes);
@ -530,9 +521,6 @@ MarkCompartmentActive(js::StackFrame *fp);
extern void
TraceRuntime(JSTracer *trc);
extern JS_FRIEND_API(void)
MarkContext(JSTracer *trc, JSContext *acx);
/* Must be called with GC lock taken. */
extern void
TriggerGC(JSRuntime *rt, js::gcreason::Reason reason);
@ -550,9 +538,6 @@ ShrinkGCBuffers(JSRuntime *rt);
extern void
ReleaseAllJITCode(FreeOp *op);
extern JS_FRIEND_API(void)
PrepareForFullGC(JSRuntime *rt);
/*
* Kinds of js_GC invocation.
*/
@ -629,11 +614,11 @@ class GCHelperThread {
void **freeCursor;
void **freeCursorEnd;
bool backgroundAllocation;
bool backgroundAllocation;
friend struct js::gc::ArenaLists;
JS_FRIEND_API(void)
void
replenishAndFreeLater(void *ptr);
static void freeElementsAndArray(void **array, void **end) {
@ -1112,7 +1097,7 @@ typedef void (*IterateCellCallback)(JSRuntime *rt, void *data, void *thing,
* |arenaCallback| on every in-use arena, and |cellCallback| on every in-use
* cell in the GC heap.
*/
extern JS_FRIEND_API(void)
extern void
IterateCompartmentsArenasCells(JSRuntime *rt, void *data,
JSIterateCompartmentCallback compartmentCallback,
IterateArenaCallback arenaCallback,
@ -1121,23 +1106,17 @@ IterateCompartmentsArenasCells(JSRuntime *rt, void *data,
/*
* Invoke chunkCallback on every in-use chunk.
*/
extern JS_FRIEND_API(void)
extern void
IterateChunks(JSRuntime *rt, void *data, IterateChunkCallback chunkCallback);
/*
* Invoke cellCallback on every in-use object of the specified thing kind for
* the given compartment or for all compartments if it is null.
*/
extern JS_FRIEND_API(void)
extern void
IterateCells(JSRuntime *rt, JSCompartment *compartment, gc::AllocKind thingKind,
void *data, IterateCellCallback cellCallback);
/*
* Invoke cellCallback on every gray JS_OBJECT in the given compartment.
*/
extern JS_FRIEND_API(void)
IterateGrayObjects(JSCompartment *compartment, GCThingCallback *cellCallback, void *data);
} /* namespace js */
extern void
@ -1209,19 +1188,6 @@ MaybeVerifyBarriers(JSContext *cx, bool always = false)
} /* namespace gc */
static inline JSCompartment *
GetGCThingCompartment(void *thing)
{
JS_ASSERT(thing);
return reinterpret_cast<gc::Cell *>(thing)->compartment();
}
static inline JSCompartment *
GetObjectCompartment(JSObject *obj)
{
return GetGCThingCompartment(obj);
}
void
PurgeJITCaches(JSCompartment *c);

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

@ -24,7 +24,6 @@
#include "nsJSUtils.h"
#include "mozJSComponentLoader.h"
#include "nsContentUtils.h"
#include "jsgc.h"
#include "jsfriendapi.h"
#include "AccessCheck.h"
#include "mozilla/dom/BindingUtils.h"

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

@ -312,7 +312,7 @@ static void
TraceJSObject(void *aScriptThing, const char *name, void *aClosure)
{
JS_CALL_TRACER(static_cast<JSTracer*>(aClosure), aScriptThing,
js_GetGCThingTraceKind(aScriptThing), name);
js::GCThingTraceKind(aScriptThing), name);
}
static PLDHashOperator
@ -359,7 +359,7 @@ CheckParticipatesInCycleCollection(void *aThing, const char *name, void *aClosur
if (closure->cycleCollectionEnabled)
return;
if (AddToCCKind(js_GetGCThingTraceKind(aThing)) &&
if (AddToCCKind(js::GCThingTraceKind(aThing)) &&
xpc_IsGrayGCThing(aThing))
{
closure->cycleCollectionEnabled = true;

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

@ -15,7 +15,6 @@
#include "nsBaseHashtable.h"
#include "nsHashKeys.h"
#include "jsfriendapi.h"
#include "jsgc.h"
#include "dom_quickstubs.h"
#include "nsNullPrincipal.h"
#include "nsIURI.h"
@ -574,7 +573,7 @@ nsXPConnect::GetParticipant()
JSBool
xpc_GCThingIsGrayCCThing(void *thing)
{
return AddToCCKind(js_GetGCThingTraceKind(thing)) &&
return AddToCCKind(js::GCThingTraceKind(thing)) &&
xpc_IsGrayGCThing(thing);
}
@ -623,7 +622,7 @@ UnmarkGrayChildren(JSTracer *trc, void **thingp, JSGCTraceKind kind)
if (!xpc_IsGrayGCThing(thing))
return;
static_cast<js::gc::Cell *>(thing)->unmark(js::gc::GRAY);
js::UnmarkGrayGCThing(thing);
/*
* Trace children of |thing|. If |thing| and its parent are both shapes, |thing| will
@ -661,7 +660,7 @@ xpc_UnmarkGrayGCThingRecursive(void *thing, JSGCTraceKind kind)
MOZ_ASSERT(kind != JSTRACE_SHAPE, "UnmarkGrayGCThingRecursive not intended for Shapes");
// Unmark.
static_cast<js::gc::Cell *>(thing)->unmark(js::gc::GRAY);
js::UnmarkGrayGCThing(thing);
// Trace children.
UnmarkGrayTracer trc;
@ -863,7 +862,7 @@ static void
TraverseGCThing(TraverseSelect ts, void *p, JSGCTraceKind traceKind,
nsCycleCollectionTraversalCallback &cb)
{
MOZ_ASSERT(traceKind == js_GetGCThingTraceKind(p));
MOZ_ASSERT(traceKind == js::GCThingTraceKind(p));
bool isMarkedGray = xpc_IsGrayGCThing(p);
if (ts == TRAVERSE_FULL)
@ -890,7 +889,7 @@ NS_METHOD
nsXPConnectParticipant::TraverseImpl(nsXPConnectParticipant *that, void *p,
nsCycleCollectionTraversalCallback &cb)
{
TraverseGCThing(TRAVERSE_FULL, p, js_GetGCThingTraceKind(p), cb);
TraverseGCThing(TRAVERSE_FULL, p, js::GCThingTraceKind(p), cb);
return NS_OK;
}
@ -2409,7 +2408,7 @@ static void
NoteJSChildGrayWrapperShim(void *data, void *thing)
{
TraversalTracer *trc = static_cast<TraversalTracer*>(data);
NoteJSChild(trc, thing, js_GetGCThingTraceKind(thing));
NoteJSChild(trc, thing, js::GCThingTraceKind(thing));
}
static void
@ -2418,7 +2417,7 @@ TraverseObjectShim(void *data, void *thing)
nsCycleCollectionTraversalCallback *cb =
static_cast<nsCycleCollectionTraversalCallback*>(data);
MOZ_ASSERT(js_GetGCThingTraceKind(thing) == JSTRACE_OBJECT);
MOZ_ASSERT(js::GCThingTraceKind(thing) == JSTRACE_OBJECT);
TraverseGCThing(TRAVERSE_CPP, thing, JSTRACE_OBJECT, *cb);
}

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

@ -102,7 +102,7 @@
#include "prprf.h"
#include "jsdbgapi.h"
#include "jsfriendapi.h"
#include "jsgc.h"
#include "js/HeapAPI.h"
#include "jswrapper.h"
#include "nscore.h"
#include "nsXPCOM.h"
@ -135,6 +135,7 @@
#include "prlong.h"
#include "prenv.h"
#include "prclist.h"
#include "prcvar.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsXPIDLString.h"

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

@ -12,9 +12,9 @@
#include "js/MemoryMetrics.h"
#include "jsclass.h"
#include "jsfriendapi.h"
#include "jsgc.h"
#include "jspubtd.h"
#include "jsproxy.h"
#include "js/HeapAPI.h"
#include "nsISupports.h"
#include "nsIPrincipal.h"

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

@ -8,7 +8,6 @@
#include "nsIJSContextStack.h"
#include "nsThreadUtils.h"
#include "jsapi.h"
#include "jsgc.h"
#include "jsfriendapi.h"
#include "jsdbgapi.h"
#include "mozilla/ModuleUtils.h"