Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: src/IceELFObjectWriter.cpp

Issue 1784243006: Subzero: Improve the use of timers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceConverter.cpp ('k') | src/IceGlobalContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceELFObjectWriter.cpp
diff --git a/src/IceELFObjectWriter.cpp b/src/IceELFObjectWriter.cpp
index d66b55392eea7dc0721e7b8143d874c87f93316f..8f7d3fcb9f22f3bab3438cb3f97b24b8c6337e10 100644
--- a/src/IceELFObjectWriter.cpp
+++ b/src/IceELFObjectWriter.cpp
@@ -219,14 +219,8 @@ Elf64_Off ELFObjectWriter::alignFileOffset(Elf64_Xword Align) {
void ELFObjectWriter::writeFunctionCode(const IceString &FuncName,
bool IsInternal, Assembler *Asm) {
assert(!SectionNumbersAssigned);
+ TimerMarker T_func(&Ctx, FuncName);
TimerMarker Timer(TimerStack::TT_writeELF, &Ctx);
- constexpr TimerStackIdT StackID = GlobalContext::TSK_Funcs;
- TimerIdT TimerID = 0;
- bool TimeThisFunction = Ctx.getFlags().getTimeEachFunction();
- if (TimeThisFunction) {
- TimerID = Ctx.getTimerID(StackID, FuncName);
- Ctx.pushTimer(TimerID, StackID);
- }
ELFTextSection *Section = nullptr;
ELFRelocationSection *RelSection = nullptr;
const bool FunctionSections = Ctx.getFlags().getFunctionSections();
@@ -278,8 +272,6 @@ void ELFObjectWriter::writeFunctionCode(const IceString &FuncName,
RelSection->addRelocations(OffsetInSection, Asm->fixups(), SymTab);
}
Section->appendData(Str, Asm->getBufferView());
- if (TimeThisFunction)
- Ctx.popTimer(TimerID, StackID);
}
namespace {
« no previous file with comments | « src/IceConverter.cpp ('k') | src/IceGlobalContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698