Bug 862777: Hook Odinmonkey up to the spewlogger, r=luke

This commit is contained in:
Hannes Verschore 2013-04-18 15:15:21 +02:00
Родитель 1ca44fd0f1
Коммит 77aa03df22
4 изменённых файлов: 41 добавлений и 19 удалений

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

@ -4446,6 +4446,8 @@ CheckFunctionBodiesSequential(ModuleCompiler &m)
if (!mirGen)
return false;
IonSpewNewFunction(&mirGen->graph(), NullPtr());
if (!OptimizeMIR(mirGen))
return m.fail("Internal compiler failure (probably out of memory)", func.fn());
@ -4455,6 +4457,8 @@ CheckFunctionBodiesSequential(ModuleCompiler &m)
if (!GenerateAsmJSCode(m, func, *mirGen, *lir))
return false;
IonSpewEndFunction();
}
return true;

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

@ -35,8 +35,13 @@ C1Spewer::beginFunction(MIRGraph *graph, HandleScript script)
this->script = script;
fprintf(spewout_, "begin_compilation\n");
fprintf(spewout_, " name \"%s:%d\"\n", script->filename(), script->lineno);
fprintf(spewout_, " method \"%s:%d\"\n", script->filename(), script->lineno);
if (script) {
fprintf(spewout_, " name \"%s:%d\"\n", script->filename(), script->lineno);
fprintf(spewout_, " method \"%s:%d\"\n", script->filename(), script->lineno);
} else {
fprintf(spewout_, " name \"asm.js compilation\"\n");
fprintf(spewout_, " method \"asm.js compilation\"\n");
}
fprintf(spewout_, " date %d\n", (int)time(NULL));
fprintf(spewout_, "end_compilation\n");
}
@ -176,21 +181,22 @@ C1Spewer::spewPass(FILE *fp, MBasicBlock *block)
fprintf(fp, " begin_states\n");
fprintf(fp, " begin_locals\n");
fprintf(fp, " size %d\n", (int)block->numEntrySlots());
fprintf(fp, " method \"None\"\n");
for (uint32_t i = 0; i < block->numEntrySlots(); i++) {
MDefinition *ins = block->getEntrySlot(i);
fprintf(fp, " ");
fprintf(fp, "%d ", i);
if (ins->isUnused())
fprintf(fp, "unused");
else
ins->printName(fp);
fprintf(fp, "\n");
if (block->entryResumePoint()) {
fprintf(fp, " begin_locals\n");
fprintf(fp, " size %d\n", (int)block->numEntrySlots());
fprintf(fp, " method \"None\"\n");
for (uint32_t i = 0; i < block->numEntrySlots(); i++) {
MDefinition *ins = block->getEntrySlot(i);
fprintf(fp, " ");
fprintf(fp, "%d ", i);
if (ins->isUnused())
fprintf(fp, "unused");
else
ins->printName(fp);
fprintf(fp, "\n");
}
fprintf(fp, " end_locals\n");
}
fprintf(fp, " end_locals\n");
fprintf(fp, " end_states\n");
fprintf(fp, " begin_HIR\n");

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

@ -37,7 +37,7 @@ static const char *ChannelNames[] =
};
static bool
FilterContainsLocation(const char *filename, const size_t line = size_t(-1))
FilterContainsLocation(HandleScript function)
{
static const char *filter = getenv("IONFILTER");
@ -45,6 +45,12 @@ FilterContainsLocation(const char *filename, const size_t line = size_t(-1))
if (!filter || !filter[0])
return true;
// Disable asm.js output when filter is set.
if (!function)
return false;
const char *filename = function->filename();
const size_t line = function->lineno;
static size_t filelen = strlen(filename);
const char *index = strstr(filter, filename);
while (index) {
@ -133,7 +139,7 @@ IonSpewer::beginFunction(MIRGraph *graph, HandleScript function)
if (!inited_)
return;
if (!FilterContainsLocation(function->filename(), function->lineno)) {
if (!FilterContainsLocation(function)) {
JS_ASSERT(!this->graph);
// filter out logs during the compilation.
filteredOutCompilations++;

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

@ -183,7 +183,10 @@ JSONSpewer::beginFunction(RawScript script)
endFunction();
beginObject();
stringProperty("name", "%s:%d", script->filename(), script->lineno);
if (script)
stringProperty("name", "%s:%d", script->filename(), script->lineno);
else
stringProperty("name", "asm.js compilation");
beginListProperty("passes");
inFunction_ = true;
@ -199,6 +202,9 @@ JSONSpewer::beginPass(const char *pass)
void
JSONSpewer::spewMResumePoint(MResumePoint *rp)
{
if (!rp)
return;
beginObjectProperty("resumePoint");
if (rp->caller())