| 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 /// \file | 10 /// \file |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 // Try to ensure mutexes are allocated on separate cache lines. | 440 // Try to ensure mutexes are allocated on separate cache lines. |
| 441 | 441 |
| 442 // Destructors collaborate with Allocator | 442 // Destructors collaborate with Allocator |
| 443 ICE_CACHELINE_BOUNDARY; | 443 ICE_CACHELINE_BOUNDARY; |
| 444 // Managed by getAllocator() | 444 // Managed by getAllocator() |
| 445 GlobalLockType AllocLock; | 445 GlobalLockType AllocLock; |
| 446 ArenaAllocator<> Allocator; | 446 ArenaAllocator<> Allocator; |
| 447 | 447 |
| 448 ICE_CACHELINE_BOUNDARY; | 448 ICE_CACHELINE_BOUNDARY; |
| 449 // Managed by getDestructors() | 449 // Managed by getDestructors() |
| 450 typedef std::vector<std::function<void()>> DestructorArray; | 450 using DestructorArray = std::vector<std::function<void()>>; |
| 451 GlobalLockType DestructorsLock; | 451 GlobalLockType DestructorsLock; |
| 452 DestructorArray Destructors; | 452 DestructorArray Destructors; |
| 453 | 453 |
| 454 ICE_CACHELINE_BOUNDARY; | 454 ICE_CACHELINE_BOUNDARY; |
| 455 // Managed by getConstantPool() | 455 // Managed by getConstantPool() |
| 456 GlobalLockType ConstPoolLock; | 456 GlobalLockType ConstPoolLock; |
| 457 std::unique_ptr<ConstantPool> ConstPool; | 457 std::unique_ptr<ConstantPool> ConstPool; |
| 458 | 458 |
| 459 ICE_CACHELINE_BOUNDARY; | 459 ICE_CACHELINE_BOUNDARY; |
| 460 // Managed by getJumpTableList() | 460 // Managed by getJumpTableList() |
| (...skipping 10 matching lines...) Expand all Loading... |
| 471 GlobalLockType StatsLock; | 471 GlobalLockType StatsLock; |
| 472 CodeStats StatsCumulative; | 472 CodeStats StatsCumulative; |
| 473 | 473 |
| 474 ICE_CACHELINE_BOUNDARY; | 474 ICE_CACHELINE_BOUNDARY; |
| 475 // Managed by getTimers() | 475 // Managed by getTimers() |
| 476 GlobalLockType TimerLock; | 476 GlobalLockType TimerLock; |
| 477 TimerList Timers; | 477 TimerList Timers; |
| 478 | 478 |
| 479 ICE_CACHELINE_BOUNDARY; | 479 ICE_CACHELINE_BOUNDARY; |
| 480 /// StrLock is a global lock on the dump and emit output streams. | 480 /// StrLock is a global lock on the dump and emit output streams. |
| 481 typedef std::mutex StrLockType; | 481 using StrLockType = std::mutex; |
| 482 StrLockType StrLock; | 482 StrLockType StrLock; |
| 483 Ostream *StrDump; /// Stream for dumping / diagnostics | 483 Ostream *StrDump; /// Stream for dumping / diagnostics |
| 484 Ostream *StrEmit; /// Stream for code emission | 484 Ostream *StrEmit; /// Stream for code emission |
| 485 Ostream *StrError; /// Stream for logging errors. | 485 Ostream *StrError; /// Stream for logging errors. |
| 486 | 486 |
| 487 ICE_CACHELINE_BOUNDARY; | 487 ICE_CACHELINE_BOUNDARY; |
| 488 | 488 |
| 489 Intrinsics IntrinsicsInfo; | 489 Intrinsics IntrinsicsInfo; |
| 490 const ClFlags &Flags; | 490 const ClFlags &Flags; |
| 491 // TODO(jpp): move to EmitterContext. | 491 // TODO(jpp): move to EmitterContext. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 } | 538 } |
| 539 | 539 |
| 540 llvm::SmallVector<ThreadContext *, 128> AllThreadContexts; | 540 llvm::SmallVector<ThreadContext *, 128> AllThreadContexts; |
| 541 llvm::SmallVector<std::thread, 128> TranslationThreads; | 541 llvm::SmallVector<std::thread, 128> TranslationThreads; |
| 542 llvm::SmallVector<std::thread, 128> EmitterThreads; | 542 llvm::SmallVector<std::thread, 128> EmitterThreads; |
| 543 // Each thread has its own TLS pointer which is also held in | 543 // Each thread has its own TLS pointer which is also held in |
| 544 // AllThreadContexts. | 544 // AllThreadContexts. |
| 545 ICE_TLS_DECLARE_FIELD(ThreadContext *, TLS); | 545 ICE_TLS_DECLARE_FIELD(ThreadContext *, TLS); |
| 546 | 546 |
| 547 // Private helpers for mangleName() | 547 // Private helpers for mangleName() |
| 548 typedef llvm::SmallVector<char, 32> ManglerVector; | 548 using ManglerVector = llvm::SmallVector<char, 32>; |
| 549 void incrementSubstitutions(ManglerVector &OldName) const; | 549 void incrementSubstitutions(ManglerVector &OldName) const; |
| 550 | 550 |
| 551 public: | 551 public: |
| 552 static void TlsInit() { ICE_TLS_INIT_FIELD(TLS); } | 552 static void TlsInit() { ICE_TLS_INIT_FIELD(TLS); } |
| 553 }; | 553 }; |
| 554 | 554 |
| 555 /// Helper class to push and pop a timer marker. The constructor | 555 /// Helper class to push and pop a timer marker. The constructor |
| 556 /// pushes a marker, and the destructor pops it. This is for | 556 /// pushes a marker, and the destructor pops it. This is for |
| 557 /// convenient timing of regions of code. | 557 /// convenient timing of regions of code. |
| 558 class TimerMarker { | 558 class TimerMarker { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } | 601 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } |
| 602 ~OstreamLocker() { Ctx->unlockStr(); } | 602 ~OstreamLocker() { Ctx->unlockStr(); } |
| 603 | 603 |
| 604 private: | 604 private: |
| 605 GlobalContext *const Ctx; | 605 GlobalContext *const Ctx; |
| 606 }; | 606 }; |
| 607 | 607 |
| 608 } // end of namespace Ice | 608 } // end of namespace Ice |
| 609 | 609 |
| 610 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H | 610 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H |
| OLD | NEW |