Bug 956353 - IonMonkey: Show message when logging a script isn't possible, r=djvj

This commit is contained in:
Hannes Verschore 2014-01-07 17:55:13 +01:00
Родитель 881aade0e7
Коммит 5df1a678bc
2 изменённых файлов: 7 добавлений и 17 удалений

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

@ -1714,7 +1714,6 @@ IonCompile(JSContext *cx, JSScript *script,
JS_ASSERT(CanIonCompile(builder->script(), executionMode));
RootedScript builderScript(cx, builder->script());
IonSpewNewFunction(graph, builderScript);
if (recompile) {
JS_ASSERT(executionMode == SequentialExecution);
@ -1724,7 +1723,10 @@ IonCompile(JSContext *cx, JSScript *script,
// If possible, compile the script off thread.
if (OffThreadCompilationAvailable(cx)) {
if (!recompile)
SetIonScript(builder->script(), executionMode, ION_COMPILING_SCRIPT);
SetIonScript(builderScript, executionMode, ION_COMPILING_SCRIPT);
IonSpew(IonSpew_Logs, "Can't log script %s:%d. (Compiled on background thread.)",
builderScript->filename(), builderScript->lineno());
if (!StartOffThreadIonCompile(cx, builder)) {
IonSpew(IonSpew_Abort, "Unable to start off-thread ion compilation.");
@ -1756,6 +1758,8 @@ IonCompile(JSContext *cx, JSScript *script,
protect.construct(cx->runtime());
}
IonSpewNewFunction(graph, builderScript);
bool succeeded = builder->build();
builder->clearForBackEnd();

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

@ -81,22 +81,8 @@ jit::EnableIonDebugLogging()
void
jit::IonSpewNewFunction(MIRGraph *graph, HandleScript func)
{
if (GetIonContext()->runtime->onMainThread()) {
if (GetIonContext()->runtime->onMainThread())
ionspewer.beginFunction(graph, func);
return;
}
if (!IonSpewEnabled(IonSpew_Logs))
return;
// Ionspewer isn't threads-safe. Therefore logging is disabled for
// off-thread spewing. Throw informative message when trying.
if (func) {
IonSpew(IonSpew_Logs, "Can't log script %s:%d. (Compiled on background thread.)",
func->filename(), func->lineno());
} else {
IonSpew(IonSpew_Logs, "Can't log asm.js compilation. (Compiled on background thread.)");
}
}
void