mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1452982 part 7 - Rename ZoneGroupData to ZoneData. r=jonco
This commit is contained in:
parent
0f38ba4351
commit
e269859a98
@ -222,7 +222,7 @@ class ArenaLists
|
|||||||
* GC we only move the head of the of the list of spans back to the arena
|
* GC we only move the head of the of the list of spans back to the arena
|
||||||
* only for the arena that was not fully allocated.
|
* only for the arena that was not fully allocated.
|
||||||
*/
|
*/
|
||||||
ZoneGroupData<AllAllocKindArray<FreeSpan*>> freeLists_;
|
ZoneData<AllAllocKindArray<FreeSpan*>> freeLists_;
|
||||||
AllAllocKindArray<FreeSpan*>& freeLists() { return freeLists_.ref(); }
|
AllAllocKindArray<FreeSpan*>& freeLists() { return freeLists_.ref(); }
|
||||||
const AllAllocKindArray<FreeSpan*>& freeLists() const { return freeLists_.ref(); }
|
const AllAllocKindArray<FreeSpan*>& freeLists() const { return freeLists_.ref(); }
|
||||||
|
|
||||||
@ -261,14 +261,14 @@ class ArenaLists
|
|||||||
|
|
||||||
// Arena lists which have yet to be swept, but need additional foreground
|
// Arena lists which have yet to be swept, but need additional foreground
|
||||||
// processing before they are swept.
|
// processing before they are swept.
|
||||||
ZoneGroupData<Arena*> gcShapeArenasToUpdate;
|
ZoneData<Arena*> gcShapeArenasToUpdate;
|
||||||
ZoneGroupData<Arena*> gcAccessorShapeArenasToUpdate;
|
ZoneData<Arena*> gcAccessorShapeArenasToUpdate;
|
||||||
ZoneGroupData<Arena*> gcScriptArenasToUpdate;
|
ZoneData<Arena*> gcScriptArenasToUpdate;
|
||||||
ZoneGroupData<Arena*> gcObjectGroupArenasToUpdate;
|
ZoneData<Arena*> gcObjectGroupArenasToUpdate;
|
||||||
|
|
||||||
// The list of empty arenas which are collected during sweep phase and released at the end of
|
// The list of empty arenas which are collected during sweep phase and released at the end of
|
||||||
// sweeping every sweep group.
|
// sweeping every sweep group.
|
||||||
ZoneGroupData<Arena*> savedEmptyArenas;
|
ZoneData<Arena*> savedEmptyArenas;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ArenaLists(JSRuntime* rt, JS::Zone* zone);
|
explicit ArenaLists(JSRuntime* rt, JS::Zone* zone);
|
||||||
|
@ -260,7 +260,7 @@ struct Zone : public JS::shadow::Zone,
|
|||||||
using DebuggerVector = js::Vector<js::Debugger*, 0, js::SystemAllocPolicy>;
|
using DebuggerVector = js::Vector<js::Debugger*, 0, js::SystemAllocPolicy>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
js::ZoneGroupData<DebuggerVector*> debuggers;
|
js::ZoneData<DebuggerVector*> debuggers;
|
||||||
|
|
||||||
js::jit::JitZone* createJitZone(JSContext* cx);
|
js::jit::JitZone* createJitZone(JSContext* cx);
|
||||||
|
|
||||||
@ -291,7 +291,7 @@ struct Zone : public JS::shadow::Zone,
|
|||||||
* is silly
|
* is silly
|
||||||
* And so on.
|
* And so on.
|
||||||
*/
|
*/
|
||||||
js::ZoneGroupData<bool> suppressAllocationMetadataBuilder;
|
js::ZoneData<bool> suppressAllocationMetadataBuilder;
|
||||||
|
|
||||||
js::gc::ArenaLists arenas;
|
js::gc::ArenaLists arenas;
|
||||||
|
|
||||||
@ -365,7 +365,7 @@ struct Zone : public JS::shadow::Zone,
|
|||||||
js::MovableCellHasher<JSObject*>,
|
js::MovableCellHasher<JSObject*>,
|
||||||
js::SystemAllocPolicy>;
|
js::SystemAllocPolicy>;
|
||||||
private:
|
private:
|
||||||
js::ZoneGroupData<JS::WeakCache<TypeDescrObjectSet>> typeDescrObjects_;
|
js::ZoneData<JS::WeakCache<TypeDescrObjectSet>> typeDescrObjects_;
|
||||||
|
|
||||||
// Malloc counter to measure memory pressure for GC scheduling. This
|
// Malloc counter to measure memory pressure for GC scheduling. This
|
||||||
// counter should be used only when it's not possible to know the size of
|
// counter should be used only when it's not possible to know the size of
|
||||||
@ -470,18 +470,18 @@ struct Zone : public JS::shadow::Zone,
|
|||||||
// the current GC.
|
// the current GC.
|
||||||
js::UnprotectedData<size_t> gcDelayBytes;
|
js::UnprotectedData<size_t> gcDelayBytes;
|
||||||
|
|
||||||
js::ZoneGroupData<uint32_t> tenuredStrings;
|
js::ZoneData<uint32_t> tenuredStrings;
|
||||||
js::ZoneGroupData<bool> allocNurseryStrings;
|
js::ZoneData<bool> allocNurseryStrings;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Shared Shape property tree.
|
// Shared Shape property tree.
|
||||||
js::ZoneGroupData<js::PropertyTree> propertyTree_;
|
js::ZoneData<js::PropertyTree> propertyTree_;
|
||||||
public:
|
public:
|
||||||
js::PropertyTree& propertyTree() { return propertyTree_.ref(); }
|
js::PropertyTree& propertyTree() { return propertyTree_.ref(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Set of all unowned base shapes in the Zone.
|
// Set of all unowned base shapes in the Zone.
|
||||||
js::ZoneGroupData<js::BaseShapeSet> baseShapes_;
|
js::ZoneData<js::BaseShapeSet> baseShapes_;
|
||||||
public:
|
public:
|
||||||
js::BaseShapeSet& baseShapes() { return baseShapes_.ref(); }
|
js::BaseShapeSet& baseShapes() { return baseShapes_.ref(); }
|
||||||
|
|
||||||
@ -490,14 +490,14 @@ struct Zone : public JS::shadow::Zone,
|
|||||||
// those of various builtin classes -- there are two entries: one for a
|
// those of various builtin classes -- there are two entries: one for a
|
||||||
// lookup via TaggedProto, and one for a lookup via JSProtoKey. See
|
// lookup via TaggedProto, and one for a lookup via JSProtoKey. See
|
||||||
// InitialShapeProto.
|
// InitialShapeProto.
|
||||||
js::ZoneGroupData<js::InitialShapeSet> initialShapes_;
|
js::ZoneData<js::InitialShapeSet> initialShapes_;
|
||||||
public:
|
public:
|
||||||
js::InitialShapeSet& initialShapes() { return initialShapes_.ref(); }
|
js::InitialShapeSet& initialShapes() { return initialShapes_.ref(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// List of shapes that may contain nursery pointers.
|
// List of shapes that may contain nursery pointers.
|
||||||
using NurseryShapeVector = js::Vector<js::AccessorShape*, 0, js::SystemAllocPolicy>;
|
using NurseryShapeVector = js::Vector<js::AccessorShape*, 0, js::SystemAllocPolicy>;
|
||||||
js::ZoneGroupData<NurseryShapeVector> nurseryShapes_;
|
js::ZoneData<NurseryShapeVector> nurseryShapes_;
|
||||||
public:
|
public:
|
||||||
NurseryShapeVector& nurseryShapes() { return nurseryShapes_.ref(); }
|
NurseryShapeVector& nurseryShapes() { return nurseryShapes_.ref(); }
|
||||||
|
|
||||||
@ -509,9 +509,9 @@ struct Zone : public JS::shadow::Zone,
|
|||||||
void fixupAfterMovingGC();
|
void fixupAfterMovingGC();
|
||||||
|
|
||||||
// Per-zone data for use by an embedder.
|
// Per-zone data for use by an embedder.
|
||||||
js::ZoneGroupData<void*> data;
|
js::ZoneData<void*> data;
|
||||||
|
|
||||||
js::ZoneGroupData<bool> isSystem;
|
js::ZoneData<bool> isSystem;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The helper thread context with exclusive access to this zone, if
|
// The helper thread context with exclusive access to this zone, if
|
||||||
@ -556,7 +556,7 @@ struct Zone : public JS::shadow::Zone,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
js::ZoneGroupData<unsigned> gcLastSweepGroupIndex;
|
js::ZoneData<unsigned> gcLastSweepGroupIndex;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static js::HashNumber UniqueIdToHash(uint64_t uid) {
|
static js::HashNumber UniqueIdToHash(uint64_t uid) {
|
||||||
@ -703,12 +703,12 @@ struct Zone : public JS::shadow::Zone,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
js::ZoneGroupData<js::jit::JitZone*> jitZone_;
|
js::ZoneData<js::jit::JitZone*> jitZone_;
|
||||||
|
|
||||||
js::ActiveThreadData<bool> gcScheduled_;
|
js::ActiveThreadData<bool> gcScheduled_;
|
||||||
js::ActiveThreadData<bool> gcScheduledSaved_;
|
js::ActiveThreadData<bool> gcScheduledSaved_;
|
||||||
js::ZoneGroupData<bool> gcPreserveCode_;
|
js::ZoneData<bool> gcPreserveCode_;
|
||||||
js::ZoneGroupData<bool> keepShapeTables_;
|
js::ZoneData<bool> keepShapeTables_;
|
||||||
|
|
||||||
// Allow zones to be linked into a list
|
// Allow zones to be linked into a list
|
||||||
friend class js::gc::ZoneList;
|
friend class js::gc::ZoneList;
|
||||||
|
@ -39,7 +39,7 @@ CheckThreadLocal::check() const
|
|||||||
JSContext* cx = TlsContext.get();
|
JSContext* cx = TlsContext.get();
|
||||||
MOZ_ASSERT(cx);
|
MOZ_ASSERT(cx);
|
||||||
|
|
||||||
// As for CheckZoneGroup, in a cooperatively scheduled runtime the active
|
// As for CheckZone, in a cooperatively scheduled runtime the active
|
||||||
// thread is permitted access to thread local state for other suspended
|
// thread is permitted access to thread local state for other suspended
|
||||||
// threads in the same runtime.
|
// threads in the same runtime.
|
||||||
if (cx->isCooperativelyScheduled())
|
if (cx->isCooperativelyScheduled())
|
||||||
@ -65,7 +65,7 @@ template class CheckActiveThread<AllowedHelperThread::IonCompile>;
|
|||||||
|
|
||||||
template <AllowedHelperThread Helper>
|
template <AllowedHelperThread Helper>
|
||||||
void
|
void
|
||||||
CheckZoneGroup<Helper>::check() const
|
CheckZone<Helper>::check() const
|
||||||
{
|
{
|
||||||
if (OnHelperThread<Helper>())
|
if (OnHelperThread<Helper>())
|
||||||
return;
|
return;
|
||||||
@ -84,10 +84,10 @@ CheckZoneGroup<Helper>::check() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template class CheckZoneGroup<AllowedHelperThread::None>;
|
template class CheckZone<AllowedHelperThread::None>;
|
||||||
template class CheckZoneGroup<AllowedHelperThread::GCTask>;
|
template class CheckZone<AllowedHelperThread::GCTask>;
|
||||||
template class CheckZoneGroup<AllowedHelperThread::IonCompile>;
|
template class CheckZone<AllowedHelperThread::IonCompile>;
|
||||||
template class CheckZoneGroup<AllowedHelperThread::GCTaskOrIonCompile>;
|
template class CheckZone<AllowedHelperThread::GCTaskOrIonCompile>;
|
||||||
|
|
||||||
template <GlobalLock Lock, AllowedHelperThread Helper>
|
template <GlobalLock Lock, AllowedHelperThread Helper>
|
||||||
void
|
void
|
||||||
|
@ -224,17 +224,17 @@ using ActiveThreadOrIonCompileData =
|
|||||||
ProtectedDataNoCheckArgs<CheckActiveThread<AllowedHelperThread::IonCompile>, T>;
|
ProtectedDataNoCheckArgs<CheckActiveThread<AllowedHelperThread::IonCompile>, T>;
|
||||||
|
|
||||||
template <AllowedHelperThread Helper>
|
template <AllowedHelperThread Helper>
|
||||||
class CheckZoneGroup
|
class CheckZone
|
||||||
{
|
{
|
||||||
#ifdef JS_HAS_PROTECTED_DATA_CHECKS
|
#ifdef JS_HAS_PROTECTED_DATA_CHECKS
|
||||||
JS::Zone* zone;
|
JS::Zone* zone;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CheckZoneGroup(JS::Zone* zone) : zone(zone) {}
|
explicit CheckZone(JS::Zone* zone) : zone(zone) {}
|
||||||
void check() const;
|
void check() const;
|
||||||
#else
|
#else
|
||||||
public:
|
public:
|
||||||
explicit CheckZoneGroup(JS::Zone* zone) {}
|
explicit CheckZone(JS::Zone* zone) {}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -242,20 +242,20 @@ class CheckZoneGroup
|
|||||||
// associated zone group, or by the runtime's cooperatively scheduled
|
// associated zone group, or by the runtime's cooperatively scheduled
|
||||||
// active thread for zone groups which are not in use by a helper thread.
|
// active thread for zone groups which are not in use by a helper thread.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using ZoneGroupData =
|
using ZoneData =
|
||||||
ProtectedDataZoneGroupArg<CheckZoneGroup<AllowedHelperThread::None>, T>;
|
ProtectedDataZoneGroupArg<CheckZone<AllowedHelperThread::None>, T>;
|
||||||
|
|
||||||
// Data which may only be accessed by threads with exclusive access to the
|
// Data which may only be accessed by threads with exclusive access to the
|
||||||
// associated zone group, or by various helper thread tasks.
|
// associated zone group, or by various helper thread tasks.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using ZoneGroupOrGCTaskData =
|
using ZoneGroupOrGCTaskData =
|
||||||
ProtectedDataZoneGroupArg<CheckZoneGroup<AllowedHelperThread::GCTask>, T>;
|
ProtectedDataZoneGroupArg<CheckZone<AllowedHelperThread::GCTask>, T>;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using ZoneGroupOrIonCompileData =
|
using ZoneGroupOrIonCompileData =
|
||||||
ProtectedDataZoneGroupArg<CheckZoneGroup<AllowedHelperThread::IonCompile>, T>;
|
ProtectedDataZoneGroupArg<CheckZone<AllowedHelperThread::IonCompile>, T>;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using ZoneGroupOrGCTaskOrIonCompileData =
|
using ZoneGroupOrGCTaskOrIonCompileData =
|
||||||
ProtectedDataZoneGroupArg<CheckZoneGroup<AllowedHelperThread::GCTaskOrIonCompile>, T>;
|
ProtectedDataZoneGroupArg<CheckZone<AllowedHelperThread::GCTaskOrIonCompile>, T>;
|
||||||
|
|
||||||
// Runtime wide locks which might protect some data.
|
// Runtime wide locks which might protect some data.
|
||||||
enum class GlobalLock
|
enum class GlobalLock
|
||||||
|
@ -1338,10 +1338,10 @@ class TypeZone
|
|||||||
|
|
||||||
/* Pool for type information in this zone. */
|
/* Pool for type information in this zone. */
|
||||||
static const size_t TYPE_LIFO_ALLOC_PRIMARY_CHUNK_SIZE = 8 * 1024;
|
static const size_t TYPE_LIFO_ALLOC_PRIMARY_CHUNK_SIZE = 8 * 1024;
|
||||||
ZoneGroupData<LifoAlloc> typeLifoAlloc_;
|
ZoneData<LifoAlloc> typeLifoAlloc_;
|
||||||
|
|
||||||
// Under CodeGenerator::link, the id of the current compilation.
|
// Under CodeGenerator::link, the id of the current compilation.
|
||||||
ZoneGroupData<mozilla::Maybe<IonCompilationId>> currentCompilationId_;
|
ZoneData<mozilla::Maybe<IonCompilationId>> currentCompilationId_;
|
||||||
|
|
||||||
TypeZone(const TypeZone&) = delete;
|
TypeZone(const TypeZone&) = delete;
|
||||||
void operator=(const TypeZone&) = delete;
|
void operator=(const TypeZone&) = delete;
|
||||||
@ -1352,18 +1352,18 @@ class TypeZone
|
|||||||
|
|
||||||
// During incremental sweeping, allocator holding the old type information
|
// During incremental sweeping, allocator holding the old type information
|
||||||
// for the zone.
|
// for the zone.
|
||||||
ZoneGroupData<LifoAlloc> sweepTypeLifoAlloc;
|
ZoneData<LifoAlloc> sweepTypeLifoAlloc;
|
||||||
|
|
||||||
// During incremental sweeping, whether to try to destroy all type
|
// During incremental sweeping, whether to try to destroy all type
|
||||||
// information attached to scripts.
|
// information attached to scripts.
|
||||||
ZoneGroupData<bool> sweepReleaseTypes;
|
ZoneData<bool> sweepReleaseTypes;
|
||||||
|
|
||||||
ZoneGroupData<bool> sweepingTypes;
|
ZoneData<bool> sweepingTypes;
|
||||||
|
|
||||||
ZoneGroupData<bool> keepTypeScripts;
|
ZoneData<bool> keepTypeScripts;
|
||||||
|
|
||||||
// The topmost AutoEnterAnalysis on the stack, if there is one.
|
// The topmost AutoEnterAnalysis on the stack, if there is one.
|
||||||
ZoneGroupData<AutoEnterAnalysis*> activeAnalysis;
|
ZoneData<AutoEnterAnalysis*> activeAnalysis;
|
||||||
|
|
||||||
explicit TypeZone(JS::Zone* zone);
|
explicit TypeZone(JS::Zone* zone);
|
||||||
~TypeZone();
|
~TypeZone();
|
||||||
|
Loading…
Reference in New Issue
Block a user