зеркало из https://github.com/mozilla/gecko-dev.git
Bug 706885 - Add a pointer to the JSRuntime on the gc::Chunk; r=billm
--HG-- extra : rebase_source : f6ac0b0db7791b365d0e63f6fea2e5f451964453
This commit is contained in:
Родитель
101db76fad
Коммит
e64877f8f7
|
@ -41,7 +41,7 @@ const size_t CellSize = size_t(1) << CellShift;
|
|||
const size_t CellMask = CellSize - 1;
|
||||
|
||||
/* These are magic constants derived from actual offsets in gc/Heap.h. */
|
||||
const size_t ChunkMarkBitmapOffset = 1032376;
|
||||
const size_t ChunkMarkBitmapOffset = 1032368;
|
||||
const size_t ChunkMarkBitmapBits = 129024;
|
||||
|
||||
/*
|
||||
|
|
|
@ -85,6 +85,7 @@ struct Cell
|
|||
MOZ_ALWAYS_INLINE bool markIfUnmarked(uint32_t color = BLACK) const;
|
||||
MOZ_ALWAYS_INLINE void unmark(uint32_t color) const;
|
||||
|
||||
inline JSRuntime *runtime() const;
|
||||
inline JSCompartment *compartment() const;
|
||||
inline Zone *zone() const;
|
||||
|
||||
|
@ -593,7 +594,7 @@ struct ChunkInfo
|
|||
* Calculating sizes and offsets is simpler if sizeof(ChunkInfo) is
|
||||
* architecture-independent.
|
||||
*/
|
||||
char padding[12];
|
||||
char padding[16];
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -611,6 +612,9 @@ struct ChunkInfo
|
|||
|
||||
/* Number of GC cycles this chunk has survived. */
|
||||
uint32_t age;
|
||||
|
||||
/* This is findable from any address in the Chunk by aligning to 1MiB. */
|
||||
JSRuntime *runtime;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -947,6 +951,12 @@ Cell::chunk() const
|
|||
return reinterpret_cast<Chunk *>(addr);
|
||||
}
|
||||
|
||||
inline JSRuntime *
|
||||
Cell::runtime() const
|
||||
{
|
||||
return chunk()->info.runtime;
|
||||
}
|
||||
|
||||
AllocKind
|
||||
Cell::getAllocKind() const
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче