зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1054630 - Part 1: Add plumbing for SpiderMonkey parser telemetry. r=till
This commit is contained in:
Родитель
897f56e626
Коммит
c2a5352c35
|
@ -449,6 +449,8 @@ Parser<ParseHandler>::Parser(ExclusiveContext *cx, LifoAlloc *alloc,
|
|||
template <typename ParseHandler>
|
||||
Parser<ParseHandler>::~Parser()
|
||||
{
|
||||
accumulateTelemetry();
|
||||
|
||||
alloc.release(tempPoolMark);
|
||||
|
||||
/*
|
||||
|
@ -7567,6 +7569,27 @@ Parser<ParseHandler>::exprInParens()
|
|||
return pn;
|
||||
}
|
||||
|
||||
template <typename ParseHandler>
|
||||
void
|
||||
Parser<ParseHandler>::accumulateTelemetry()
|
||||
{
|
||||
JSContext* cx = context->maybeJSContext();
|
||||
if (!cx)
|
||||
return;
|
||||
JSAccumulateTelemetryDataCallback cb = cx->runtime()->telemetryCallback;
|
||||
if (!cb)
|
||||
return;
|
||||
|
||||
const char* filename = getFilename();
|
||||
bool isHTTP = strncmp(filename, "http://", 7) == 0 || strncmp(filename, "https://", 8) == 0;
|
||||
|
||||
// Only report telemetry for web content, not add-ons or chrome JS.
|
||||
if (!isHTTP)
|
||||
return;
|
||||
|
||||
// Call back into Firefox's Telemetry reporter.
|
||||
}
|
||||
|
||||
template class Parser<FullParseHandler>;
|
||||
template class Parser<SyntaxParseHandler>;
|
||||
|
||||
|
|
|
@ -658,6 +658,8 @@ class Parser : private JS::AutoGCRooter, public StrictModeGetter
|
|||
|
||||
bool asmJS(Node list);
|
||||
|
||||
void accumulateTelemetry();
|
||||
|
||||
friend class LegacyCompExprTransplanter;
|
||||
friend struct BindData<ParseHandler>;
|
||||
};
|
||||
|
|
|
@ -119,7 +119,8 @@ enum {
|
|||
JS_TELEMETRY_GC_INCREMENTAL_DISABLED,
|
||||
JS_TELEMETRY_GC_NON_INCREMENTAL,
|
||||
JS_TELEMETRY_GC_SCC_SWEEP_TOTAL_MS,
|
||||
JS_TELEMETRY_GC_SCC_SWEEP_MAX_PAUSE_MS
|
||||
JS_TELEMETRY_GC_SCC_SWEEP_MAX_PAUSE_MS,
|
||||
JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT
|
||||
};
|
||||
|
||||
typedef void
|
||||
|
|
|
@ -2959,6 +2959,11 @@ AccumulateTelemetryCallback(int id, uint32_t sample)
|
|||
case JS_TELEMETRY_GC_SCC_SWEEP_MAX_PAUSE_MS:
|
||||
Telemetry::Accumulate(Telemetry::GC_SCC_SWEEP_MAX_PAUSE_MS, sample);
|
||||
break;
|
||||
case JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT:
|
||||
Telemetry::Accumulate(Telemetry::JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT, sample);
|
||||
break;
|
||||
default:
|
||||
MOZ_ASSERT_UNREACHABLE("Unexpected JS_TELEMETRY id");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -334,6 +334,12 @@
|
|||
"kind": "flag",
|
||||
"description": "Has seen location error"
|
||||
},
|
||||
"JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "Use of SpiderMonkey's deprecated language extensions in web content"
|
||||
},
|
||||
"TELEMETRY_PING": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "exponential",
|
||||
|
|
Загрузка…
Ссылка в новой задаче