https://bugs.webkit.org/show_bug.cgi?id=112988
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleCall):
(JSC::DFG::ByteCodeParser::handleGetById):
(JSC::DFG::ByteCodeParser::parseBlock):
* profiler/ProfilerCompilation.cpp:
(JSC::Profiler::Compilation::Compilation):
(JSC::Profiler::Compilation::toJS):
* profiler/ProfilerCompilation.h:
(JSC::Profiler::Compilation::noticeInlinedGetById):
(JSC::Profiler::Compilation::noticeInlinedPutById):
(JSC::Profiler::Compilation::noticeInlinedCall):
(Compilation):
* runtime/CommonIdentifiers.h:
Tools:
* Scripts/display-profiler-output:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@146548
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-03-21 Filip Pizlo <fpizlo@apple.com>
+
+ JSC profiler should have an at-a-glance report of the success of DFG optimization
+ https://bugs.webkit.org/show_bug.cgi?id=112988
+
+ Reviewed by Geoffrey Garen.
+
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::handleCall):
+ (JSC::DFG::ByteCodeParser::handleGetById):
+ (JSC::DFG::ByteCodeParser::parseBlock):
+ * profiler/ProfilerCompilation.cpp:
+ (JSC::Profiler::Compilation::Compilation):
+ (JSC::Profiler::Compilation::toJS):
+ * profiler/ProfilerCompilation.h:
+ (JSC::Profiler::Compilation::noticeInlinedGetById):
+ (JSC::Profiler::Compilation::noticeInlinedPutById):
+ (JSC::Profiler::Compilation::noticeInlinedCall):
+ (Compilation):
+ * runtime/CommonIdentifiers.h:
+
2013-03-21 Mark Lam <mark.lam@apple.com>
Fix lexer charPosition computation when "rewind"ing the lexer.
// the inputs must be kept alive whatever exits the intrinsic may do.
addToGraph(Phantom, callTarget);
emitArgumentPhantoms(registerOffset, argumentCountIncludingThis, kind);
+ if (m_graph.m_compilation)
+ m_graph.m_compilation->noticeInlinedCall();
return;
}
- } else if (handleInlining(usesResult, callTarget, resultOperand, callLinkStatus, registerOffset, argumentCountIncludingThis, nextOffset, kind))
+ } else if (handleInlining(usesResult, callTarget, resultOperand, callLinkStatus, registerOffset, argumentCountIncludingThis, nextOffset, kind)) {
+ if (m_graph.m_compilation)
+ m_graph.m_compilation->noticeInlinedCall();
return;
+ }
addCall(interpreter, currentInstruction, op);
}
// execution if it doesn't have a prediction, so we do it manually.
if (prediction == SpecNone)
addToGraph(ForceOSRExit);
+ else if (m_graph.m_compilation)
+ m_graph.m_compilation->noticeInlinedGetById();
Node* originalBaseForBaselineJIT = base;
m_inlineStackTop->m_profiledBlock,
m_currentIndex,
m_codeBlock->identifier(identifierNumber));
- if (!putByIdStatus.isSet())
+ bool canCountAsInlined = true;
+ if (!putByIdStatus.isSet()) {
addToGraph(ForceOSRExit);
+ canCountAsInlined = false;
+ }
bool hasExitSite = m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache);
addToGraph(PutByIdDirect, OpInfo(identifierNumber), base, value);
else
addToGraph(PutById, OpInfo(identifierNumber), base, value);
+ canCountAsInlined = false;
}
+
+ if (canCountAsInlined && m_graph.m_compilation)
+ m_graph.m_compilation->noticeInlinedPutById();
NEXT_OPCODE(op_put_by_id);
}
/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Compilation::Compilation(Bytecodes* bytecodes, CompilationKind kind)
: m_bytecodes(bytecodes)
, m_kind(kind)
+ , m_numInlinedGetByIds(0)
+ , m_numInlinedPutByIds(0)
+ , m_numInlinedCalls(0)
{
}
exits->putDirectIndex(exec, i, m_osrExits[i].toJS(exec));
result->putDirect(exec->globalData(), exec->propertyNames().osrExits, exits);
+ result->putDirect(exec->globalData(), exec->propertyNames().numInlinedGetByIds, jsNumber(m_numInlinedGetByIds));
+ result->putDirect(exec->globalData(), exec->propertyNames().numInlinedPutByIds, jsNumber(m_numInlinedPutByIds));
+ result->putDirect(exec->globalData(), exec->propertyNames().numInlinedCalls, jsNumber(m_numInlinedCalls));
+
return result;
}
/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
unsigned profiledBytecodesSize() const { return m_profiledBytecodes.size(); }
const ProfiledBytecodes& profiledBytecodesAt(unsigned i) const { return m_profiledBytecodes[i]; }
+ void noticeInlinedGetById() { m_numInlinedGetByIds++; }
+ void noticeInlinedPutById() { m_numInlinedPutByIds++; }
+ void noticeInlinedCall() { m_numInlinedCalls++; }
+
Bytecodes* bytecodes() const { return m_bytecodes; }
CompilationKind kind() const { return m_kind; }
HashMap<OriginStack, OwnPtr<ExecutionCounter> > m_counters;
Vector<OSRExitSite> m_osrExitSites;
SegmentedVector<OSRExit> m_osrExits;
+ unsigned m_numInlinedGetByIds;
+ unsigned m_numInlinedPutByIds;
+ unsigned m_numInlinedCalls;
};
} } // namespace JSC::Profiler
macro(multiline) \
macro(name) \
macro(now) \
+ macro(numInlinedGetByIds) \
+ macro(numInlinedPutByIds) \
+ macro(numInlinedCalls) \
macro(Object) \
macro(opcode) \
macro(origin) \
+2013-03-21 Filip Pizlo <fpizlo@apple.com>
+
+ JSC profiler should have an at-a-glance report of the success of DFG optimization
+ https://bugs.webkit.org/show_bug.cgi?id=112988
+
+ Reviewed by Geoffrey Garen.
+
+ * Scripts/display-profiler-output:
+
2013-03-21 Dirk Pranke <dpranke@chromium.org>
[chromium] Linux ASAN WebKit canary is running out of memory
#!/usr/bin/env ruby
-# Copyright (C) 2012 Apple Inc. All rights reserved.
+# Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
end
class Compilation
- attr_accessor :bytecode, :engine, :descriptions, :counters, :compilationIndex, :osrExits, :profiledBytecodes
+ attr_accessor :bytecode, :engine, :descriptions, :counters, :compilationIndex
+ attr_accessor :osrExits, :profiledBytecodes, :numInlinedGetByIds, :numInlinedPutByIds
+ attr_accessor :numInlinedCalls
def initialize(json)
@bytecode = $bytecodes[json["bytecodesID"].to_i]
| subJson |
@profiledBytecodes << ProfiledBytecodes.new(subJson)
}
+ @numInlinedGetByIds = json["numInlinedGetByIds"]
+ @numInlinedPutByIds = json["numInlinedPutByIds"]
+ @numInlinedCalls = json["numInlinedCalls"]
end
def counter(origin)
exitCountCols = 7
remaining -= exitCountCols + 1
+
+ recentOptsCols = 12
+ remaining -= recentOptsCols + 1
end
if remaining > 0
print(" " + center("#Compil", compilationsCols))
print(" " + center("Inlines", inlinesCols))
print(" " + center("#Exits", exitCountCols))
+ print(" " + center("Last Opts", recentOptsCols))
end
if sourceCols
print(" " + center("Source", sourceCols))
print(" " + center("Base/DFG", machineCountCols))
print(" " + (" " * compilationsCols))
print(" " + center("Src/Total", inlinesCols))
+ print(" " + (" " * exitCountCols))
+ print(" " + center("Get/Put/Call", recentOptsCols))
end
puts
$bytecodes.sort {
print(" " + center(bytecode.compilations.size.to_s, compilationsCols))
print(" " + center(bytecode.sourceMachineInlineSites.to_s + "/" + bytecode.totalMachineInlineSites.to_s, inlinesCols))
print(" " + center(bytecode.totalExitCount.to_s, exitCountCols))
+ lastCompilation = bytecode.compilations[-1]
+ if lastCompilation
+ optData = [lastCompilation.numInlinedGetByIds,
+ lastCompilation.numInlinedPutByIds,
+ lastCompilation.numInlinedCalls]
+ else
+ optData = ["N/A"]
+ end
+ print(" " + center(optData.join('/'), recentOptsCols))
end
if sourceCols
print(" " + sourceOnOneLine(bytecode.source, sourceCols))
end
puts("Compilation #{compilation}:")
+ puts(" Num inlined: GetByIds: #{compilation.numInlinedGetByIds} PutByIds: #{compilation.numInlinedPutByIds} Calls: #{compilation.numInlinedCalls}")
puts(center("Actual Counts", actualCountCols) + " " + center("Source Counts", sourceCountCols) + " " + center("Disassembly in #{compilation.engine}", screenWidth - 1 - sourceCountCols - 1 - actualCountCols))
puts((" " * actualCountCols) + " " + center("Base/DFG", sourceCountCols))