| OLD | NEW |
| 1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- C++ -*-===// | 1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file declares aspects of the compilation that persist across | 10 // This file declares aspects of the compilation that persist across |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 // Reset stats at the beginning of a function. | 220 // Reset stats at the beginning of a function. |
| 221 void resetStats() { | 221 void resetStats() { |
| 222 if (ALLOW_DUMP) | 222 if (ALLOW_DUMP) |
| 223 ICE_TLS_GET_FIELD(TLS)->StatsFunction.reset(); | 223 ICE_TLS_GET_FIELD(TLS)->StatsFunction.reset(); |
| 224 } | 224 } |
| 225 void dumpStats(const IceString &Name, bool Final = false); | 225 void dumpStats(const IceString &Name, bool Final = false); |
| 226 void statsUpdateEmitted(uint32_t InstCount) { | 226 void statsUpdateEmitted(uint32_t InstCount) { |
| 227 if (!getFlags().getDumpStats()) | 227 if (!getFlags().getDumpStats()) |
| 228 return; | 228 return; |
| 229 ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS); | 229 ThreadContext *Tls = ICE_TLS_GET_FIELD(TLS); |
| 230 TLS->StatsFunction.update(CodeStats::CS_InstCount, InstCount); | 230 Tls->StatsFunction.update(CodeStats::CS_InstCount, InstCount); |
| 231 TLS->StatsCumulative.update(CodeStats::CS_InstCount, InstCount); | 231 Tls->StatsCumulative.update(CodeStats::CS_InstCount, InstCount); |
| 232 } | 232 } |
| 233 void statsUpdateRegistersSaved(uint32_t Num) { | 233 void statsUpdateRegistersSaved(uint32_t Num) { |
| 234 if (!getFlags().getDumpStats()) | 234 if (!getFlags().getDumpStats()) |
| 235 return; | 235 return; |
| 236 ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS); | 236 ThreadContext *Tls = ICE_TLS_GET_FIELD(TLS); |
| 237 TLS->StatsFunction.update(CodeStats::CS_RegsSaved, Num); | 237 Tls->StatsFunction.update(CodeStats::CS_RegsSaved, Num); |
| 238 TLS->StatsCumulative.update(CodeStats::CS_RegsSaved, Num); | 238 Tls->StatsCumulative.update(CodeStats::CS_RegsSaved, Num); |
| 239 } | 239 } |
| 240 void statsUpdateFrameBytes(uint32_t Bytes) { | 240 void statsUpdateFrameBytes(uint32_t Bytes) { |
| 241 if (!getFlags().getDumpStats()) | 241 if (!getFlags().getDumpStats()) |
| 242 return; | 242 return; |
| 243 ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS); | 243 ThreadContext *Tls = ICE_TLS_GET_FIELD(TLS); |
| 244 TLS->StatsFunction.update(CodeStats::CS_FrameByte, Bytes); | 244 Tls->StatsFunction.update(CodeStats::CS_FrameByte, Bytes); |
| 245 TLS->StatsCumulative.update(CodeStats::CS_FrameByte, Bytes); | 245 Tls->StatsCumulative.update(CodeStats::CS_FrameByte, Bytes); |
| 246 } | 246 } |
| 247 void statsUpdateSpills() { | 247 void statsUpdateSpills() { |
| 248 if (!getFlags().getDumpStats()) | 248 if (!getFlags().getDumpStats()) |
| 249 return; | 249 return; |
| 250 ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS); | 250 ThreadContext *Tls = ICE_TLS_GET_FIELD(TLS); |
| 251 TLS->StatsFunction.update(CodeStats::CS_NumSpills); | 251 Tls->StatsFunction.update(CodeStats::CS_NumSpills); |
| 252 TLS->StatsCumulative.update(CodeStats::CS_NumSpills); | 252 Tls->StatsCumulative.update(CodeStats::CS_NumSpills); |
| 253 } | 253 } |
| 254 void statsUpdateFills() { | 254 void statsUpdateFills() { |
| 255 if (!getFlags().getDumpStats()) | 255 if (!getFlags().getDumpStats()) |
| 256 return; | 256 return; |
| 257 ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS); | 257 ThreadContext *Tls = ICE_TLS_GET_FIELD(TLS); |
| 258 TLS->StatsFunction.update(CodeStats::CS_NumFills); | 258 Tls->StatsFunction.update(CodeStats::CS_NumFills); |
| 259 TLS->StatsCumulative.update(CodeStats::CS_NumFills); | 259 Tls->StatsCumulative.update(CodeStats::CS_NumFills); |
| 260 } | 260 } |
| 261 | 261 |
| 262 // These are predefined TimerStackIdT values. | 262 // These are predefined TimerStackIdT values. |
| 263 enum TimerStackKind { TSK_Default = 0, TSK_Funcs, TSK_Num }; | 263 enum TimerStackKind { TSK_Default = 0, TSK_Funcs, TSK_Num }; |
| 264 | 264 |
| 265 // newTimerStackID() creates a new TimerStack in the global space. | 265 // newTimerStackID() creates a new TimerStack in the global space. |
| 266 // It does not affect any TimerStack objects in TLS. | 266 // It does not affect any TimerStack objects in TLS. |
| 267 TimerStackIdT newTimerStackID(const IceString &Name); | 267 TimerStackIdT newTimerStackID(const IceString &Name); |
| 268 // dumpTimers() dumps the global timer data. As such, one probably | 268 // dumpTimers() dumps the global timer data. As such, one probably |
| 269 // wants to call mergeTimerStacks() as a prerequisite. | 269 // wants to call mergeTimerStacks() as a prerequisite. |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } | 497 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } |
| 498 ~OstreamLocker() { Ctx->unlockStr(); } | 498 ~OstreamLocker() { Ctx->unlockStr(); } |
| 499 | 499 |
| 500 private: | 500 private: |
| 501 GlobalContext *const Ctx; | 501 GlobalContext *const Ctx; |
| 502 }; | 502 }; |
| 503 | 503 |
| 504 } // end of namespace Ice | 504 } // end of namespace Ice |
| 505 | 505 |
| 506 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H | 506 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H |
| OLD | NEW |