Don't update GC malloc bytes for compiler heap allocations, bug 687127. r=gwagner

This commit is contained in:
Brian Hackett 2012-02-12 19:27:55 -08:00
Родитель 4413dcb2c7
Коммит 6245330e56
5 изменённых файлов: 14 добавлений и 14 удалений

Просмотреть файл

@ -604,7 +604,7 @@ check-malloc-function-usage: $(filter-out %jsalloc.h %jscntxt.h %jsutil.h, $(ALL
# We desire these numbers to go down, not up. See "User guide to memory
# management within SpiderMonkey" in jsutil.h.
$(srcdir)/config/check_source_count.py OffTheBooks:: 58 \
$(srcdir)/config/check_source_count.py OffTheBooks:: 71 \
"in Makefile.in" "{cx,rt}->{new_,array_new,malloc_,calloc_,realloc_}" $^
# This should go to zero, if possible.
$(srcdir)/config/check_source_count.py UnwantedForeground:: 31 \

Просмотреть файл

@ -410,7 +410,7 @@ mjit::Compiler::pushActiveFrame(JSScript *script, uint32_t argc)
if (cx->runtime->profilingScripts && !script->pcCounters)
script->initCounts(cx);
ActiveFrame *newa = cx->new_<ActiveFrame>(cx);
ActiveFrame *newa = OffTheBooks::new_<ActiveFrame>(cx);
if (!newa)
return Compile_Error;
@ -459,7 +459,7 @@ mjit::Compiler::pushActiveFrame(JSScript *script, uint32_t argc)
return Compile_Error;
}
newa->jumpMap = (Label *)cx->malloc_(sizeof(Label) * script->length);
newa->jumpMap = (Label *)OffTheBooks::malloc_(sizeof(Label) * script->length);
if (!newa->jumpMap) {
js_ReportOutOfMemory(cx);
return Compile_Error;
@ -618,7 +618,7 @@ mjit::Compiler::prepareInferenceTypes(JSScript *script, ActiveFrame *a)
*/
a->varTypes = (VarType *)
cx->calloc_(TotalSlots(script) * sizeof(VarType));
OffTheBooks::calloc_(TotalSlots(script) * sizeof(VarType));
if (!a->varTypes)
return Compile_Error;
@ -871,7 +871,7 @@ MakeJITScript(JSContext *cx, JSScript *script, bool construct)
size_t dataSize = sizeof(JITScript)
+ (chunks.length() * sizeof(ChunkDescriptor))
+ (edges.length() * sizeof(CrossChunkEdge));
uint8_t *cursor = (uint8_t *) cx->calloc_(dataSize);
uint8_t *cursor = (uint8_t *) OffTheBooks::calloc_(dataSize);
if (!cursor)
return NULL;
@ -1204,7 +1204,7 @@ mjit::Compiler::generatePrologue()
if (outerScript->pcCounters || Probes::wantNativeAddressInfo(cx)) {
size_t length = ssa.frameLength(ssa.numFrames() - 1);
pcLengths = (PCLengthEntry *) cx->calloc_(sizeof(pcLengths[0]) * length);
pcLengths = (PCLengthEntry *) OffTheBooks::calloc_(sizeof(pcLengths[0]) * length);
if (!pcLengths)
return Compile_Error;
}
@ -1352,7 +1352,7 @@ mjit::Compiler::finishThisUp()
#endif
0;
uint8_t *cursor = (uint8_t *)cx->calloc_(dataSize);
uint8_t *cursor = (uint8_t *)OffTheBooks::calloc_(dataSize);
if (!cursor) {
execPool->release();
js_ReportOutOfMemory(cx);
@ -1804,7 +1804,7 @@ mjit::Compiler::finishThisUp()
ChunkJumpTableEdge nedge = chunkJumps[j];
if (nedge.edge.source == edge.source && nedge.edge.target == edge.target) {
if (!jumpTableEntries) {
jumpTableEntries = cx->new_<CrossChunkEdge::JumpTableEntryVector>();
jumpTableEntries = OffTheBooks::new_<CrossChunkEdge::JumpTableEntryVector>();
if (!jumpTableEntries)
failed = true;
}
@ -6980,7 +6980,7 @@ mjit::Compiler::startLoop(jsbytecode *head, Jump entry, jsbytecode *entryTarget)
loop->clearLoopRegisters();
}
LoopState *nloop = cx->new_<LoopState>(cx, &ssa, this, &frame);
LoopState *nloop = OffTheBooks::new_<LoopState>(cx, &ssa, this, &frame);
if (!nloop || !nloop->init(head, entry, entryTarget))
return false;

Просмотреть файл

@ -94,7 +94,7 @@ FrameState::pushActiveFrame(JSScript *script, uint32_t argc)
size_t totalBytes = sizeof(FrameEntry) * nentries + // entries[]
sizeof(FrameEntry *) * nentries + // tracker.entries
sizeof(StackEntryExtra) * nentries; // extraArray
uint8_t *cursor = (uint8_t *)cx->calloc_(totalBytes);
uint8_t *cursor = (uint8_t *)OffTheBooks::calloc_(totalBytes);
if (!cursor)
return false;
@ -120,7 +120,7 @@ FrameState::pushActiveFrame(JSScript *script, uint32_t argc)
/* We should have already checked that argc == nargs */
JS_ASSERT_IF(a, argc == script->function()->nargs);
ActiveFrame *newa = cx->new_<ActiveFrame>();
ActiveFrame *newa = OffTheBooks::new_<ActiveFrame>();
if (!newa)
return false;
@ -2885,7 +2885,7 @@ FrameState::getTemporaryCopies(Uses uses)
FrameEntry *nfe = tracker[i];
if (!deadEntry(nfe, uses.nuses) && nfe->isCopy() && nfe->copyOf() == fe) {
if (!res)
res = cx->new_< Vector<TemporaryCopy> >(cx);
res = OffTheBooks::new_< Vector<TemporaryCopy> >(cx);
res->append(TemporaryCopy(addressOf(nfe), addressOf(fe)));
}
}

Просмотреть файл

@ -64,7 +64,7 @@ ImmutableSync::init(JSContext *cx, const FrameState &frame, uint32_t nentries)
this->cx = cx;
this->frame = &frame;
entries = (SyncEntry *)cx->calloc_(sizeof(SyncEntry) * nentries);
entries = (SyncEntry *)OffTheBooks::calloc_(sizeof(SyncEntry) * nentries);
return !!entries;
}

Просмотреть файл

@ -197,7 +197,7 @@ class BasePolyIC : public BaseIC {
if (isOnePool()) {
JSC::ExecutablePool *oldPool = u.execPool;
JS_ASSERT(!isTagged(oldPool));
ExecPoolVector *execPools = cx->new_<ExecPoolVector>(SystemAllocPolicy());
ExecPoolVector *execPools = OffTheBooks::new_<ExecPoolVector>(SystemAllocPolicy());
if (!execPools)
return false;
if (!execPools->append(oldPool) || !execPools->append(pool)) {