зеркало из https://github.com/mozilla/gecko-dev.git
Bug 692267 - Remove js/src/gc/Heap.h from INSTALLED_HEADERS (r=terrence)
This commit is contained in:
Родитель
a6cd2f8c4f
Коммит
d44fdd4f00
|
@ -7,15 +7,62 @@
|
|||
#ifndef js_heap_api_h___
|
||||
#define js_heap_api_h___
|
||||
|
||||
#include "gc/Heap.h"
|
||||
|
||||
/* These values are private to the JS engine. */
|
||||
namespace js {
|
||||
namespace gc {
|
||||
|
||||
/*
|
||||
* Page size must be static to support our arena pointer optimizations, so we
|
||||
* are forced to support each platform with non-4096 pages as a special case.
|
||||
* Note: The freelist supports a maximum arena shift of 15.
|
||||
* Note: Do not use JS_CPU_SPARC here, this header is used outside JS.
|
||||
*/
|
||||
#if (defined(SOLARIS) || defined(__FreeBSD__)) && \
|
||||
(defined(__sparc) || defined(__sparcv9) || defined(__ia64))
|
||||
const size_t PageShift = 13;
|
||||
const size_t ArenaShift = PageShift;
|
||||
#elif defined(__powerpc__)
|
||||
const size_t PageShift = 16;
|
||||
const size_t ArenaShift = 12;
|
||||
#else
|
||||
const size_t PageShift = 12;
|
||||
const size_t ArenaShift = PageShift;
|
||||
#endif
|
||||
const size_t PageSize = size_t(1) << PageShift;
|
||||
const size_t ArenaSize = size_t(1) << ArenaShift;
|
||||
const size_t ArenaMask = ArenaSize - 1;
|
||||
|
||||
const size_t ChunkShift = 20;
|
||||
const size_t ChunkSize = size_t(1) << ChunkShift;
|
||||
const size_t ChunkMask = ChunkSize - 1;
|
||||
|
||||
} /* namespace gc */
|
||||
} /* namespace js */
|
||||
|
||||
namespace JS {
|
||||
|
||||
namespace shadow {
|
||||
|
||||
struct ArenaHeader
|
||||
{
|
||||
JSCompartment *compartment;
|
||||
};
|
||||
|
||||
} /* namespace shadow */
|
||||
|
||||
static inline shadow::ArenaHeader *
|
||||
GetGCThingArena(void *thing)
|
||||
{
|
||||
uintptr_t addr = uintptr_t(thing);
|
||||
addr &= ~js::gc::ArenaMask;
|
||||
return reinterpret_cast<shadow::ArenaHeader *>(addr);
|
||||
}
|
||||
|
||||
static inline JSCompartment *
|
||||
GetGCThingCompartment(void *thing)
|
||||
{
|
||||
JS_ASSERT(thing);
|
||||
return reinterpret_cast<gc::Cell *>(thing)->compartment();
|
||||
return GetGCThingArena(thing)->compartment;
|
||||
}
|
||||
|
||||
static inline JSCompartment *
|
||||
|
@ -24,6 +71,6 @@ GetObjectCompartment(JSObject *obj)
|
|||
return GetGCThingCompartment(obj);
|
||||
}
|
||||
|
||||
} /* namespace js */
|
||||
} /* namespace JS */
|
||||
|
||||
#endif /* js_heap_api_h___ */
|
||||
|
|
|
@ -186,7 +186,6 @@ EXPORTS_ds = \
|
|||
$(NULL)
|
||||
|
||||
EXPORTS_gc = \
|
||||
Heap.h \
|
||||
Root.h \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "jsutil.h"
|
||||
|
||||
#include "ds/BitArray.h"
|
||||
#include "js/HeapAPI.h"
|
||||
|
||||
struct JSCompartment;
|
||||
|
||||
|
@ -103,33 +104,6 @@ struct Cell
|
|||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* Page size must be static to support our arena pointer optimizations, so we
|
||||
* are forced to support each platform with non-4096 pages as a special case.
|
||||
* Note: The freelist supports a maximum arena shift of 15.
|
||||
* Note: Do not use JS_CPU_SPARC here, this header is used outside JS.
|
||||
* Bug 692267: Move page size definition to gc/Memory.h and include it
|
||||
* directly once jsgc.h is no longer an installed header.
|
||||
*/
|
||||
#if (defined(SOLARIS) || defined(__FreeBSD__)) && \
|
||||
(defined(__sparc) || defined(__sparcv9) || defined(__ia64))
|
||||
const size_t PageShift = 13;
|
||||
const size_t ArenaShift = PageShift;
|
||||
#elif defined(__powerpc__)
|
||||
const size_t PageShift = 16;
|
||||
const size_t ArenaShift = 12;
|
||||
#else
|
||||
const size_t PageShift = 12;
|
||||
const size_t ArenaShift = PageShift;
|
||||
#endif
|
||||
const size_t PageSize = size_t(1) << PageShift;
|
||||
const size_t ArenaSize = size_t(1) << ArenaShift;
|
||||
const size_t ArenaMask = ArenaSize - 1;
|
||||
|
||||
const size_t ChunkShift = 20;
|
||||
const size_t ChunkSize = size_t(1) << ChunkShift;
|
||||
const size_t ChunkMask = ChunkSize - 1;
|
||||
|
||||
/*
|
||||
* This is the maximum number of arenas we allow in the FreeCommitted state
|
||||
* before we trigger a GC_SHRINK to release free arenas to the OS.
|
||||
|
@ -403,12 +377,10 @@ struct FreeSpan
|
|||
};
|
||||
|
||||
/* Every arena has a header. */
|
||||
struct ArenaHeader
|
||||
struct ArenaHeader : public JS::shadow::ArenaHeader
|
||||
{
|
||||
friend struct FreeLists;
|
||||
|
||||
JSCompartment *compartment;
|
||||
|
||||
/*
|
||||
* ArenaHeader::next has two purposes: when unallocated, it points to the
|
||||
* next available Arena's header. When allocated, it points to the next
|
||||
|
|
Загрузка…
Ссылка в новой задаче