Bug 1345145 - Remove some frontend tracelogging that's in functions that are too hot, causing regressions, and whose per-call execution times are too low to be useful. (r=h4writer)

This commit is contained in:
Shu-yu Guo 2017-03-09 19:24:52 -08:00
Родитель 19d2cbc4c8
Коммит 01f934f106
5 изменённых файлов: 0 добавлений и 48 удалений

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

@ -514,8 +514,6 @@ class BytecodeEmitter::EmitterScope : public Nestable<BytecodeEmitter::EmitterSc
} }
NameLocation lookup(BytecodeEmitter* bce, JSAtom* name) { NameLocation lookup(BytecodeEmitter* bce, JSAtom* name) {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(bce->cx),
TraceLogger_FrontendNameAnalysis);
if (Maybe<NameLocation> loc = lookupInCache(bce, name)) if (Maybe<NameLocation> loc = lookupInCache(bce, name))
return *loc; return *loc;
return searchAndCache(bce, name); return searchAndCache(bce, name);
@ -802,8 +800,6 @@ Maybe<NameLocation>
BytecodeEmitter::EmitterScope::locationBoundInScope(BytecodeEmitter* bce, JSAtom* name, BytecodeEmitter::EmitterScope::locationBoundInScope(BytecodeEmitter* bce, JSAtom* name,
EmitterScope* target) EmitterScope* target)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(bce->cx), TraceLogger_FrontendNameAnalysis);
// The target scope must be an intra-frame enclosing scope of this // The target scope must be an intra-frame enclosing scope of this
// one. Count the number of extra hops to reach it. // one. Count the number of extra hops to reach it.
uint8_t extraHops = 0; uint8_t extraHops = 0;
@ -861,8 +857,6 @@ bool
BytecodeEmitter::EmitterScope::enterLexical(BytecodeEmitter* bce, ScopeKind kind, BytecodeEmitter::EmitterScope::enterLexical(BytecodeEmitter* bce, ScopeKind kind,
Handle<LexicalScope::Data*> bindings) Handle<LexicalScope::Data*> bindings)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(bce->cx), TraceLogger_FrontendNameAnalysis);
MOZ_ASSERT(kind != ScopeKind::NamedLambda && kind != ScopeKind::StrictNamedLambda); MOZ_ASSERT(kind != ScopeKind::NamedLambda && kind != ScopeKind::StrictNamedLambda);
MOZ_ASSERT(this == bce->innermostEmitterScope); MOZ_ASSERT(this == bce->innermostEmitterScope);
@ -933,8 +927,6 @@ BytecodeEmitter::EmitterScope::enterLexical(BytecodeEmitter* bce, ScopeKind kind
bool bool
BytecodeEmitter::EmitterScope::enterNamedLambda(BytecodeEmitter* bce, FunctionBox* funbox) BytecodeEmitter::EmitterScope::enterNamedLambda(BytecodeEmitter* bce, FunctionBox* funbox)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(bce->cx), TraceLogger_FrontendNameAnalysis);
MOZ_ASSERT(this == bce->innermostEmitterScope); MOZ_ASSERT(this == bce->innermostEmitterScope);
MOZ_ASSERT(funbox->namedLambdaBindings()); MOZ_ASSERT(funbox->namedLambdaBindings());
@ -1002,8 +994,6 @@ BytecodeEmitter::EmitterScope::enterComprehensionFor(BytecodeEmitter* bce,
bool bool
BytecodeEmitter::EmitterScope::enterParameterExpressionVar(BytecodeEmitter* bce) BytecodeEmitter::EmitterScope::enterParameterExpressionVar(BytecodeEmitter* bce)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(bce->cx), TraceLogger_FrontendNameAnalysis);
MOZ_ASSERT(this == bce->innermostEmitterScope); MOZ_ASSERT(this == bce->innermostEmitterScope);
if (!ensureCache(bce)) if (!ensureCache(bce))
@ -1125,8 +1115,6 @@ BytecodeEmitter::EmitterScope::enterFunction(BytecodeEmitter* bce, FunctionBox*
bool bool
BytecodeEmitter::EmitterScope::enterFunctionExtraBodyVar(BytecodeEmitter* bce, FunctionBox* funbox) BytecodeEmitter::EmitterScope::enterFunctionExtraBodyVar(BytecodeEmitter* bce, FunctionBox* funbox)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(bce->cx), TraceLogger_FrontendNameAnalysis);
MOZ_ASSERT(funbox->hasParameterExprs); MOZ_ASSERT(funbox->hasParameterExprs);
MOZ_ASSERT(funbox->extraVarScopeBindings() || MOZ_ASSERT(funbox->extraVarScopeBindings() ||
funbox->needsExtraBodyVarEnvironmentRegardlessOfBindings()); funbox->needsExtraBodyVarEnvironmentRegardlessOfBindings());
@ -1216,8 +1204,6 @@ class DynamicBindingIter : public BindingIter
bool bool
BytecodeEmitter::EmitterScope::enterGlobal(BytecodeEmitter* bce, GlobalSharedContext* globalsc) BytecodeEmitter::EmitterScope::enterGlobal(BytecodeEmitter* bce, GlobalSharedContext* globalsc)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(bce->cx), TraceLogger_FrontendNameAnalysis);
MOZ_ASSERT(this == bce->innermostEmitterScope); MOZ_ASSERT(this == bce->innermostEmitterScope);
bce->setVarEmitterScope(this); bce->setVarEmitterScope(this);
@ -1278,8 +1264,6 @@ BytecodeEmitter::EmitterScope::enterGlobal(BytecodeEmitter* bce, GlobalSharedCon
bool bool
BytecodeEmitter::EmitterScope::enterEval(BytecodeEmitter* bce, EvalSharedContext* evalsc) BytecodeEmitter::EmitterScope::enterEval(BytecodeEmitter* bce, EvalSharedContext* evalsc)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(bce->cx), TraceLogger_FrontendNameAnalysis);
MOZ_ASSERT(this == bce->innermostEmitterScope); MOZ_ASSERT(this == bce->innermostEmitterScope);
bce->setVarEmitterScope(this); bce->setVarEmitterScope(this);
@ -1335,8 +1319,6 @@ BytecodeEmitter::EmitterScope::enterEval(BytecodeEmitter* bce, EvalSharedContext
bool bool
BytecodeEmitter::EmitterScope::enterModule(BytecodeEmitter* bce, ModuleSharedContext* modulesc) BytecodeEmitter::EmitterScope::enterModule(BytecodeEmitter* bce, ModuleSharedContext* modulesc)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(bce->cx), TraceLogger_FrontendNameAnalysis);
MOZ_ASSERT(this == bce->innermostEmitterScope); MOZ_ASSERT(this == bce->innermostEmitterScope);
bce->setVarEmitterScope(this); bce->setVarEmitterScope(this);
@ -1394,8 +1376,6 @@ BytecodeEmitter::EmitterScope::enterModule(BytecodeEmitter* bce, ModuleSharedCon
bool bool
BytecodeEmitter::EmitterScope::enterWith(BytecodeEmitter* bce) BytecodeEmitter::EmitterScope::enterWith(BytecodeEmitter* bce)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(bce->cx), TraceLogger_FrontendNameAnalysis);
MOZ_ASSERT(this == bce->innermostEmitterScope); MOZ_ASSERT(this == bce->innermostEmitterScope);
if (!ensureCache(bce)) if (!ensureCache(bce))
@ -1422,8 +1402,6 @@ BytecodeEmitter::EmitterScope::enterWith(BytecodeEmitter* bce)
bool bool
BytecodeEmitter::EmitterScope::leave(BytecodeEmitter* bce, bool nonLocal) BytecodeEmitter::EmitterScope::leave(BytecodeEmitter* bce, bool nonLocal)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(bce->cx), TraceLogger_FrontendNameAnalysis);
// If we aren't leaving the scope due to a non-local jump (e.g., break), // If we aren't leaving the scope due to a non-local jump (e.g., break),
// we must be the innermost scope. // we must be the innermost scope.
MOZ_ASSERT_IF(!nonLocal, this == bce->innermostEmitterScope); MOZ_ASSERT_IF(!nonLocal, this == bce->innermostEmitterScope);
@ -1481,8 +1459,6 @@ BytecodeEmitter::EmitterScope::leave(BytecodeEmitter* bce, bool nonLocal)
Maybe<MaybeCheckTDZ> Maybe<MaybeCheckTDZ>
BytecodeEmitter::TDZCheckCache::needsTDZCheck(BytecodeEmitter* bce, JSAtom* name) BytecodeEmitter::TDZCheckCache::needsTDZCheck(BytecodeEmitter* bce, JSAtom* name)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(bce->cx), TraceLogger_FrontendTDZAnalysis);
if (!ensureCache(bce)) if (!ensureCache(bce))
return Nothing(); return Nothing();
@ -1512,8 +1488,6 @@ bool
BytecodeEmitter::TDZCheckCache::noteTDZCheck(BytecodeEmitter* bce, JSAtom* name, BytecodeEmitter::TDZCheckCache::noteTDZCheck(BytecodeEmitter* bce, JSAtom* name,
MaybeCheckTDZ check) MaybeCheckTDZ check)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(bce->cx), TraceLogger_FrontendTDZAnalysis);
if (!ensureCache(bce)) if (!ensureCache(bce))
return false; return false;

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

@ -1089,8 +1089,6 @@ Parser<ParseHandler>::notePositionalFormalParameter(Node fn, HandlePropertyName
bool disallowDuplicateParams, bool disallowDuplicateParams,
bool* duplicatedParam) bool* duplicatedParam)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(context), TraceLogger_FrontendNameAnalysis);
if (AddDeclaredNamePtr p = pc->functionScope().lookupDeclaredNameForAdd(name)) { if (AddDeclaredNamePtr p = pc->functionScope().lookupDeclaredNameForAdd(name)) {
if (disallowDuplicateParams) { if (disallowDuplicateParams) {
error(JSMSG_BAD_DUP_ARGS); error(JSMSG_BAD_DUP_ARGS);
@ -1322,8 +1320,6 @@ bool
Parser<ParseHandler>::tryDeclareVarForAnnexBLexicalFunction(HandlePropertyName name, Parser<ParseHandler>::tryDeclareVarForAnnexBLexicalFunction(HandlePropertyName name,
uint32_t beginPos, bool* tryAnnexB) uint32_t beginPos, bool* tryAnnexB)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(context), TraceLogger_FrontendNameAnalysis);
Maybe<DeclarationKind> redeclaredKind; Maybe<DeclarationKind> redeclaredKind;
uint32_t unused; uint32_t unused;
if (!tryDeclareVar(name, DeclarationKind::VarForAnnexBLexicalFunction, beginPos, if (!tryDeclareVar(name, DeclarationKind::VarForAnnexBLexicalFunction, beginPos,
@ -1392,8 +1388,6 @@ bool
Parser<ParseHandler>::noteDeclaredName(HandlePropertyName name, DeclarationKind kind, Parser<ParseHandler>::noteDeclaredName(HandlePropertyName name, DeclarationKind kind,
TokenPos pos) TokenPos pos)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(context), TraceLogger_FrontendNameAnalysis);
// The asm.js validator does all its own symbol-table management so, as an // The asm.js validator does all its own symbol-table management so, as an
// optimization, avoid doing any work here. // optimization, avoid doing any work here.
if (pc->useAsmOrInsideUseAsm()) if (pc->useAsmOrInsideUseAsm())
@ -1565,8 +1559,6 @@ template <typename ParseHandler>
bool bool
Parser<ParseHandler>::noteUsedName(HandlePropertyName name) Parser<ParseHandler>::noteUsedName(HandlePropertyName name)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(context), TraceLogger_FrontendNameAnalysis);
// If the we are delazifying, the LazyScript already has all the // If the we are delazifying, the LazyScript already has all the
// closed-over info for bindings and there's no need to track used names. // closed-over info for bindings and there's no need to track used names.
if (handler.canSkipLazyClosedOverBindings()) if (handler.canSkipLazyClosedOverBindings())
@ -1592,8 +1584,6 @@ template <typename ParseHandler>
bool bool
Parser<ParseHandler>::hasUsedName(HandlePropertyName name) Parser<ParseHandler>::hasUsedName(HandlePropertyName name)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(context), TraceLogger_FrontendNameAnalysis);
if (UsedNamePtr p = usedNames.lookup(name)) if (UsedNamePtr p = usedNames.lookup(name))
return p->value().isUsedInScript(pc->scriptId()); return p->value().isUsedInScript(pc->scriptId());
return false; return false;
@ -1603,8 +1593,6 @@ template <typename ParseHandler>
bool bool
Parser<ParseHandler>::propagateFreeNamesAndMarkClosedOverBindings(ParseContext::Scope& scope) Parser<ParseHandler>::propagateFreeNamesAndMarkClosedOverBindings(ParseContext::Scope& scope)
{ {
AutoTraceLog traceLog(TraceLoggerForCurrentThread(context), TraceLogger_FrontendNameAnalysis);
if (handler.canSkipLazyClosedOverBindings()) { if (handler.canSkipLazyClosedOverBindings()) {
// Scopes are nullptr-delimited in the LazyScript closed over bindings // Scopes are nullptr-delimited in the LazyScript closed over bindings
// array. // array.

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

@ -1302,10 +1302,6 @@ static_assert(LastCharKind < (1 << (sizeof(firstCharKinds[0]) * 8)),
bool bool
TokenStream::getTokenInternal(TokenKind* ttp, Modifier modifier) TokenStream::getTokenInternal(TokenKind* ttp, Modifier modifier)
{ {
// The assumption is that the cost of other tokenizer code is dwarfed by
// this one.
AutoTraceLog tokenizerLog(TraceLoggerForCurrentThread(cx), TraceLogger_Tokenizing);
int c; int c;
uint32_t qc; uint32_t qc;
Token* tp; Token* tp;

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

@ -831,11 +831,8 @@ TraceLoggerThreadState::init()
if (ContainsFlag(env, "Frontend")) { if (ContainsFlag(env, "Frontend")) {
enabledTextIds[TraceLogger_Frontend] = true; enabledTextIds[TraceLogger_Frontend] = true;
enabledTextIds[TraceLogger_FrontendNameAnalysis] = true;
enabledTextIds[TraceLogger_FrontendTDZAnalysis] = true;
enabledTextIds[TraceLogger_ParsingFull] = true; enabledTextIds[TraceLogger_ParsingFull] = true;
enabledTextIds[TraceLogger_ParsingSyntax] = true; enabledTextIds[TraceLogger_ParsingSyntax] = true;
enabledTextIds[TraceLogger_Tokenizing] = true;
enabledTextIds[TraceLogger_BytecodeEmission] = true; enabledTextIds[TraceLogger_BytecodeEmission] = true;
enabledTextIds[TraceLogger_BytecodeFoldConstants] = true; enabledTextIds[TraceLogger_BytecodeFoldConstants] = true;
enabledTextIds[TraceLogger_BytecodeNameFunctions] = true; enabledTextIds[TraceLogger_BytecodeNameFunctions] = true;

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

@ -30,11 +30,8 @@
_(IrregexpExecute) \ _(IrregexpExecute) \
_(MinorGC) \ _(MinorGC) \
_(Frontend) \ _(Frontend) \
_(FrontendNameAnalysis) \
_(FrontendTDZAnalysis) \
_(ParsingFull) \ _(ParsingFull) \
_(ParsingSyntax) \ _(ParsingSyntax) \
_(Tokenizing) \
_(BytecodeEmission) \ _(BytecodeEmission) \
_(BytecodeFoldConstants) \ _(BytecodeFoldConstants) \
_(BytecodeNameFunctions) \ _(BytecodeNameFunctions) \