Bug 1028529 - ensure IonSpewEndFunction is called once for each call to IonSpewNewFunction. r=nbp

This commit is contained in:
Guillaume Turri 2014-06-25 02:21:34 -07:00
parent be2f9aa5ca
commit 647d7f6f7a
3 changed files with 20 additions and 3 deletions

View File

@ -1905,7 +1905,9 @@ IonCompile(JSContext *cx, JSScript *script,
builderScript->ionScript()->setRecompiling();
}
IonSpewNewFunction(graph, builderScript);
#ifdef DEBUG
IonSpewFunction ionSpewFunction(graph, builderScript);
#endif
bool succeeded = builder->build();
builder->clearForBackEnd();
@ -1941,8 +1943,6 @@ IonCompile(JSContext *cx, JSScript *script,
bool success = codegen->link(cx, builder->constraints());
IonSpewEndFunction();
return success ? AbortReason_NoAbort : AbortReason_Disable;
}

View File

@ -425,5 +425,15 @@ jit::DisableChannel(IonSpewChannel channel)
LoggingBits &= ~(1 << uint32_t(channel));
}
IonSpewFunction::IonSpewFunction(MIRGraph *graph, JS::HandleScript function)
{
IonSpewNewFunction(graph, function);
}
IonSpewFunction::~IonSpewFunction()
{
IonSpewEndFunction();
}
#endif /* DEBUG */

View File

@ -115,6 +115,13 @@ class IonSpewer
void endFunction();
};
class IonSpewFunction
{
public:
IonSpewFunction(MIRGraph *graph, JS::HandleScript function);
~IonSpewFunction();
};
void IonSpewNewFunction(MIRGraph *graph, JS::HandleScript function);
void IonSpewPass(const char *pass);
void IonSpewPass(const char *pass, LinearScanAllocator *ra);