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

Unified Diff: src/IceTimerTree.h

Issue 878383004: Subzero: Fix timers for multithreaded translation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase. Add missing 'break'. Created 5 years, 11 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/IceGlobalContext.cpp ('k') | src/IceTimerTree.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTimerTree.h
diff --git a/src/IceTimerTree.h b/src/IceTimerTree.h
index 795bbee395cd7397dc6db56818b62c63cfb7c9d9..e40a917b3160d1d3b2ac4bf62a48938a3a519309 100644
--- a/src/IceTimerTree.h
+++ b/src/IceTimerTree.h
@@ -22,8 +22,16 @@ namespace Ice {
class TimerStack {
TimerStack &operator=(const TimerStack &) = delete;
- // Timer tree index type
+ // Timer tree index type. A variable of this type is used to access
+ // an interior, not-necessarily-leaf node of the tree.
typedef std::vector<class TimerTreeNode>::size_type TTindex;
+ // Representation of a path of leaf values leading to a particular
+ // node. The representation happens to be in "reverse" order,
+ // i.e. from leaf/interior to root, for implementation efficiency.
+ typedef llvm::SmallVector<TTindex, 8> PathType;
+ // Representation of a mapping of leaf node indexes from one timer
+ // stack to another.
+ typedef std::vector<TimerIdT> TranslationType;
// TimerTreeNode represents an interior or leaf node in the call tree.
// It contains a list of children, a pointer to its parent, and the
@@ -54,7 +62,9 @@ public:
TimerStack(const IceString &Name);
TimerStack(const TimerStack &) = default;
TimerIdT getTimerID(const IceString &Name);
+ void mergeFrom(const TimerStack &Src);
void setName(const IceString &NewName) { Name = NewName; }
+ const IceString &getName() const { return Name; }
void push(TimerIdT ID);
void pop(TimerIdT ID);
void reset();
@@ -63,6 +73,10 @@ public:
private:
void update(bool UpdateCounts);
static double timestamp();
+ TranslationType translateIDsFrom(const TimerStack &Src);
+ PathType getPath(TTindex Index, const TranslationType &Mapping) const;
+ TTindex getChildIndex(TTindex Parent, TimerIdT ID);
+ TTindex findPath(const PathType &Path);
IceString Name;
double FirstTimestamp;
double LastTimestamp;
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceTimerTree.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698