/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
class JSDependentString; class JSExternalString; class JSFatInlineString; class JSLinearString; class JSRope; class JSThinInlineString;
namespace js {
class CompactPropMap; class FatInlineAtom; class ThinInlineAtom; class NormalAtom; class NormalPropMap; class DictionaryPropMap; class DictionaryShape; class SharedShape; class ProxyShape; class WasmGCShape;
namespace gc {
// The GC allocation kinds. // // These are defined by macros which enumerate the different allocation kinds // and supply the following information: // // - the corresponding AllocKind // - their JS::TraceKind // - their C++ base type // - a C++ type of the correct size // - their FinalizeKind (see above) // - whether they can be allocated in the nursery (this is true for foreground // finalized objects but these will can only actually be allocated in the // nursery if JSCLASS_SKIP_NURSERY_FINALIZE is set) // - whether they can be compacted
FIRST = 0,
OBJECT_FIRST = FUNCTION, // Hardcoded to first object kind. // clang-format on
}; #undef DEFINE_ALLOC_KIND
static_assert(int(AllocKind::FIRST) == 0, "Various places depend on AllocKind starting at 0");
static_assert(int(AllocKind::OBJECT_FIRST) == 0, "OBJECT_FIRST must be defined as the first object kind");
// Returns a sequence for use in a range-based for loop, // to iterate over all alloc kinds.
constexpr auto AllAllocKinds() { return mozilla::MakeEnumeratedRange(AllocKind::FIRST, AllocKind::LIMIT);
}
// Returns a sequence for use in a range-based for loop, // to iterate over all object alloc kinds.
constexpr auto ObjectAllocKinds() { return mozilla::MakeEnumeratedRange(AllocKind::OBJECT_FIRST,
AllocKind::OBJECT_LIMIT);
}
// Returns a sequence for use in a range-based for loop, // to iterate over alloc kinds from |first| to |limit|, exclusive.
constexpr auto SomeAllocKinds(AllocKind first = AllocKind::FIRST,
AllocKind limit = AllocKind::LIMIT) {
MOZ_ASSERT(IsAllocKind(first), "|first| is not a valid AllocKind!");
MOZ_ASSERT(IsAllocKind(limit), "|limit| is not a valid AllocKind!"); return mozilla::MakeEnumeratedRange(first, limit);
}
// AllAllocKindArray<ValueType> gives an enumerated array of ValueTypes, // with each index corresponding to a particular alloc kind. template <typename ValueType> using AllAllocKindArray =
mozilla::EnumeratedArray<AllocKind, ValueType, size_t(AllocKind::LIMIT)>;
// ObjectAllocKindArray<ValueType> gives an enumerated array of ValueTypes, // with each index corresponding to a particular object alloc kind. template <typename ValueType> using ObjectAllocKindArray =
mozilla::EnumeratedArray<AllocKind, ValueType,
size_t(AllocKind::OBJECT_LIMIT)>;
// Arenas containing cells of kind FinalizeKind::None and // FinalizeKind::Background are swept on a background thread.
constexpr bool IsBackgroundSwept(AllocKind kind) { return !IsForegroundFinalized(kind);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.