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

Unified Diff: src/IceCfg.h

Issue 1738443002: Subzero. Performance tweaks. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments -- all of them Created 4 years, 10 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/IceBitVector.h ('k') | src/IceCfg.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.h
diff --git a/src/IceCfg.h b/src/IceCfg.h
index 7bdc07686ad7f858bc0a77e2e5813dcc65f45950..64a454cdd8056449ae98bf9146c86ec447ef78c7 100644
--- a/src/IceCfg.h
+++ b/src/IceCfg.h
@@ -36,16 +36,6 @@ public:
uint32_t SequenceNumber) {
return std::unique_ptr<Cfg>(new Cfg(Ctx, SequenceNumber));
}
- /// Gets a pointer to the current thread's Cfg.
- static const Cfg *getCurrentCfg() { return ICE_TLS_GET_FIELD(CurrentCfg); }
- static void setCurrentCfg(const Cfg *Func) {
- ICE_TLS_SET_FIELD(CurrentCfg, Func);
- }
- /// Gets a pointer to the current thread's Cfg's allocator.
- static ArenaAllocator<> *getCurrentCfgAllocator() {
- assert(ICE_TLS_GET_FIELD(CurrentCfg));
- return ICE_TLS_GET_FIELD(CurrentCfg)->Allocator.get();
- }
GlobalContext *getContext() const { return Ctx; }
uint32_t getSequenceNumber() const { return SequenceNumber; }
@@ -254,6 +244,8 @@ public:
}
private:
+ friend class CfgAllocatorTraits; // for Allocator access.
+
Cfg(GlobalContext *Ctx, uint32_t SequenceNumber);
/// Adds a call to the ProfileSummary runtime function as the first
@@ -298,7 +290,7 @@ private:
VarList Variables;
VarList Args; /// subset of Variables, in argument order
VarList ImplicitArgs; /// subset of Variables
- std::unique_ptr<ArenaAllocator<>> Allocator;
+ std::unique_ptr<ArenaAllocator> Allocator;
std::unique_ptr<Liveness> Live;
std::unique_ptr<TargetLowering> Target;
std::unique_ptr<VariablesMetadata> VMetadata;
@@ -313,13 +305,8 @@ private:
/// should be called to avoid spurious validation failures.
const CfgNode *CurrentNode = nullptr;
- /// Maintain a pointer in TLS to the current Cfg being translated. This is
- /// primarily for accessing its allocator statelessly, but other uses are
- /// possible.
- ICE_TLS_DECLARE_FIELD(const Cfg *, CurrentCfg);
-
public:
- static void TlsInit() { ICE_TLS_INIT_FIELD(CurrentCfg); }
+ static void TlsInit() { CfgAllocatorTraits::init(); }
};
template <> Variable *Cfg::makeVariable<Variable>(Type Ty);
« no previous file with comments | « src/IceBitVector.h ('k') | src/IceCfg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698