本文整理汇总了C++中mozilla::PodArrayZero方法的典型用法代码示例。如果您正苦于以下问题:C++ mozilla::PodArrayZero方法的具体用法?C++ mozilla::PodArrayZero怎么用?C++ mozilla::PodArrayZero使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozilla
的用法示例。
在下文中一共展示了mozilla::PodArrayZero方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runtime
Statistics::Statistics(JSRuntime *rt)
: runtime(rt),
startupTime(PRMJ_Now()),
fp(nullptr),
fullFormat(false),
gcDepth(0),
collectedCount(0),
zoneCount(0),
compartmentCount(0),
nonincrementalReason(nullptr),
preBytes(0),
phaseNestingDepth(0)
{
PodArrayZero(phaseTotals);
PodArrayZero(counts);
char *env = getenv("MOZ_GCTIMER");
if (!env || strcmp(env, "none") == 0) {
fp = nullptr;
return;
}
if (strcmp(env, "stdout") == 0) {
fullFormat = false;
fp = stdout;
} else if (strcmp(env, "stderr") == 0) {
fullFormat = false;
fp = stderr;
} else {
fullFormat = true;
fp = fopen(env, "a");
JS_ASSERT(fp);
}
}
示例2: PodArrayZero
PerThreadDataFriendFields::PerThreadDataFriendFields()
{
PodArrayZero(nativeStackLimit);
#if JS_STACK_GROWTH_DIRECTION > 0
for (int i=0; i<StackKindCount; i++)
nativeStackLimit[i] = UINTPTR_MAX;
#endif
PodArrayZero(thingGCRooters);
}
示例3: PodArrayZero
PerThreadDataFriendFields::PerThreadDataFriendFields()
{
PodArrayZero(nativeStackLimit);
#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING)
PodArrayZero(thingGCRooters);
#endif
#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
skipGCRooters = nullptr;
#endif
}
示例4: PodArrayZero
void
Statistics::beginGC()
{
PodArrayZero(phaseStartTimes);
PodArrayZero(phaseTimes);
slices.clearAndFree();
sccTimes.clearAndFree();
nonincrementalReason = nullptr;
preBytes = runtime->gc.usage.gcBytes();
}
示例5: runtime
Statistics::Statistics(JSRuntime* rt)
: runtime(rt),
startupTime(PRMJ_Now()),
fp(nullptr),
gcDepth(0),
nonincrementalReason_(gc::AbortReason::None),
timedGCStart(0),
preBytes(0),
maxPauseInInterval(0),
phaseNestingDepth(0),
activeDagSlot(PHASE_DAG_NONE),
suspended(0),
sliceCallback(nullptr),
nurseryCollectionCallback(nullptr),
aborted(false),
enableProfiling_(false),
sliceCount_(0)
{
PodArrayZero(phaseTotals);
PodArrayZero(counts);
PodArrayZero(phaseStartTimes);
for (auto d : MakeRange(NumTimingArrays))
PodArrayZero(phaseTimes[d]);
const char* env = getenv("MOZ_GCTIMER");
if (env) {
if (strcmp(env, "none") == 0) {
fp = nullptr;
} else if (strcmp(env, "stdout") == 0) {
fp = stdout;
} else if (strcmp(env, "stderr") == 0) {
fp = stderr;
} else {
fp = fopen(env, "a");
if (!fp)
MOZ_CRASH("Failed to open MOZ_GCTIMER log file.");
}
}
env = getenv("JS_GC_PROFILE");
if (env) {
if (0 == strcmp(env, "help")) {
fprintf(stderr, "JS_GC_PROFILE=N\n"
"\tReport major GC's taking more than N milliseconds.\n");
exit(0);
}
enableProfiling_ = true;
profileThreshold_ = atoi(env);
}
PodZero(&totalTimes_);
}
示例6: t
void
Statistics::endSlice()
{
slices.back().end = PRMJ_Now();
slices.back().endFaults = gc::GetPageFaultCount();
if (JSAccumulateTelemetryDataCallback cb = runtime->telemetryCallback) {
(*cb)(JS_TELEMETRY_GC_SLICE_MS, t(slices.back().end - slices.back().start));
(*cb)(JS_TELEMETRY_GC_RESET, !!slices.back().resetReason);
}
bool last = runtime->gcIncrementalState == gc::NO_INCREMENTAL;
if (last)
endGC();
// Slice callbacks should only fire for the outermost level
if (--gcDepth == 0) {
bool wasFullGC = collectedCount == zoneCount;
if (JS::GCSliceCallback cb = runtime->gcSliceCallback)
(*cb)(runtime, last ? JS::GC_CYCLE_END : JS::GC_SLICE_END,
JS::GCDescription(!wasFullGC));
}
/* Do this after the slice callback since it uses these values. */
if (last)
PodArrayZero(counts);
}
示例7: PodArrayZero
void
JS_BasicStatsAccum(JSBasicStats *bs, uint32_t val)
{
unsigned oldscale, newscale, bin;
double mean;
++bs->num;
if (bs->max < val)
bs->max = val;
bs->sum += val;
bs->sqsum += (double)val * val;
oldscale = bs->logscale;
if (oldscale != 10) {
mean = bs->sum / bs->num;
if (bs->max > 16 && mean > 8) {
newscale = (bs->max > 1e6 && mean > 1000) ? 10 : 2;
if (newscale != oldscale) {
uint32_t newhist[11], newbin;
PodArrayZero(newhist);
for (bin = 0; bin <= 10; bin++) {
newbin = ValToBin(newscale, BinToVal(oldscale, bin));
newhist[newbin] += bs->hist[bin];
}
js_memcpy(bs->hist, newhist, sizeof bs->hist);
bs->logscale = newscale;
}
}
}
bin = ValToBin(bs->logscale, val);
++bs->hist[bin];
}
示例8: GetPageFaultCount
void
Statistics::endSlice()
{
slices.back().end = PRMJ_Now();
slices.back().endFaults = GetPageFaultCount();
runtime->addTelemetry(JS_TELEMETRY_GC_SLICE_MS, t(slices.back().end - slices.back().start));
runtime->addTelemetry(JS_TELEMETRY_GC_RESET, !!slices.back().resetReason);
bool last = runtime->gc.state() == gc::NO_INCREMENTAL;
if (last)
endGC();
// Slice callbacks should only fire for the outermost level
if (--gcDepth == 0) {
bool wasFullGC = zoneStats.isCollectingAllZones();
if (sliceCallback)
(*sliceCallback)(runtime, last ? JS::GC_CYCLE_END : JS::GC_SLICE_END,
JS::GCDescription(!wasFullGC));
}
/* Do this after the slice callback since it uses these values. */
if (last)
PodArrayZero(counts);
}
示例9: ParallelSpewer
ParallelSpewer()
: depth(0)
{
const char *env;
PodArrayZero(active);
env = getenv("PAFLAGS");
if (env) {
if (strstr(env, "ops"))
active[SpewOps] = true;
if (strstr(env, "compile"))
active[SpewCompile] = true;
if (strstr(env, "bailouts"))
active[SpewBailouts] = true;
if (strstr(env, "full")) {
for (uint32_t i = 0; i < NumSpewChannels; i++)
active[i] = true;
}
}
env = getenv("TERM");
if (env) {
if (strcmp(env, "xterm-color") == 0 || strcmp(env, "xterm-256color") == 0)
colorable = true;
}
}
示例10: isSelfHosting
JSCompartment::JSCompartment(Zone* zone, const JS::CompartmentOptions& options = JS::CompartmentOptions())
: creationOptions_(options.creationOptions()),
behaviors_(options.behaviors()),
zone_(zone),
runtime_(zone->runtimeFromAnyThread()),
principals_(nullptr),
isSystem_(false),
isAtomsCompartment_(false),
isSelfHosting(false),
marked(true),
warnedAboutExprClosure(false),
warnedAboutStringGenericsMethods(0),
#ifdef DEBUG
firedOnNewGlobalObject(false),
#endif
global_(nullptr),
enterCompartmentDepth(0),
globalHolds(0),
performanceMonitoring(runtime_),
data(nullptr),
realmData(nullptr),
allocationMetadataBuilder(nullptr),
lastAnimationTime(0),
regExps(),
arraySpeciesLookup(),
globalWriteBarriered(0),
detachedTypedObjects(0),
objectMetadataState(ImmediateMetadata()),
selfHostingScriptSource(nullptr),
objectMetadataTable(nullptr),
innerViews(zone),
lazyArrayBuffers(nullptr),
wasm(zone),
nonSyntacticLexicalEnvironments_(nullptr),
gcIncomingGrayPointers(nullptr),
debugModeBits(0),
validAccessPtr(nullptr),
randomKeyGenerator_(runtime_->forkRandomKeyGenerator()),
scriptCountsMap(nullptr),
scriptNameMap(nullptr),
debugScriptMap(nullptr),
debugEnvs(nullptr),
enumerators(nullptr),
compartmentStats_(nullptr),
scheduledForDestruction(false),
maybeAlive(true),
jitCompartment_(nullptr),
mappedArgumentsTemplate_(nullptr),
unmappedArgumentsTemplate_(nullptr),
iterResultTemplate_(nullptr),
lcovOutput()
{
PodArrayZero(sawDeprecatedLanguageExtension);
runtime_->numCompartments++;
MOZ_ASSERT_IF(creationOptions_.mergeable(),
creationOptions_.invisibleToDebugger());
}
示例11: PodArrayZero
js::ContextFriendFields::ContextFriendFields(bool isJSContext)
: JS::RootingContext(isJSContext),
compartment_(nullptr), zone_(nullptr)
{
PodArrayZero(nativeStackLimit);
#if JS_STACK_GROWTH_DIRECTION > 0
for (int i=0; i<StackKindCount; i++)
nativeStackLimit[i] = UINTPTR_MAX;
#endif
}
示例12: PodArrayZero
JS::RootingContext::RootingContext()
: autoGCRooters_(nullptr), compartment_(nullptr), zone_(nullptr)
{
for (auto& stackRootPtr : stackRoots_)
stackRootPtr = nullptr;
PodArrayZero(nativeStackLimit);
#if JS_STACK_GROWTH_DIRECTION > 0
for (int i=0; i<StackKindCount; i++)
nativeStackLimit[i] = UINTPTR_MAX;
#endif
}
示例13: isSelfHosting
JSCompartment::JSCompartment(Zone* zone, const JS::CompartmentOptions& options = JS::CompartmentOptions())
: creationOptions_(options.creationOptions()),
behaviors_(options.behaviors()),
zone_(zone),
runtime_(zone->runtimeFromMainThread()),
principals_(nullptr),
isSystem_(false),
isSelfHosting(false),
marked(true),
warnedAboutExprClosure(false),
#ifdef DEBUG
firedOnNewGlobalObject(false),
#endif
global_(nullptr),
enterCompartmentDepth(0),
performanceMonitoring(runtime_),
data(nullptr),
allocationMetadataBuilder(nullptr),
lastAnimationTime(0),
regExps(runtime_),
globalWriteBarriered(0),
detachedTypedObjects(0),
objectMetadataState(ImmediateMetadata()),
propertyTree(thisForCtor()),
baseShapes(zone, BaseShapeSet()),
initialShapes(zone, InitialShapeSet()),
selfHostingScriptSource(nullptr),
objectMetadataTable(nullptr),
lazyArrayBuffers(nullptr),
wasmInstances(zone, WasmInstanceObjectSet()),
nonSyntacticLexicalScopes_(nullptr),
gcIncomingGrayPointers(nullptr),
debugModeBits(0),
watchpointMap(nullptr),
scriptCountsMap(nullptr),
debugScriptMap(nullptr),
debugScopes(nullptr),
enumerators(nullptr),
compartmentStats_(nullptr),
scheduledForDestruction(false),
maybeAlive(true),
jitCompartment_(nullptr),
mappedArgumentsTemplate_(nullptr),
unmappedArgumentsTemplate_(nullptr),
lcovOutput()
{
PodArrayZero(sawDeprecatedLanguageExtension);
runtime_->numCompartments++;
MOZ_ASSERT_IF(creationOptions_.mergeable(),
creationOptions_.invisibleToDebugger());
}
示例14: runtime
Statistics::Statistics(JSRuntime *rt)
: runtime(rt),
startupTime(PRMJ_Now()),
fp(nullptr),
fullFormat(false),
gcDepth(0),
nonincrementalReason(nullptr),
timedGCStart(0),
preBytes(0),
maxPauseInInterval(0),
phaseNestingDepth(0),
suspendedPhaseNestingDepth(0),
sliceCallback(nullptr)
{
PodArrayZero(phaseTotals);
PodArrayZero(counts);
PodArrayZero(phaseStartTimes);
PodArrayZero(phaseTimes);
char *env = getenv("MOZ_GCTIMER");
if (!env || strcmp(env, "none") == 0) {
fp = nullptr;
return;
}
if (strcmp(env, "stdout") == 0) {
fullFormat = false;
fp = stdout;
} else if (strcmp(env, "stderr") == 0) {
fullFormat = false;
fp = stderr;
} else {
fullFormat = true;
fp = fopen(env, "a");
MOZ_ASSERT(fp);
}
}
示例15: isSelfHosting
JSCompartment::JSCompartment(Zone* zone, const JS::CompartmentOptions& options = JS::CompartmentOptions())
: options_(options),
zone_(zone),
runtime_(zone->runtimeFromMainThread()),
principals_(nullptr),
isSystem_(false),
isSelfHosting(false),
marked(true),
warnedAboutNoSuchMethod(false),
warnedAboutFlagsArgument(false),
addonId(options.addonIdOrNull()),
#ifdef DEBUG
firedOnNewGlobalObject(false),
#endif
global_(nullptr),
enterCompartmentDepth(0),
performanceMonitoring(runtime_),
data(nullptr),
objectMetadataCallback(nullptr),
lastAnimationTime(0),
regExps(runtime_),
globalWriteBarriered(false),
neuteredTypedObjects(0),
objectMetadataState(ImmediateMetadata()),
propertyTree(thisForCtor()),
selfHostingScriptSource(nullptr),
objectMetadataTable(nullptr),
lazyArrayBuffers(nullptr),
nonSyntacticLexicalScopes_(nullptr),
gcIncomingGrayPointers(nullptr),
gcPreserveJitCode(options.preserveJitCode()),
debugModeBits(0),
rngState(0),
watchpointMap(nullptr),
scriptCountsMap(nullptr),
debugScriptMap(nullptr),
debugScopes(nullptr),
enumerators(nullptr),
compartmentStats(nullptr),
scheduledForDestruction(false),
maybeAlive(true),
jitCompartment_(nullptr),
mappedArgumentsTemplate_(nullptr),
unmappedArgumentsTemplate_(nullptr),
lcovOutput()
{
PodArrayZero(sawDeprecatedLanguageExtension);
runtime_->numCompartments++;
MOZ_ASSERT_IF(options.mergeable(), options.invisibleToDebugger());
}