| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 Constant *getConstantUndef(Type Ty); | 205 Constant *getConstantUndef(Type Ty); |
| 206 /// Returns a zero value. | 206 /// Returns a zero value. |
| 207 Constant *getConstantZero(Type Ty); | 207 Constant *getConstantZero(Type Ty); |
| 208 /// getConstantPool() returns a copy of the constant pool for | 208 /// getConstantPool() returns a copy of the constant pool for |
| 209 /// constants of a given type. | 209 /// constants of a given type. |
| 210 ConstantList getConstantPool(Type Ty); | 210 ConstantList getConstantPool(Type Ty); |
| 211 /// Returns a copy of the list of external symbols. | 211 /// Returns a copy of the list of external symbols. |
| 212 ConstantList getConstantExternSyms(); | 212 ConstantList getConstantExternSyms(); |
| 213 | 213 |
| 214 /// Return a locked pointer to the registered jump tables. | 214 /// Return a locked pointer to the registered jump tables. |
| 215 LockedPtr<JumpTableDataList> getJumpTables() { | 215 JumpTableDataList getJumpTables(); |
| 216 return LockedPtr<JumpTableDataList>(&JumpTables, &JumpTablesLock); | |
| 217 } | |
| 218 /// Create a new jump table entry and return a reference to it. | 216 /// Create a new jump table entry and return a reference to it. |
| 219 JumpTableData &addJumpTable(IceString FuncName, SizeT Id, SizeT NumTargets); | 217 JumpTableData &addJumpTable(IceString FuncName, SizeT Id, SizeT NumTargets); |
| 220 | 218 |
| 221 const ClFlags &getFlags() const { return Flags; } | 219 const ClFlags &getFlags() const { return Flags; } |
| 222 | 220 |
| 223 bool isIRGenerationDisabled() const { | 221 bool isIRGenerationDisabled() const { |
| 224 return getFlags().getDisableIRGeneration(); | 222 return getFlags().getDisableIRGeneration(); |
| 225 } | 223 } |
| 226 | 224 |
| 227 /// Allocate data of type T using the global allocator. We allow entities | 225 /// Allocate data of type T using the global allocator. We allow entities |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 typedef std::vector<std::function<void()>> DestructorArray; | 458 typedef std::vector<std::function<void()>> DestructorArray; |
| 461 GlobalLockType DestructorsLock; | 459 GlobalLockType DestructorsLock; |
| 462 DestructorArray Destructors; | 460 DestructorArray Destructors; |
| 463 | 461 |
| 464 ICE_CACHELINE_BOUNDARY; | 462 ICE_CACHELINE_BOUNDARY; |
| 465 // Managed by getConstantPool() | 463 // Managed by getConstantPool() |
| 466 GlobalLockType ConstPoolLock; | 464 GlobalLockType ConstPoolLock; |
| 467 std::unique_ptr<ConstantPool> ConstPool; | 465 std::unique_ptr<ConstantPool> ConstPool; |
| 468 | 466 |
| 469 ICE_CACHELINE_BOUNDARY; | 467 ICE_CACHELINE_BOUNDARY; |
| 470 // Managed by getJumpTables() | 468 // Managed by getJumpTableList() |
| 471 GlobalLockType JumpTablesLock; | 469 GlobalLockType JumpTablesLock; |
| 472 JumpTableDataList JumpTables; | 470 JumpTableDataList JumpTableList; |
| 473 | 471 |
| 474 ICE_CACHELINE_BOUNDARY; | 472 ICE_CACHELINE_BOUNDARY; |
| 475 // Managed by getErrorStatus() | 473 // Managed by getErrorStatus() |
| 476 GlobalLockType ErrorStatusLock; | 474 GlobalLockType ErrorStatusLock; |
| 477 ErrorCode ErrorStatus; | 475 ErrorCode ErrorStatus; |
| 478 | 476 |
| 479 ICE_CACHELINE_BOUNDARY; | 477 ICE_CACHELINE_BOUNDARY; |
| 480 // Managed by getStatsCumulative() | 478 // Managed by getStatsCumulative() |
| 481 GlobalLockType StatsLock; | 479 GlobalLockType StatsLock; |
| 482 CodeStats StatsCumulative; | 480 CodeStats StatsCumulative; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 VariableDeclarationList Globals; | 513 VariableDeclarationList Globals; |
| 516 // TODO(jpp): move to EmitterContext. | 514 // TODO(jpp): move to EmitterContext. |
| 517 VariableDeclaration *ProfileBlockInfoVarDecl; | 515 VariableDeclaration *ProfileBlockInfoVarDecl; |
| 518 | 516 |
| 519 LockedPtr<ArenaAllocator<>> getAllocator() { | 517 LockedPtr<ArenaAllocator<>> getAllocator() { |
| 520 return LockedPtr<ArenaAllocator<>>(&Allocator, &AllocLock); | 518 return LockedPtr<ArenaAllocator<>>(&Allocator, &AllocLock); |
| 521 } | 519 } |
| 522 LockedPtr<ConstantPool> getConstPool() { | 520 LockedPtr<ConstantPool> getConstPool() { |
| 523 return LockedPtr<ConstantPool>(ConstPool.get(), &ConstPoolLock); | 521 return LockedPtr<ConstantPool>(ConstPool.get(), &ConstPoolLock); |
| 524 } | 522 } |
| 523 LockedPtr<JumpTableDataList> getJumpTableList() { |
| 524 return LockedPtr<JumpTableDataList>(&JumpTableList, &JumpTablesLock); |
| 525 } |
| 525 LockedPtr<CodeStats> getStatsCumulative() { | 526 LockedPtr<CodeStats> getStatsCumulative() { |
| 526 return LockedPtr<CodeStats>(&StatsCumulative, &StatsLock); | 527 return LockedPtr<CodeStats>(&StatsCumulative, &StatsLock); |
| 527 } | 528 } |
| 528 LockedPtr<TimerList> getTimers() { | 529 LockedPtr<TimerList> getTimers() { |
| 529 return LockedPtr<TimerList>(&Timers, &TimerLock); | 530 return LockedPtr<TimerList>(&Timers, &TimerLock); |
| 530 } | 531 } |
| 531 LockedPtr<DestructorArray> getDestructors() { | 532 LockedPtr<DestructorArray> getDestructors() { |
| 532 return LockedPtr<DestructorArray>(&Destructors, &DestructorsLock); | 533 return LockedPtr<DestructorArray>(&Destructors, &DestructorsLock); |
| 533 } | 534 } |
| 534 | 535 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } | 615 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } |
| 615 ~OstreamLocker() { Ctx->unlockStr(); } | 616 ~OstreamLocker() { Ctx->unlockStr(); } |
| 616 | 617 |
| 617 private: | 618 private: |
| 618 GlobalContext *const Ctx; | 619 GlobalContext *const Ctx; |
| 619 }; | 620 }; |
| 620 | 621 |
| 621 } // end of namespace Ice | 622 } // end of namespace Ice |
| 622 | 623 |
| 623 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H | 624 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H |
| OLD | NEW |