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

Unified Diff: src/PNaClTranslator.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/IceTimerTree.def ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/PNaClTranslator.cpp
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index 4f1c3a6714426dabc38081e70302cc7deda5ea51..03a81825662612b26b37d9103ba6f773ac2fa582 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -1339,21 +1339,14 @@ public:
NextLocalInstIndex(Context->getNumGlobalIDs()) {}
bool convertFunction() {
- const Ice::TimerStackIdT StackID = Ice::GlobalContext::TSK_Funcs;
- Ice::TimerIdT TimerID = 0;
- const bool TimeThisFunction = getFlags().getTimeEachFunction();
- if (TimeThisFunction) {
- TimerID = getTranslator().getContext()->getTimerID(StackID,
- FuncDecl->getName());
- getTranslator().getContext()->pushTimer(TimerID, StackID);
- }
-
- // Note: The Cfg is created, even when IR generation is disabled. This is
- // done to install a CfgLocalAllocator for various internal containers.
- Func = Ice::Cfg::create(getTranslator().getContext(),
- getTranslator().getNextSequenceNumber());
bool ParserResult;
{
+ Ice::TimerMarker T(getTranslator().getContext(), FuncDecl->getName());
+ // Note: The Cfg is created, even when IR generation is disabled. This is
+ // done to install a CfgLocalAllocator for various internal containers.
+ Func = Ice::Cfg::create(getTranslator().getContext(),
+ getTranslator().getNextSequenceNumber());
+
Ice::CfgLocalAllocatorScope _(Func.get());
// TODO(kschimpf) Clean up API to add a function signature to a CFG.
@@ -1370,12 +1363,6 @@ public:
ParserResult = ParseThisBlock();
- // Temporarily end per-function timing, which will be resumed by the
- // translator function. This is because translation may be done
- // asynchronously in a separate thread.
- if (TimeThisFunction)
- getTranslator().getContext()->popTimer(TimerID, StackID);
-
// Note: Once any errors have been found, we turn off all translation of
// all remaining functions. This allows successive parsing errors to be
// reported, without adding extra checks to the translator for such
« no previous file with comments | « src/IceTimerTree.def ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698