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
parent 19d2cbc4c8
commit 01f934f106
5 changed files with 0 additions and 48 deletions

View File

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

View File

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

View File

@ -1302,10 +1302,6 @@ static_assert(LastCharKind < (1 << (sizeof(firstCharKinds[0]) * 8)),
bool
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;
uint32_t qc;
Token* tp;

View File

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

View File

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